Comments (13)
@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.
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.
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
)
from oxforddown.
@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.
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 theoxforddown
sample content)
- In the case of names like 'von Goethe', which I just realised was sorted incorrectly by 'von' instead of 'Goethe', you just add
- 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.
@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:
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.
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
from oxforddown.
@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.
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.
@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.
... 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.
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.
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)
- "Render" output HOT 2
- Problem with number of authors and the et al. abbreviation HOT 1
- Figure caption placement HOT 2
- package โxelatexโ is not available for this version of R HOT 1
- Linespacing varies amongst pages HOT 8
- Table of contents preventing the LaTeX from compiling for PDF output HOT 5
- if show-abstract-in-toc: true, Abstract TOC hyperlink is to Acknowledgements HOT 1
- Cannot find font information and ways to change it HOT 1
- remove the page breaks for each chapter HOT 1
- Issues with pandoc-citeproc in oxforddown HOT 2
- Compilation problems HOT 4
- Adapting headings to local language
- Cannot Knit
- how create numbered examples HOT 1
- Note below figure in graphic environment
- Minitocs shift pages through the space they take up but don't adjust for this
- Missing Book Title in Bibliography Citations (citing book section)
- How to change font style
- cleaning auxiliary files when knitting single chapter HOT 2
- fresh downloaded oxforddown not building HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oxforddown.