# Why does \cite work but \citep and \ref do not?

I'm using a Makefile that was working which looks:

# partly autogenerated, that's why it's so ugly!

# say 'make V=1' to see the full build output
ifndef V
Q = @
Q_LATEX = sh -c 'echo -e "   " echo $$(basename "$$0") | tr a-z A-Z"\t$${!\#/..\/..\//}"; ! "$$0" "$$@" | grep -A5 -E "^[^ ]+:[0-9]+:"' Q_OTHER = sh -c 'echo -e " " echo$$(basename "$$0") | tr a-z A-Z"\t$${!\#/..\/..\//}"; "$$0" "$$@" >/dev/null'
endif

LATEX = latex
PDFLATEX = pdflatex
BIBTEX = bibtex
DVIPS = dvips
DVIPDF = dvipdf
PDFTOEPS = pdftops -eps
PDFTOPS = pdf2ps
EPSTOPDF = epstopdf
FIGTODEV = fig2dev
MPOST = mpost

.PHONY: all clean archive

all:  thesis

texfiles = $(wildcard *.tex) .PHONY: thesis thesis: thesis.pdf thesis.ps thesis.pdf:$(texfiles) thesis.bbl
$(Q) rm -rf build/pdf/; mkdir -p build/pdf/$(Q) cd build/pdf/ && TEXINPUTS="../../:$$TEXINPUTS" (Q_LATEX) (PDFLATEX) -interaction=nonstopmode -file-line-error ../../thesis.tex (Q) cd build/pdf/ && TEXINPUTS="../../:$$TEXINPUTS" $(Q_LATEX)$(PDFLATEX) -interaction=nonstopmode -file-line-error ../../thesis.tex
$(Q) ln -f build/pdf/thesis.pdf thesis.pdf thesis.dvi:$(texfiles) thesis.bbl
$(Q) rm -rf build/dvi/; mkdir -p build/dvi/$(Q) cd build/dvi/ && TEXINPUTS="../../:$$TEXINPUTS" (Q_LATEX) (LATEX) -interaction=nonstopmode -file-line-error ../../thesis.tex (Q) cd build/dvi/ && TEXINPUTS="../../:$$TEXINPUTS" $(Q_LATEX)$(LATEX) -interaction=nonstopmode -file-line-error ../../thesis.tex
$(Q) ln -f build/dvi/thesis.dvi thesis.dvi thesis.ps: thesis.dvi$(Q)$(Q_OTHER)$(DVIPS) -q thesis

thesis.aux: $(texfiles)$(Q) $(Q_LATEX)$(LATEX) -interaction=nonstopmode -file-line-error thesis.tex

thesis.bbl: thesis.aux
$(Q)$(Q_OTHER) $(BIBTEX) thesis clean: rm -rf build/ rm -f *.aux rm -f thesis.dvi thesis.idx thesis.ind thesis.ilg thesis.out thesis.toc thesis.pdf thesis.log thesis.bbl archive: thesis-template.zip thesis-template.zip: *.tex Makefile ETHlogo.* refs.bib mkdir -p thesis cp git ls-files "*.tex" Makefile "ETHlogo.*" refs.bib thesis/ perl -i -pe 's/\$$VERSION\$$/'"$\$(git describe)/" thesis/*.tex
rm -f thesis-template.zip
zip -r thesis-template.zip thesis/


This is an example.tex file:

\documentclass[a4paper, 12pt]
{article}
\usepackage[natbibapa]{apacite}

\begin{document}
\section{Reference}

\citep{Feller}

\cite{Feller}

\bibliographystyle{apacite}
%\bibliographystyle{apa}
%\bibliography{plainnat}
\bibliography{refs}

\end{document}


And the generated refs.bib from endnote:

@BOOK{Feller,
author = {Feller, William},
title = {An introduction to probability theory and its applications},
publisher = {Wiley},
series = {Wiley mathematical statistics series},
note = {50008529
diagrs. 24 cm.
Vol. 2 has series: Wiley series in probability and mathematical statistics.
Bibliographical footnotes. "Some books on cagnate subjects": v. 2, p. 615-616.},
keywords = {Probabilities.},
year = {1950},
type = {Book}
}


If I try to use \ref{label} BibTex doesn't create the updated .bbl file, even after deleting all files by hand.

Using \citep{label} BibTex creates the .bbl, I get ?? as a reference in my document.

If I use \cite{label} BibTex creates the .bbl file and I get the reference in my bibliography, but I don't see the reference in my document.

Now If I use TexWorks and \cite{label} I have to run pdfLatex 3 times BibTex once and pdfLatex again to create the reference, but \citep{label} doesn't work. I have no idea how to make \ref{label} work.

• \ref{label} is to reference to internal counters, for sections or figures. It will never work with bib-entries. – Johannes_B Jun 28 '15 at 14:27
• Thanks! Any idea why \citep{label} won't work?... Also let me know if you can comment on the make file – ilciavo Jun 28 '15 at 14:38
• The Makefile is irrelevant. A minimal example of LaTeX code is needed. – egreg Jun 28 '15 at 14:38
• Maybe you need something like \usepackage{natbib}? \citep is not a standard LaTeX command as far as I know. – cfr Jun 28 '15 at 14:42
• Your example works fine for me. You need to post an MWE which can be used to reproduce the problem you are asking about. I ran pdflatex then bibtex then pdflatex then pdflatex and everything got resolved fine. – cfr Jun 28 '15 at 15:01