0

I am new to Latex and having trouble with undefined citations. I am using Texmaker on Ubuntu.

I have tried all of the suggestions so far, but the same problem persists.

This is most my main .tex-file that I use for quick build:

\documentclass[12pt]{book}

\usepackage{a4wide}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage[english, ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[bookmarks]{hyperref}
\usepackage{braket}
\usepackage{mathrsfs}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{natbib}

\pagestyle{fancyplain}
\renewcommand{\chaptermark}[1]%
         {\markboth{\thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]%
         {\markright{\thesection\ #1}}
\lhead[\fancyplain{}{\bfseries\thepage}]%
    {\fancyplain{}{\bfseries\rightmark}}
\rhead[\fancyplain{}{\bfseries\leftmark}]%
    {\fancyplain{}{\bfseries\thepage}}
\cfoot{}

\hypersetup {
pdfpagemode = {UseNone}
}

\begin{document}


  \frontmatter


  \include{pages/deckblatt}


  \include{pages/titleblatt}


  \include{pages/zweite_seite}


  \tableofcontents
  \markboth{Inhaltsverzeichnis}{Inhaltsverzeichnis}


  \listoffigures
  \markboth{Abbildungsverzeichnis}{Abbildungsverzeichnis}


  \listoftables
  \markboth{Tabellenverzeichnis}{Tabellenverzeichnis}
  \cleardoublepage


  \markboth{Zusammenfassung}{Zusammenfassung}
  \include{pages/zusammenfassung}


  \mainmatter\setcounter{page}{1}
  \include{chapter/kap_01}
  \include{chapter/kap_02}
  %\include{chapter/kap_03}
  %\include{chapter/kap_04} usw.
  \include{pages/anhang}


  \backmatter
  \bibliographystyle{unsrtnat}
  \bibliography{literatur}
  \markboth{}{}


  \include{pages/danksagung}


\end{document}

And this is the literatur.bib file in the same folder:

@Article{EPR,
  author    = {A. Einstein and B. Podolsky and N. Rosen},
  title     = {Can quantum-mechanical description of physical reality be considered complete?},
  journal   = {Physical Review},
  publisher = {American Physical Society},
  year      = {1935},
  volume    = {47},
  pages     = {777-780}
}

@Article{Aspect,
  author    = {A. Aspect and J. Dalibard and G. Roger},
  title     = {Experimental Test of Bell's Inequalities Using Time-Varying Analyzers},
  journal   = {Physical Review Letters},
  publisher = {American Physical Society},
  year      = {1982},
  volume    = {49},
  number    = {25},
  pages     = {1804-1807}
}

@Article{Bell,
  author    = {J. S. Bell},
  title     = {On the Einstein Podolsky Rosen Paradox},
  journal   = {Physics},
  publisher = {Physics Publishing Co.},
  year      = {1964},
  volume    = {1},
  number    = {3},
  pages     = {195-200}
}

@Article{Stern-Gerlach,
  author    = {W. Gerlach and O. Stern},
  title     = {Der experimentelle Nachweis der Richtungsquantelung im Magnetfeld},
  journal   = {Zeitschrift für Physik},
  band      = {9},
  year      = {1922},
  pages     = {349-352}
}

@Article{Bertlmann,
  author    = {J. S. Bell},
  title     = {Bertlmann's socks and the nature of reality},
  journal   = {Journal de Physique Colloques},
  year      = {1981},
  volume    = {42},
  number    = {C2},
  pages     = {41-62}
}

@Article{Bohm,
  author    = {D. Bohm and H. Aharonov},
  title     = {Discussion of experimental proof of the paradox of Einstein, Rosen, and Podolsky},
  journal   = {Physical Review},
  publisher = {American Physical Society},
  year      = {1957},
  volume    = {108},
  number    = {4},
  pages     = {1070-1076}
}

@Article{Innsbruck,
  author    = {G. Weihs and T. Jennewein and C. Simon and H. Weinfurter and A. Zeilinger},
  title     = {Violation of Bell’s inequality under strict Einstein locality conditions},
  journal   = {Physical Review Letters},
  publisher = {American Physical Society},
  year      = {1998},
  volume    = {81},
  number    = {23},
  pages     = {5039-5043}
}

@Article{CHSH,
  author    = {J. Clauser and M. Horne and A. Shimony and R. Holt},
  title     = {Proposed experiment to test local hidden-variables theories},
  journal   = {Physical Review Letters},
  publisher = {American Physical Society},
  year      = {1969},
  volume    = {23},
  number    = {15},
  pages     = {880-884}
}

@Article{Loopholefreebelltest,
  author    = {B. Hensen et al.},
  title     = {Loophole-free Bell test using electron spins in diamond: second experiment and additional analysis},
  journal   = {Scientific Reports},
  publisher = {Nature},
  year      = {2016},
  volume    = {6},
  number    = {30289},
  pages     = {1-11}
}

@Book{Ballentine,
    author        = {L. Ballentine},
    booktitle     = {Quantum Mechanics: A Modern Development},
    publisher     = {World Scientific Publishing Company},
    edition       = {2nd revised and edited edition},
    year          = {2014}
}

@Book{Sakurai,
    author        = {J. Sakurai and J. Napolitano},
    booktitle     = {Modern Quantum Mechanics},
    publisher     = {Pearson Education (US)},
    edition       = {2nd edition},
    year          = {2010}
}

@incollection{GHZ,
    author    = {D. Greenberger and M. Horne and A. Zeilinger},
    title     = {Bell’s Theorem, Quantum Theory and Conceptions of the Universe},
    series    = {Fundamental Theories of Physics},
    volume    = {37},
    publisher = {Springer},
    year      = {1989},
    pages     = {69-72}
}

@Book{Cohen-Tannoudji-1,
    author        = {C. Cohen-Tannoudji and B. Diu and F. Laloë and J. Streubel},
    booktitle     = {Quantenmechanik},
    volume        = {1},
    publisher     = {De Gruyter Studium},
    edition       = {5. Auflage},
    year          = {2019}
}

@Book{Cohen-Tannoudji-2,
    author        = {C. Cohen-Tannoudji and B. Diu and F. Lalo{\"e} and J. Streubel},
    booktitle     = {Quantenmechanik},
    volume        = {2},
    publisher     = {De Gruyter Studium},
    edition       = {5. Auflage},
    year          = {2019}
}

@Book{Bub,
    author        = {J. Bub},
    booktitle     = {Interpreting the Quantum World},
    publisher     = {Cambridge University Press},
    edition       = {1st revised edition},
    year          = {1999}
}

When I want to insert the citation in the appropriate place in kap_01.tex, I start typing \cit..., and I am already suggested \citep{According names in the .bib file}, which makes me think that the .bib file is in the right place and recognized, which seems to be the reason for most similar issues. There is some peculiar behavior here though: Sometimes the bib entries are not suggested and then, without me being aware of having made any changes, after a restart of the program, the suggestions are there again...

When I go "quick build", it reports undefined citations wherever I have used them and they are shown as question marks in the pdf.

Unfortunately, the log is to long to attach here, instead I've uploaded the file here: https://easyupload.io/9jhap8

The only .blg file I could find was last modified in Ocotber, so that can't be it. Back then I hadn't edited the bib-file either.

  • There is indeed something wrong in your .bib file that must be fixed, but I think that problem is unlikely to be the cause of the issue you ask about. Authors must be separated with and and not with , and. A comma may only be used to separate parts of a single name. The correct author field would be author = {J. Sakurai and J. Napolitano},. I would also remove the spaces after the opening and before the closing brace. A @book does not have a booktitle, it has a title. And the edition should go into the edition field and not the publisher field. – moewe Dec 29 '19 at 07:51
  • 1
    I just tried to compile the bits of code you posted. Firstly, jkthesis.bst was not found on my machine. A bit of googling suggests the file is available at https://ctan.org/tex-archive/macros/latex/contrib/jkthesis but it does not appear to be in either MikTeX or TeX live, so it has to be downloaded manually. Secondly, it turns out the wrong comma I mentioned above does cause an error. It must be fixed. Thirdly, jkthesis.bst is quite old and not fully compatible with natbib, in particular not with author-year citations and \citet. ... – moewe Dec 29 '19 at 07:58
  • ... If you don't have a good reason to use jkthesis, better pick another style. (For example unsrtnat or plainnat.) – moewe Dec 29 '19 at 07:58
  • @moewe I've also tried using 'title' instead of 'booktitle', but it does not help. Also, 'booktitle' is listed as a common field in BibTex. (near bottom of the following link). And they have also used ,and to separate the last author in places on this guide: https://www.overleaf.com/learn/latex/Bibliography_management_with_bibtex

    I've switched from jkthesis to unsrtnat as you can see. But I'm pretty sure the package is included on my machine, otherwise the error would be something like 'undefined references', right?

    Thanks for your help though, guys :)

    – Markus Gratis Dec 29 '19 at 12:57
  • The Overleaf page only uses , and when they give the bibliography manually in thebibliography. All examples for .bib entries correctly only use and without comma. booktitle might be listed among the common fields on that page, but it is not commonly recognised for @book entries. It would help if you could upload the .blg file (the log file of the BIbTeX run, on Windows machines .blg files may be classified as performance monitor files, but they are simple text files that can be opened with any text editor). If jkthesis is not found you get an error in the .blg file. – moewe Dec 29 '19 at 13:06
  • Note that whether or not your editor's auto completion finds certain .bib entries and displays them in a selection dialogue is largely independent of whether or not LaTeX and BibTeX can find the relevant .bib entry. Your editor uses vastly different means to find and read the .bib file than LaTeX and BibTeX. – moewe Dec 29 '19 at 13:07
  • If I turn the code posted so far into a minimal working example (https://tex.meta.stackexchange.com/q/228/35864) by removing all \include commands that reference files I don't have and adding a \nocite{*} I end up with a document that produces a bibliography. The .blg file contains Warning--empty title in Ballentine and a few similar complaints, but that only causes weird output (the title is missing) and does not stop the entry from appearing in the bibliography. So in theory, things can work. We need to see the .log and .blg files. – moewe Dec 29 '19 at 13:17
  • @moewe As you can see above, I can't provide a .blg file, unfortunately. Might the colon in the Ballentine title cause the error? Should I use \colon instead? – Markus Gratis Dec 29 '19 at 13:42
  • Colons in titles are absolutely no issue at all. Since booktitle is ignored for @book entries, the colon in Ballentine is doubly no problem. If you don't have a current .blg file that sort of suggests you didn't actually run BibTeX on your file. See https://tex.stackexchange.com/q/63852/35864 for explanations why that is necessary. – moewe Dec 29 '19 at 13:54
  • 1
    yes, that was the issue. I wasn't aware that I had to run anything extra at all. Thank you! :) – Markus Gratis Dec 29 '19 at 14:32

0 Answers0