I have a problem when I use a cross-reference from other files. I have a folder in which there is a main.tex file and a subfolder (Chapter) containing Chapter1.tex and Chapter2.tex.
In the main file, I include only the chapter files like this:
\include{Chapters/Chapter1}
\include{Chapters/Chapter2}
My problem is that in the Chapter2.tex file I need to reference a section from Chapter1.
Chapter1.tex
\documentclass{standalone}
\begin{document}
\chapter{chapter}
\label{ch:first_chapter}
\section{first section}\label{sc:first_section}
some Text..........
\end{document}
Chapter2.tex
\documentclass{standalone}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument[C1-]{/Chapter1}
\begin{document}
\chapter{Second Chapter}
\label{ch:second_chapter}
\section{section}\label{sc:first_section_ch2}
Some text...text \ref{C1-sc:first_section}
\end{document}
When I compile the file, only ?? appears.
\chapteris defined for the standalone document class. Besides this, for me this sounds more like a job for https://www.ctan.org/pkg/subfiles?lang=en then forstandalone. – samcarter_is_at_topanswers.xyz Jul 04 '17 at 16:29