8

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.

2
  • Welcome to TeX.SX! You may have a look on our starter guide. May 19, 2013 at 21:12
  • 4
    Next time, please strip down the examples and remove packages and commands that are not necessary for the problem (e.g. packages mla_appendix, wrapfig, graphicx, \includegraphics, bibliography stuff). May 19, 2013 at 21:14

1 Answer 1

12

I get

Package zref-xr Info: Label import from `appendix.aux' on input line 17.
Package zref-xr Info: Statistics for `appendix.aux':
(zref-xr)             1 LaTeX label(s) found.

By default the label fig:01_examples is imported as zref label and can be referenced by \zref{fig:01_examples} (with zref-user). If you want the traditional LaTeX references, you need:

\usepackage[...]{hyperref}
\usepackage{nameref}
\usepackage{zref-xr}
\zxrsetup{toltxlabel}
\zexternaldocument*{appendix}

Then \ref{fig:01_examples} or \zref{fig:01_examples} can be used.

1
  • It won't work with the code above if you try using \zref. You have to add \usepackage{zref-user,zref-xr}. Mar 26 at 20:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .