3

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?

closed as unclear what you're asking by user36296, Phelype Oleinik, Stefan Pinnow, Bobyandbob, Troy Jun 7 '18 at 20:05

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome to TeX.SX! Very well written question! – egreg Feb 4 '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 4 '18 at 23:09
  • try deleting bibliography_test.aux then run pdflatex and bibtex again – David Carlisle Feb 4 '18 at 23:21
  • I deleted bibliography_test_aux and reran latex and bibtex again and it didn't help, unfortunately. – frelk Feb 5 '18 at 3: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 5 '18 at 8:07