33

I'm having some problems with my bibliography in Texmaker. My code is:

\documentclass[11pt, a4paper]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{natbib}
\usepackage[utf8]{inputenc}    
\usepackage{natbib}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}

....

\cite{Johnson}
\bibliographystyle{plain}
\bibliography{mybib}

\end{document}

I also created a new file (File > New) that I saved as mybib.bib:

@Article{Johnson,
author = {Edgar G. Johnson and Alfred O. Nier},
title = {Angular Aberrations in Sector Shaped Electromagnetic Lenses for Focusing Beams of 
Charged Particles},
journal = {Physical Review},
year = {1953},
volume = {91},
number = {1},
}

@phdthesis{Zoran,
author = {Zoran Racic},
title = {\'Etude et essais du spectromètre à plasma {DYMIO} de la  mission {MARS 96}},
publisher = {Université Pierre et Marie Curie},
year = {1996}
}

When I compile my .tex file, I only have a [?] appearing.

Could you tell me what my mistake is?

51

Your problem is that, after running pdflatex (or latex or whatever else) and bibtex (if you did it), you have to run pdflatex twice afterwards to get your document fully compiled.

In TeXMaker, if you want to be able to perform the full compilation cycle and view your finished .pdf file by just pressing F1, you can configure your 'Quick Build' command, choosing the wizard in the 'Configure TeXMaker' -> 'Quick Build' dialog, and adding, in the following sequence:

PdfLaTeX

Bibtex

PdfLaTeX

PdfLaTeX

Pdf Viewer

If you want to use a different engine, substitute pdflatex with your preferred one. If the one is latex also substitute Pdf Viewer with Dvi Viewer in the above sequence.

| improve this answer | |
  • Is there a way to permanently save these settings? I have entered them several times now. – kilojoules Aug 6 '16 at 22:02
  • 1
    I found the Quick build in the Preferences... menu instead of Configure TeXMaker. But it worked, thanks! – abichat Feb 8 '19 at 14:26
9

Well, I speak Spanish and I was breaking my head over this a few moments ago (since I decided to try Texmaker), so I'll tell the basic points in the Spanish answer, which might be helpful.

  • Go to Options > Wizard (or configure Texmaker)
  • In "Commands" (the top section), uncheck the "Use a "build" subdirectory for output files" (so sad now we'll have to use a crowded folder) (actually this is the root of this issue)
  • In "Compiling" select the PdfLatex + Bib(la)tex + PdfLatex(2x) + View Pdf option for the "Quick compile command"

Basically, from now on what you'll have to do is press F1 (the quick compile shortcut), or set the compiling arrow at the upper bar to "Quick compile" (in my language it's just "Compile") and click there.

You won't need to touch the the "see pdf" arrow, since that's just for visualization.

The whole problem, actually is because Texmaker can't find the .aux file in the build subdirectory.

| improve this answer | |
  • If you still face error, check if you've included a bibliography style. I for example used \bibliography{apacite}. In case you're using the same style, don't forget to add \usepackage{apacite}. – user145142 Nov 1 '17 at 18:18
  • The third bullet finally worked for me!! Thank you! – Lisa Dec 18 '17 at 18:03
5

This was my solution share it with you I hope will be helpful

enter image description here

| improve this answer | |
  • 6
    please notice that the language of the site is English. Your answer might not accessible for users who do not speak spanish – Guido Mar 16 '14 at 0:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.