LaTEX: changing the format of citation in References to list authors' last name first - latex

It seems the format in the Reference section is a little off! Can you please show me how to format the citation to list authors' last name first?
Thanks all.
Here is the current form in the Reference section:
C. B. Grimmond, A. Isard, and J. Belding. Development and evaluation of
continuously weighing mini-lysimeters. Agricultural and Forest Meteorology,
62(3-4):205{218, 1992.
I use BibDesk to organize the citation database. Here is what I am using in the TeXstudio:
\documentclass[]{article}
\usepackage[pdftex]{graphicx}
\usepackage[round]{natbib}
\begin{document}
\bibliographystyle{plainnat}
\bibliography{/Users/me/Citation/citation}
\end{document}

You can try to change the Bibtex Bibliography style to 'acm' or 'apalike'
\bibliographystyle{stylename}
\bibliography{bibfile}
Read more about other styles: https://www.sharelatex.com/learn/Bibtex_bibliography_styles

Related

Natbib: maximum number of authors in bibliography

I am using natbib to set up the bibliography in a latex document.
I would like citations to appear in the text as:
Author 1 et al., 2022
In the bibliography, I would like the citation to appear with a maximum of three authors. For example:
Author 1, Author 2, Author 3, et al. 2022, journal, page, number
I am currently using:
\usepackage[]{natbib}
...
...
\bibliographystyle{plainnat}
\bibliography{literatur}
which writes the citation as I want, but writes all the authors in the bibliography.
Is there a simple way to have max three authors in the bibliography with natbib?
Or possible alternatives with bibtex?
Here an alternative using biblatex (make sure to compile with biber instead of bibtex)
\documentclass{article}
\usepackage[style=authoryear,minbibnames=3,natbib=true]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\cite{murray}
\printbibliography
\end{document}

Print parts of bibliography using BibTeX?

For some days I am trying to solve the following problem for which I wasn't able to find a solution. Help is very much appreciated.
I am writing a long document and for some sections I would like to print a subset of items from the total bibliography that will be included at the very end before the appendix.
Is there a way do this? I was playing with refsection and imagining something like:
\documentclass[ twoside,openright,titlepage,numbers=noenddot,
headinclude,footinclude,
cleardoublepage=empty,abstract=on,
BCOR=5mm,paper=a4,fontsize=11pt
]{scrreprt}
\usepackage{biblatex}
\addbibresource[label=ownpubs]{ownpubs.bib}
\addbibresource[label=refs]{references.bib}
\begin{document}
%here I want to print a selection of the complete bibliography
%References are required to be consistent throughout the whole document
\chapter*{Related Publications}
\begin{refsection}[references.bib]
\nocite{*}
\printbibliography[heading=none]
\end{refsection}
%here goes all the other stuff: chapters, sections, whatever
%print complete bibliography
\nocite{*}
\printbibliography
\end{document}
ownpubs.bib:
#article{einstein1935can,
title={Can quantum-mechanical description of physical reality be considered complete?},
author={Einstein, Albert and Podolsky, Boris and Rosen, Nathan},
journal={Physical review},
volume={47},
number={10},
pages={777},
year={1935},
publisher={APS}
}
#article{einstein1905movement,
title={On the movement of small particles suspended in stationary liquids required by the molecularkinetic theory of heat},
author={Einstein, A},
journal={Ann. d. Phys},
volume={17},
number={549-560},
pages={1},
year={1905}
}
references.bib:
#article{schrodinger1935gegenwartige,
title={Die gegenw{\"a}rtige Situation in der Quantenmechanik},
author={Schr{\"o}dinger, Erwin},
journal={Naturwissenschaften},
volume={23},
number={50},
pages={844--849},
year={1935},
publisher={Springer-Verlag}
}
With the above code I got the bibliographies printed, but the references (numbers) are not consistent.
Does anyone know a way to approach this problem? I am in no means restricted to splitting the files up. That was just the only solution I was able to come up with.
Thanks for your help and warm Greetings!
You could use a similar approach as in https://tex.stackexchange.com/a/166018 and automatically add some keyword to all entries in references.bib. This will allow you to filter for those when using \printbibliography:
\documentclass[ twoside,openright,titlepage,numbers=noenddot,
headinclude,footinclude,
cleardoublepage=empty,abstract=on,
BCOR=5mm,paper=a4,fontsize=11pt
]{scrreprt}
\usepackage{biblatex}
\addbibresource[label=ownpubs]{ownpubs.bib}
\addbibresource[label=refs]{references.bib}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite]{
\perdatasource{references.bib}
\step[fieldset=keywords, fieldvalue={,Perhalo}, append]
}
}
}
\begin{document}
%here I want to print a selection of the complete bibliography
%References are required to be consistent throughout the whole document
\chapter*{Related Publications}
\printbibliography[heading=none,keyword={Perhalo}]
%here goes all the other stuff: chapters, sections, whatever
%print complete bibliography
\nocite{*}
\printbibliography
\end{document}

Hyperlinking to a bibitem in LaTeX

Here is a minimum working example:
\documentclass{article}
\usepackage{natbib,xspace}
\usepackage[colorlinks,citecolor=blue,linkcolor=blue]{hyperref}
\newcommand{\BOGOS}{\hyperlink{BriEtal18a}{BOGOS}\xspace}
\begin{document}
In this article we reference \cite{BriEtal18a} many times. I want to create the shortcut \BOGOS that will still link to the reference in the bibliography. This does not work yet.
\begin{thebibliography}{}
\bibitem[Briol et~al., 2018]{BriEtal18a}
Briol, F.-X., Oates, C.~J., Griolami, M., Osborne, M.~A., and Sejdinovic, D.
(2018+).
\newblock Probabilistic integration: A role in statistical computation?
\newblock {\em Statist.\ Sci.}
\newblock to appear.
\end{thebibliography}
\end{document}
If one clicks on the hyperlink for the citation it sends you to the reference. If one clicks on my abbreviation, nothing happens. I need to know what the right label is. Can you help?
Since you're using natbib, you can define a citation alias which will be displayed instead of the regular \cite:
\documentclass{article}
\usepackage{natbib}
\usepackage[colorlinks,citecolor=blue,linkcolor=blue]{hyperref}
\defcitealias{BriEtal18a}{BOGOS}% Define a citation alias
\newcommand{\BOGOS}{\citetalias{BriEtal18a}}% Use shorthand
\begin{document}
In this article we reference \citet{BriEtal18a} many times.
I want to create the shortcut \BOGOS{} that will still link to the reference in the bibliography.
\begin{thebibliography}{}
\bibitem[Briol et~al., 2018]{BriEtal18a}
Briol, F.-X., Oates, C.~J., Griolami, M., Osborne, M.~A., and Sejdinovic, D.
(2018+).
\newblock Probabilistic integration: A role in statistical computation?
\newblock {\itshape Statist.\ Sci.}
\newblock to appear.
\end{thebibliography}
\end{document}

Appendix after references not in toc and figure label missing

I am trying to set up my Appendix for my master's thesis which includes basically only figures. These will be referenced at the end of the "List of figures".
My intention is to have figures called "Fig. A.1", "Fig. A.2" etc.
Also, the appendix should be part of the table of contents.
This works fine, as long as it appears before the bibliography.
However, the appendix should appear afterwards, and as soon as I move it there, the Figures are only called "Fig. .1" and it disappears from the TOC. (Note that the figures still show up in the list of figures, however with the wrong names).
How can I reach the same result while having the Appendix BELOW the references?
\documentclass[a4paper, 12pt]{article}
\usepackage{fancyhdr}
\renewcommand{\figurename}{Fig.}
\begin{document}
\tableofcontents
\fancyhead[EC]{\large REFERENCE LIST}% page header is always ``Reference List''
\fancyhead[OC]{\large REFERENCE LIST}%
\section* {Reference List} %removes the section from sections numbers and TOC
\addcontentsline {toc}{section}{Reference List} %adds the section to TOC
\bibliographystyle{THESIS2} %my custom bibliography style
\renewcommand{\section}[2]{} %removes superfluous ``References'' title
\bibliography{Literatur} %calls my .bib file
\newpage
\fancyhead[EC]{\large APPENDIX}
\fancyhead[OC]{\large APPENDIX}
\addcontentsline {toc}{section}{Appendix}
\appendix
\section{Appendix}
\end{document}
Thanks for your help!

How to order citations by appearance using BibTeX?

By default (using the plain style) BibTeX orders citations alphabetically.
How to order the citations by order of appearance in the document?
There are three good answers to this question.
Use the unsrt bibliography style, if you're happy with its formatting otherwise
Use the makebst (link) tool to design your own bibliography style
And my personal recommendation:
Use the biblatex package (link). It's the most complete and flexible bibliography tool in the LaTeX world.
Using biblatex, you'd write something like
\documentclass[12pt]{article}
\usepackage[sorting=none]{biblatex}
\bibliography{journals,phd-references} % Where journals.bib and phd-references.bib are BibTeX databases
\begin{document}
\cite{robertson2007}
\cite{earnshaw1842}
\printbibliography
\end{document}
Change
\bibliographystyle{plain}
to
\bibliographystyle{ieeetr}
Then rebuild it a few times to replace the .aux and .bbl files that were made when you used the plain style.
Or simply delete the .aux and .bbl files and rebuild.
If you use MiKTeX you shouldn't need to download anything extra.
The best I came up with is using the unsrt style, which seems to be a tweaked plain style. i.e.
\bibliographystyle{unsrt}
\bibliography{bibliography}
However what if my style is not the default?
Just a brief note - I'm using a modified version of plain.bst sitting in the directory with my Latex files; it turns out having sorting by order of appearance is a relatively easy change; just find the piece of code:
...
ITERATE {presort}
SORT
...
... and comment it - I turned it to:
...
%% % avoid sort:
%% ITERATE {presort}
%%
%% SORT
...
... and then, after running bibtex, pdflatex, pdflatex - the citations will be sorted by order of appearance (that is, they will be unsorted :) ).
Cheers!
EDIT: just realized that what I wrote is actually in the comment by #ChrisN: "can you edit it to remove the SORT command" ;)
You answered your own question---unsrt is to be used when you want references to ne listed in the order of appeareance.
But you might also want to have a look at natbib, an extremely flexible citation package. I can not imagine living without it.
I'm a bit new to Bibtex (and to Latex in general) and I'd like to revive this old post since I found it came up in many of my Google search inquiries about the ordering of a bibliography in Latex.
I'm providing a more verbose answer to this question in the hope that it might help some novices out there facing the same difficulties as me.
Here is an example of the main .tex file in which the bibliography is called:
\documentclass{article}
\begin{document}
So basically this is where the body of your document goes.
``FreeBSD is easy to install,'' said no one ever \cite{drugtrafficker88}.
``Yeah well at least I've got chicken,'' said Leeroy Jenkins \cite{goodenough04}.
\newpage
\bibliographystyle{ieeetr} % Use ieeetr to list refs in the order they're cited
\bibliography{references} % Or whatever your .bib file is called
\end{document}
...and an example of the .bib file itself:
#ARTICLE{ goodenough04,
AUTHOR = "G. D. Goodenough and others",
TITLE = "What it's like to have a sick-nasty last name",
JOURNAL = "IEEE Trans. Geosci. Rem. Sens.",
YEAR = "xxxx",
volume = "xx",
number = "xx",
pages = "xx--xx"
}
#BOOK{ drugtrafficker88,
AUTHOR = "G. Drugtrafficker",
TITLE = "What it's Like to Have a Misleading Last Name",
YEAR = "xxxx",
PUBLISHER = "Harcourt Brace Jovanovich, Inc."
ADDRESS = "The Florida Alps, FL, USA"
}
Note the references in the .bib file are listed in reverse order but the references are listed in the order they are cited in the paper.
More information on the formatting of your .bib file can be found here: http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management
I often use the bibliography style natbib because it supplies quite complete set of formats as well as tags for us.
Add this if you want the number of citations to appear in order in the document
they will only be unsorted in the reference page:
\bibliographystyle{unsrt}
I used the following in overleaf and become in ascending order:
\usepackage{cite}
\bibliographystyle{unsrt}
with unsrt the problem is the format. use \bibliographystyle{ieeetr} to get refences in order of citation in document.
If you happen to be using amsrefs they will override all the above - so comment out:
\usepackage{amsrefs}
The datatool package offers a nice way to sort bibliography by an arbitrary criterion, by converting it first into some database format.
Short example, taken from here and posted for the record:
\documentclass{article}
\usepackage{databib}
\begin{document}
% First argument is the name of new datatool database
% Second argument is list of .bib files
\DTLloadbbl{mybibdata}{acmtr}
% Sort database in order of year starting from most recent
\DTLsort{Year=descending}{mybibdata}
% Add citations
\nocite{*}
% Display bibliography
\DTLbibliography{mybibdata}
\end{document}
I use natbib in combination with bibliographystyle{apa}. Eg:
\begin{document}
The body of the document goes here...
\newpage
\bibliography{bibliography} % Or whatever you decided to call your .bib file
\usepackage[round, comma, sort&compress ]{natbib}
bibliographystyle{apa}
\end{document}

Resources