I am trying to use xr for crossreferences between two documents. I've used it before without a problem for a different project.
Here's the error message I get:
(/usr/local/texlive/2018/texmf-dist/tex/latex/tools/xr.sty))
! Incomplete \ifx; all text was ignored after line 12.
<inserted text>
\fi
<*> main
The call to \externaldocument
is on line 12 of the main document. I haven't been able to find any problem like this. Any idea what is going on?
Thanks
Edited:
With just these lines in the main.tex it still fails with the same error:
\documentclass{article}
\usepackage{xr}
\externaldocument{supporting}
\begin{document}
Test
\end{document}
The supporting.aux file contains:
\relax
\providecommand\zref@newlabel[2]{}
\providecommand\hyper@newdestlabel[2]{}
\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldcontentsline\contentsline
\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\ifx\hyper@anchor\@undefined
\let\contentsline\oldcontentsline
\let\newlabel\oldnewlabel
\fi}
\fi}
\global\let\hyper@last\relax
\gdef\HyperFirstAtBeginDocument#1{#1}
\providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{}
\bibstyle{pnas-new}
\babel@aux{english}{}
\newlabel{LastPage}{{}{1}{}{page.1}{}}
\xdef\lastpage@lastpage{1}
\xdef\lastpage@lastpageHy{1}
\expandafter\ifx\csname c@section@totc\endcsname\relax\newcounter{section@totc}\fi\setcounter{section@totc}{0}
\expandafter\ifx\csname c@figure@totc\endcsname\relax\newcounter{figure@totc}\fi\setcounter{figure@totc}{0}
\expandafter\ifx\csname c@table@totc\endcsname\relax\newcounter{table@totc}\fi\setcounter{table@totc}{0}
\expandafter\ifx\csname c@NAT@ctr@totc\endcsname\relax\newcounter{NAT@ctr@totc}\fi\setcounter{NAT@ctr@totc}{0}
\expandafter\ifx\csname c@movie@totc\endcsname\relax\newcounter{movie@totc}\fi\setcounter{movie@totc}{0}
\expandafter\ifx\csname c@dataset@totc\endcsname\relax\newcounter{dataset@totc}\fi\setcounter{dataset@totc}{0}
\expandafter\ifx\csname c@SItext@totc\endcsname\relax\newcounter{SItext@totc}\fi\setcounter{SItext@totc}{0}
The external document is a PNAS template from overleaf.
.aux
file that is referenced. is needed) – David Carlisle Sep 24 '18 at 16:26hyperref
? Then maybe use\usepackage{xr-hyper}
– user36296 Sep 24 '18 at 19:24