Giter Club home page Giter Club logo

Comments (13)

zavud avatar zavud commented on August 27, 2024 1

@ulyngs it actually does! I am really surprised because I did it multiple times yesterday (I swear :D) and failed to achieve this. But when copying from your comment here, it somehow (and perhaps "magically") worked! Thanks a lot for bearing with me and continuously giving suggestions! :)

from oxforddown.

ulyngs avatar ulyngs commented on August 27, 2024

my guess is that they're presented in the order in which they appear in the text - to change to alphabetical order, google for how to set this as an option for natbib, then try to adjust accordingly in template.tex at this location

\usepackage{natbib}
\setcitestyle{$natbib-citation-style$}
\bibliographystyle{$natbib-bibliography-style$}

from oxforddown.

ulyngs avatar ulyngs commented on August 27, 2024

Ok, I just looked at this properly.

Turns out I already designed the template to make this easy to set directly from index.Rmd's YAML header. Just use e.g.

use-natbib: true
natbib-citation-style: authoryear
natbib-bibliography-style: plainnat

(remember to set use-biblatex: false)

see https://tex.stackexchange.com/questions/425837/alphabetical-sorting-of-the-bibliography-using-natbib-and-unsrtnat

from oxforddown.

zavud avatar zavud commented on August 27, 2024

@ulyngs I have seen this post (tex stackexchange) and tried the trick before and nothing helped. I have tried other things as well, still no progress.

Regarding your assumption on how the references are ordered: they are not presented in the order they appear in the text. After analyzing it a bit, I figured out how they are presented: they are actually presented alphabetically, however, based on the name that comes the last. For example, if some author is called "Lee Zaa Ann" then this will come the first (because the last name in the full name starts with "A"). Conversely, if someone is called "Ann Lee Zaa" then this will be presented as the last reference. But what I really want is "Ann Lee Zaa" to be treated as the first author and so on. Do you happen to have a workaround for this? Thanks :)

from oxforddown.

ulyngs avatar ulyngs commented on August 27, 2024

Interesting, so you want ordering based on first number rather than last name? That feels slightly strange to me - wouldn't you always want sorting based on family name?

Either way, I think there's two options:

  • if you actually meant ordering based on family name, but it just happens to be the case that some other name than the actual family is parsed as as the family name, then the issue is just in your .bib entry. Go and find the entry and correct the name in there.
    • In the case of names like 'von Goethe', which I just realised was sorted incorrectly by 'von' instead of 'Goethe', you just add sortname={Beethoven} in your bib entry (see this tex stackexchange - I just fixed this in the oxforddown sample content)
  • if you do indeed mean ordering based on first name, then you can use a custom .bst file for the bibliography style (like the example I've included in the templates folder of the ACM reference format) - google how to tweak a bst file to make the sorting based on first name rather than family name

from oxforddown.

zavud avatar zavud commented on August 27, 2024

@ulyngs I am not really sure if I have to sort based on family or last name. I am just trying to write a normal-looking thesis (following the universal rules) :) and I read a lot of scientific papers and other theses and in all of them ordering is based on whatever comes first. And honestly, I do not know which name is someone's family and first names.

For example, this is a part from the last page of my references:

image

As you can see, you can find authors in the last page whose names start with "A" or "D" and so on. This may look very confusing and strange to the readers.

from oxforddown.

ulyngs avatar ulyngs commented on August 27, 2024

So the sorting in your current reference list is indeed by last name, i.e. family name:

  • Rosema
  • Schlerf
  • Senf
  • Simon
  • Sinha
  • Suits
  • Tuia
  • Upreti

This is expected behaviour.

It sounds like you actually just want their names to appears as "Upreti, Deepak" and so on, so that their family name is written before their first name in the reference list, which makes it immediately obvious that the sorting is alphabetical by family name

https://tex.stackexchange.com/questions/131087/displaying-authors-name-in-a-bibliographic-entry-in-the-form-surname-first-in

from oxforddown.

zavud avatar zavud commented on August 27, 2024

@ulyngs yes, this post makes sense. I downloaded the plainnat.bst file and put it in the templates directory. And then, I followed the answer in the link you shared. However, nothing really changed. Perhaps the the line natbib-bibliography-style: templates/myplainnat.bst in the yaml is overwritten by some line in the template.tex?

Even before I downloaded the plainnat.bst file, everything looked the same in the reference. Before downloading plainnat.bst , ACM-Reference-Format.bst was in use

from oxforddown.

ulyngs avatar ulyngs commented on August 27, 2024

to see if anything is getting overridden in unexpected ways, have a look at docs/_main.tex after you built to PDF - then you can see exactly what gets inserted in the .tex file that LaTeX builds the PDF from

you should also just try changing something at random in your templates/mypainnat.bst file and see if that propagates to the final PDF in the way you'd expect. The simplest way to start would be to just write a bunch of gibberish in that file and see if you get an error message when trying to build to PDF, as you'd expect

from oxforddown.

zavud avatar zavud commented on August 27, 2024

@ulyngs I checked the docs/_main.tex file as suggested. templates/myplainnat.bst has been inserted, which seems right.

I also did templates/mypainnat.bst as you suggested. It did give me an error without completing the knitting process.

from oxforddown.

ulyngs avatar ulyngs commented on August 27, 2024

... and are you able to make some sort of change in the bst files that also changes things in the reference list? E.g. try to remove the author names from appearing at all, just to make sure you can actually make it affect stuff in the output, then experiment from there

from oxforddown.

zavud avatar zavud commented on August 27, 2024

I am not sure how you completely remove the author names from appearing (first time in my life that I am dealing with a .bst file :D ). But I did remove the line { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := from the .bst file and I got an error when I tried to knit the file.

from oxforddown.

ulyngs avatar ulyngs commented on August 27, 2024

does it work as expected when you change this

{ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=

to this

{ s nameptr "{vv~}{ll}{, f.}{, jj}" format.name$ 't :=

As per this

from oxforddown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.