TeX - LaTeX Asked by grobber on June 25, 2021
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:
hyperref
externaldocument
entry
is only cited in one of the documentsbibtex
and then pdflatex
a couple more times the document actually compiles fine, bibliography and everything. So the error just gets ploughed over. I get the error only when the aux-file doesn't contain the bibentry command (so the compilation order is crucial).
You can avoid the error by using the xr-hyper package:
usepackage{xr-hyper}
usepackage{hyperref}
But this doesn't prevent that you get multiply defined labels, so using a prefix for the external document should be done too.
Answered by Ulrike Fischer on June 25, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP