GeneralCan't get bibliography working

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
nicko
Posts: 1
Joined: Sun Mar 02, 2008 8:31 am

Can't get bibliography working

Post by nicko »

I should first mention that Im new to latex so Im probably asking a dumb question here.

I downloaded Mac-Tex, so it comes with TeXShop and BibDesk. I've put the latex and bibtex files I'm trying to work with below. My problem is, is that when I click the 'typeset' button in TeXShop, the resulting pdf doesn't include the Bibliography section. I managed to get it to come up with the Bibliography section once before, but it didn't have my reference in it.

I've read the documentation on the BibDesk and Bibtex sites but I still can't get it working, I guess I'm just slow.

Now I don't know if I have to somehow link them together, all I've done is place them in the same folder together and thats it.


Whats in the latex file

Code: Select all

\documentclass[a4paper,12pt]{book}
\usepackage{cite}
\begin{document}

\title{something}
\author{me}
\date{2nd March 2008}
\maketitle

\begin{equation}
z(w,z) = \int{\sin(x)}dx
\end{equation}
pretend reference \cite{Lang:2000}

\bibliography{references}
\bibliographystyle{apa}
\end{document}

Whats in the references.bib file

Code: Select all

@conference{Lang:2000,
	Address = {Athens, Greece},
	Author = {J.H. Lang},
	Booktitle = {Something else},
	Date-Added = {2008-03-02 10:59:35 +1100},
	Date-Modified = {2008-03-02 12:50:43 +1100},
	Pages = {20-30},
	Read = {No},
	Title = {Something},
	Year = {2000}}
any help would be appreciated.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Can't get bibliography working

Post by Juanjo »

The following code works with your bib file:

Code: Select all

\documentclass[a4paper,12pt]{book}
\usepackage{natbib}

\begin{document}

\title{something}
\author{me}
\date{2nd March 2008}
\maketitle

\begin{equation}
z(w,z) = \int{\sin(x)}dx
\end{equation}
pretend reference \cite{Lang:2000}

\bibliographystyle{apa}
\bibliography{references}

\end{document}
Since you use the apa bibstyle, it seems that you want an author-year style for citations, so the cite package makes no sense. Moreover, such a bibstyle requires an additional package, called astron, to define some internal commands. I didn't find it in MacTeX. Anyway, the natbib package provides a perfect replacement.

Now, copy the above code in your tex file and put the bib file in the same folder. Open the file with TeXShop. Then do this:
1) In the menu line, choose Typeset > LaTeX or, equivalently, press <apple key>+T. You get the pdf file in a new window.
2) Now choose Typeset > BibTeX. You see the console window with messages given by BibTeX.
3) Go back to the tex or pdf windows and repeat 1).
4) Repeat 1) again and you are done.

Every new change in the bib files should be followed by that cycle in order to include the modifications in the document.
darckhart
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am

Re: Can't get bibliography working

Post by darckhart »

Yes, I think you just may not have been running them enough times. You have to do tex, bibtex, tex, tex. where tex=tex,latex,pdflatex, whatever. I don't think you actually need to use a different bib package tho.
Post Reply