I have a document with multiple chapters written in seperate .tex files. I want to cross reference figures/tables/sections between the .tex files.
So the structure would be:
fulldocument.tex
\documentclass[12pt]{scrartcl}
\usepackage{xr-hyper}
\usepackage{hyperref}
\begin{document}
\include{chapter1.tex}
\include{chapter2.tex}
\end{document}
chapter1.tex
\section{start} \label{sec:start}
\ref{here I would like to cross-reference to a table/section/figure from chapter2.tex}
chapter2.tex
\section{beginning} \label{sec:beginning}
\begin{table}[h]
\centering
\caption{description}
\label{tab:table1}
\begin{tabular}
asdf
\end{tabular}
\end{table}
However, when using \ref-command in chapter1.tex I can only choose the labels from chapter1.tex but not from the other document.
I have looked up the already existing question here (Cross-referencing between different files ) but this suggestion does not work, since I get the error that \usepackage{xr-hyper}is only allowed in the preamble, which is not the case here, since the preamble in my structure is only in fulldocument.tex, not in the other .tex files.
Has someone a solution for me?
Thanks in advance!
\label/\refacross the whole document. You do not need xr (or xr-hyper) – David Carlisle Apr 06 '21 at 08:53\ref{tab:table1}– Ulrike Fischer Apr 06 '21 at 10:53