Compiling LaTex bib source

LatexPdflatexBibtexCitations

Latex Problem Overview


I am writing my thesis in Latex, and I have the references in an own thesis.bib file which look as follows

@Article{xxx,
  author =       "D.A. Reinhard",
  title =        "Case Study",
  year =         "1985",
}

and I reference them in my main document as ~\cite{xxx}

When I compile then the main document with: pdflatex main.tex than it shows me question marks instead of the proper references to the bibliography. Do I also need to compile the bib source on its own? If yes, can somebody please tell me the command for Linux

Many thanks!

Latex Solutions


Solution 1 - Latex

You need to compile the bibtex file.

Suppose you have article.tex and article.bib. You need to run:

  • latex article.tex (this will generate a document with question marks in place of unknown references)
  • bibtex article (this will parse all the .bib files that were included in the article and generate metainformation regarding references)
  • latex article.tex (this will generate document with all the references in the correct places)
  • latex article.tex (just in case if adding references broke page numbering somewhere)

Solution 2 - Latex

You have to run 'bibtex':

latex paper.tex
bibtex paper
latex paper.tex
latex paper.tex
dvipdf paper.dvi

Solution 3 - Latex

I am using texmaker as the editor. you have to compile it in terminal as following:

  1. pdflatex filename (with or without extensions)
  2. bibtex filename (without extensions)
  3. pdflatex filename (with or without extensions)
  4. pdflatex filename (with or without extensions)

but sometimes, when you use \citep{}, the names of the references don't show up. In this case, I had to open the references.bib file , so that texmaker could capture the references from the references.bib file. After every edition of the bib file, I had to close and reopen it!! So that texmaker could capture the content of new .bbl file each time. But remember, you have to also run your code in texmaker too.

Solution 4 - Latex

Just in case it helps someone, since these questions (and answers) helped me really much; I decided to create an alias that runs these 4 commands in a row:

Just add the following line to your ~/.bashrc file (modify the main keyword accordingly to the name of your .tex and .bib files)

alias texbib = 'pdflatex main.tex && bibtex main && pdflatex main.tex && pdflatex main.tex'

And now, by just executing the texbib command (alias), all these commands will be executed sequentially.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKlausView Question on Stackoverflow
Solution 1 - LatexTadeusz A. KadłubowskiView Answer on Stackoverflow
Solution 2 - Latexuser59634View Answer on Stackoverflow
Solution 3 - Latexuser3015729View Answer on Stackoverflow
Solution 4 - LatexvabadaView Answer on Stackoverflow