So I am trying to crossreference labels across two documents: draft.tex
and appendix.tex
. When compiling I get the following error message:
./draft04.tex:16: Package zref-xr Warning: File `appendix.aux' not found or empty,(zref-xr) labels not imported on input line 16.
These are the two preamples of the documents including an example of a label and a reference.
First draft.tex
:
\documentclass[11pt]{article}
\usepackage{mla}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[document]{ragged2e}
\usepackage[english]{babel}
\usepackage[backend=biber,style=mla]{biblatex}
\usepackage[hidelinks]{hyperref}
\usepackage{zref-xr,zref-user}
\zexternaldocument*{appendix}
\providecommand{\biburldatelong}{}
\bibliography{biblio.bib}
\begin{document}
...
see \ref{fig:01_examples}.
...
\end{document}
Then appendix.tex
:
\documentclass[11pt]{article}
\usepackage{mla_appendix}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[document]{ragged2e}
\usepackage[english]{babel}
\usepackage[hidelinks]{hyperref}
\usepackage{zref-xr,zref-user}
\zexternaldocument*{draft04}
\providecommand{\biburldatelong}{}
\begin{document}
...
\listoffigures
\newpage
\begin{figure}
\includegraphics[width=\textwidth]{img/01introduction/card_blackOps.jpg}
\caption{Testing the crossreference}
\label{fig:01_examples}
\end{figure}
...
\end{document}
These two documents are in the same directory. I really have no idea, why the appendix.aux
is not found, since I can open it and it does contain this line, which I thought was needed for the crossreference:
\newlabel{fig:01_examples}{{1}{2}{Testing the crossreference\relax }{figure.1}{}}
What am I doing wrong? Help would be very much appreciated.
Best Answer
I get
By default the label
fig:01_examples
is imported aszref
label and can be referenced by\zref{fig:01_examples}
(withzref-user
). If you want the traditional LaTeX references, you need:Then
\ref{fig:01_examples}
or\zref{fig:01_examples}
can be used.