tuxu / ethz-thesis

LaTeX template for a PhD thesis at ETH Zurich
95 stars 48 forks source link

Bibliography & citations fail - March 2020 #4

Open omit45 opened 4 years ago

omit45 commented 4 years ago

Hi,

First of all thank you for the great template! When I run your original thesis.tex file with TeXShop (4.44), everything works except the bibliography. Citations are not shown correctly, e.g. [codata] instead [1] and the bibliography is not printed at all.

Do you have any solution to this problem?

Cheers

tuxu commented 4 years ago

Just tested with MacTeX 2019 and the TeXShop 4.44. The problem is with the commands for compiling the TeX files and bibliography, which default to pdflatex and bibtex.

Change it to pdflatexmk and everything works as expected:

texshop

See also more details in https://github.com/tuxu/ethz-thesis/issues/3, which describes essentially the same problem.

omit45 commented 4 years ago

Hello, Thank you for your help, with pdflatexmk it works for me as well! Another question: for my thesis I would like to have separated references for every chapter. How would you implement that? I already tried the following within the main.tex file of individual chapters: \begin{refsection}[bibliography] \printbibliography[heading=none] \end{refsection}[bibliography] Unfortunately this was not successful. Somehow it creates a bibliography of all references from the whole document (after the first chapter) and the subsequent bibliographies+citations do not work.. I would appreciate any hint! Cheers

anfoss commented 4 years ago

One solution is to copy compile the chapters separately, and copy paste the .bbl file content into the chapter. A bit hacky but does the trick

tuxu commented 4 years ago

Seems like the most elegant way is with biblatex' refsection environment. Did you try without the [bibliography]?

There's a complete example on Overleaf: https://de.overleaf.com/latex/examples/per-chapter-bibliographies-with-biblatex/yhdqvxtftwxf

susierao commented 1 year ago

Thank you very much @tuxu for this amazing template.

One glitch I spent quite some time fixing is the biblatex to natbib, when using authoryear style, which is the required style of ETHZ dissertation nowadays. The former will be outdated quite soon, so the standard bibliography package is natbib.

One needs to only change the following lines.

  1. In preamble/general.txt,

% % Biblatex % \input{preamble/biblatex} % do not use this \usepackage[sort]{natbib} \setcitestyle{authoryear} \bibliographystyle{plainnat}

  1. In thesis.tex,

% \cleardoublepage\include{frontbackmatter/bibliography}

\bibliographystyle{plainnat} % Specify the bibliography style \bibliography{bibliography} % Specify the name of your .bib file