LaTeX: Troubleshooting Bibliography Citations and References

In summary, the conversation discusses the issue of correctly citing sources in a LaTeX document. The source code compiles and generates a PDF, but the citation number appears as "??", and the bibliography section is not generated. The conversation also mentions the use of BibTeX and the need to run LaTeX, BibTeX, and LaTeX again to generate the references list. The individual eventually figures out the issue and decides to do the references by hand instead.
  • #1
Saladsamurai
3,020
7
I am looking through all sorts of tutorials and I could swear I am doing this right. But obviously not. The source code compiles and generated the PDF just fine, but no citation number shows up (just ?? in stead) and no bibliography section is generated.

Here is a sample code. I know the preamble is obnoxious, but I inherited it from someone else.

Code:
%*****************************************PREAMBLE*********************************
%*******************************CLASSES/PACKAGES*******************************
\documentclass[11pt]{article}
\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                   % ... or a4paper or a5paper or ... 
%\geometry{landscape}                % Activate for for rotated page geometry
%\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{setspace}		 %allows line space too be changed w/in document
\usepackage{times}			 %change default font to times new roman
\usepackage{indentfirst} 		 %indent 1st line of paragraph after new section
\usepackage{textcomp}
\usepackage{tocbibind}

%No idea what this does
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

%*****************************************TWEAK OVERALL PAGE LAYOUT*******************************

%change default line spacing: double space = 1.6 And 1.5 space = 1.3  <--go figure
\linespread{1.6}


%number equations according to section number
\numberwithin{equation}{section}		
\setlength\textheight{7.7in}				
\setlength\textwidth{6.5in}			
% Left margin on odd numbered pages + 1 inch
\setlength\oddsidemargin{0in}			
% Left margin on even numbered pages + 1 inch
\setlength\evensidemargin{0in}			
% Amount of indentation at the first line of a paragraph
\setlength\parindent{0.25in}				
% Distance between paragraphs (Any time LaTeX sees a blank line, it treats the next line as the start of a new paragraph)
%\setlength\parskip{0.25in}				

%*****************************************MAIN DOCUMENTt*******************************
\begin{document}

I am trying to cite this article number \cite{Zurek}

\clearpage 
\bibliographystyle{plain}
\bibliography{ref1}



\end{document}

This is the contents of the bibtex file named ref1.bib I created it and saved it as a .bib file. Did I need to do anything else with it? Like 'run' it or something?

Code:
@ARTICLE{Zurek,
   AUTHOR  = {Zurek, R. W. and Martin, L. J.},
   TITLE   = {Interannual Variability of planet-encircling dust activity on {M}ars},  
   YEAR    = {1993},
   JOURNAL = jgr,
   VOLUME  = {98},
   NUMBER  = {E2},
   PAGES   = {3247--3259}
}
 
Physics news on Phys.org
  • #2
I have no idea why this is not working. I have tried several examples from online including BibDesk and nothing. I might have to do this by hand :/
 
  • #3
Stating the obvious but: Do you know that you need to run latex, bibtex, latex and then latex again on your source document to generate the references list?
 
  • #4
Hootenanny said:
Stating the obvious but: Do you know that you need to run latex, bibtex, latex and then latex again on your source document to generate the references list?

Hi Hootenanny :smile: No I did not. But I wound up figuring this out. Unfortunately, BibTex is so temperamental about other stuff, that I had to do my references by hand anyway. I am sure it's great if you have the time to master it, but for writing the one thesis I'll ever write ... I should have just used MS Word

Thanks for replying though!
 
  • #5


It seems like you have all the necessary components for your bibliography to work, but there may be a few things you could check to troubleshoot the issue:

1. Make sure you are using the correct citation style in your document. In this case, you are using "plain" as your bibliography style, which means that the citations will appear as numbers in the text and the bibliography will be in the order they are cited. If you want to use a different style, such as author-year, you will need to change the \bibliographystyle command to the appropriate style.

2. Check that the \cite command is correctly referencing the entry in your bibtex file. In this case, the entry is labeled as "Zurek" in your bibtex file, so the correct command would be \cite{Zurek}.

3. Make sure you are compiling your document with the correct sequence of commands. In this case, you will need to run LaTeX, then run BibTeX, and then run LaTeX twice more to ensure that all the references and citations are correctly updated.

4. Check that your bibtex file is in the same directory as your main document and that the file name is correctly spelled in your \bibliography command.

If none of these solutions work, you may want to try a different bibliography style or consult a LaTeX troubleshooting forum for further assistance.
 

FAQ: LaTeX: Troubleshooting Bibliography Citations and References

What is LaTeX?

LaTeX is a typesetting system used to create high-quality documents, particularly in the fields of mathematics, science, and engineering. It allows for precise control over formatting and can handle complex equations and scientific notation.

What is a bibliography in LaTeX?

A bibliography in LaTeX is a list of sources used in a document, generally formatted according to a specific citation style. It is typically placed at the end of a document and can include books, articles, websites, and other sources.

How do I create a bibliography in LaTeX?

To create a bibliography in LaTeX, you will need to use a bibliography management tool such as BibTeX or BibLaTeX. These tools allow you to organize your sources and automatically generate a formatted bibliography based on your chosen citation style.

What is a BibTeX file?

A BibTeX file is a plain text file that contains bibliographic information for your sources, such as the author, title, and publication details. It is used by the BibTeX tool to generate a bibliography in your LaTeX document.

How do I troubleshoot issues with my bibliography in LaTeX?

If you are having trouble with your bibliography in LaTeX, it is important to first check that your BibTeX file is correctly formatted and that all necessary information is included. You may also need to check your citation style and make sure it is compatible with your sources. If you continue to have issues, it can be helpful to consult online resources or seek assistance from other LaTeX users.

Similar threads

Replies
3
Views
438
Replies
8
Views
11K
Replies
4
Views
2K
Replies
1
Views
3K
Replies
11
Views
4K
Replies
5
Views
10K
Replies
5
Views
4K
Replies
1
Views
7K
Back
Top