5

I'm trying to insert citations and a bibliography in ASA citation style using natbib. I'm trying to adapt a latex file that a friend sent me, since generating bibliographies is new to me. The bibliography is generated perfectly well but all of the citations show up as question marks and the console prints the error: Missing = inserted for \ifnum

Sample code:

\documentclass[letterpaper,12pt,openany]{memoir}
\usepackage{natbib} % ASA citation style

\begin{document}

\chapter{Introduction}
\thispagestyle{empty}

This is the introduction. \citep{Rubin1974}

%% Bibliography
\bibliographystyle{asa}
\bibliography{testbibliography}

\end{document}

My testbibliography document is the following:

%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/

%% Saved with string encoding Unicode (UTF-8) 

@article{Rubin1974,
    Author = {B. Rubin, Donald},
    Booktitle = {Journal of Educational Psychology},
    Date-Added = {2018-02-02 05:35:05 +0000},
    Date-Modified = {2018-02-02 16:48:13 +0000},
    Journal = {Journal of Educational Psychology},
    Month = {10},
    Title = {Estimating causal effects of treatments in randomized and nonrandomized studies},
    Volume = {66},
    Year = {1974}}

Additionally, I downloaded the files asa.bst and asa.sty from this site, since I was initially getting errors about missing these files.

I keep getting the following error:

This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
(./bibliography_test.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2015/texmf-dist/tex/latex/memoir/memoir.cls
Document Class: memoir 2015/04/23 v3.7d configurable book, report, article docu
ment class
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/ifetex/ifetex.sty
(/usr/local/texlive/2015/texmf-dist/tex/plain/ifetex/ifetex.tex))
(/usr/local/texlive/2015/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/etex-pkg/etex.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/memoir/mem12.clo)
(/usr/local/texlive/2015/texmf-dist/tex/latex/memoir/mempatch.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/natbib/natbib.sty)
(./bibliography_test.aux)
./bibliography_test.tex:9: Missing = inserted for \ifnum.
<to be read again> 
                   \def 
l.9 This is the introduction. \citep{Rubin1974}

In other words, I always get this error when I try to insert citations (Missing = inserted for \ifnum). However, the bibliography itself is fine and any article that I try to cite will show up appropriately in the bibliography. However, the citations themselves always show up as question marks. Any ideas what is going wrong here?

frelk
  • 151
  • 1
  • 2
  • Welcome to TeX.SX! Very well written question! – egreg Feb 04 '18 at 20:25
  • your latex is a little old, but I'm surprised if there are any changes related to this. But using texlive 2017 the files above plus asa.bst from the link you gave, I get no error. – David Carlisle Feb 04 '18 at 23:09
  • try deleting bibliography_test.aux then run pdflatex and bibtex again – David Carlisle Feb 04 '18 at 23:21
  • I deleted bibliography_test_aux and reran latex and bibtex again and it didn't help, unfortunately. – frelk Feb 05 '18 at 03:43
  • add \listfiles to your preamble (then a list of package versions shows in the log if you scroll past errors and get to the end of the file. If you add that and show the log, someone might be able to help more. I tried texlive 2016 and 2017 and your example worked in both without error, I do not have an older installation easily available. – David Carlisle Feb 05 '18 at 08:07
  • @egreg could you try on tl2015 ? – David Carlisle Feb 05 '18 at 08:08
  • I compiled this with all versions of TeX Live I have (2012–2017) with no error. Can you please add the output you get on the console and in the log file after adding \listfiles at the top of the test document? What is needed is the part from `FIle List up to the end. – egreg Feb 05 '18 at 08:29

0 Answers0