TransWikia.com

Cross-referencing between different .tex filex

TeX - LaTeX Asked by Han on May 24, 2021

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!

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP