I have the following .tex
file in a folder
main.tex
---
\documentclass[11pt]{article}
\usepackage{hyperref}
\title{}
\author{}
\begin{document}
\maketitle
\cite{entry}
\bibliography{bib}{}
\bibliographystyle{plain}
\end{document}
In the same folder, I have another file that uses the main one as an \externaldocument
, also citing the same entry entry
from the same bib
file:
secondary.tex
---
\documentclass[11pt]{article}
\usepackage{hyperref}
\usepackage{xr}
\externaldocument{main}
\title{}
\author{}
\begin{document}
\maketitle
\cite{entry}
\bibliography{bib}{}
\bibliographystyle{plain}
\end{document}
The problem is that when I compile secondary.tex
I get the following error, pointing to the citation:
--- TeX said ---
<argument> ... {}\edef \Hy@tempb {cite.\XR@prefix
entry\@extra@b@citeb }\ifx...l.15 \cite{entry}
Other symptoms:
- no error if I remove
hyperref
- no error if I turn off
\externaldocument
- no error if
entry
is only cited in one of the documents - even with the error, if I persist and run
bibtex
and thenpdflatex
a couple more times the document actually compiles fine, bibliography and everything. So the error just gets ploughed over.