Reference from a different folder
2,539
Technically, this should work (if not, post your MWE). See the following MWE.
main.tex
documentclass[12pt,a4paper]{book}
\begin{document}
\input{ch1/ch1.tex}
\input{ch2/ch2.tex}
\end{document}
now, ch1.tex
\chapter{ch1}
\begin{equation}
\label{eq:1}
x= x \,
\end{equation}
and ch2.tex
\chapter{ch2}
\begin{equation}
\label{eq:2}
x= x \,
\end{equation}
Eq.~\ref{eq:1} ...
produces, following ---
Related videos on Youtube
Author by
Niklas
Updated on August 01, 2022Comments
-
Niklas over 1 year
I'm writing my thesis and have trouble reference labels between chapters. My main folder look like this:
Main Folder, where I have the main tex file and folders where I have the main tex file and folders
- main tex file, where the documentclass, userpackage, etc are located. With the
\makechapter{The First Chapter} \input{Chapter1/chapter1.tex}
\makechapter{The Second Chapter} \input{Chapter2/chapter2.tex} - Chapter1 (Folder, where inside the file i write in)
chapter1.tex - Chapter2 (Folder, where inside the file i write in)
chapter2.tex
- main tex file, where the documentclass, userpackage, etc are located. With the
\makechapter{The First Chapter} \input{Chapter1/chapter1.tex}
When I write in chapter1.tex
\section(Chapter One) \label(Ch1) \begin{equation} \label{eq:1} a^2 + b^2 = c^2 \end{equation}
How can I in chapter2.tex file, reference the labels in chapter1, which is located in a file located in another folder?, for example when I write in chapter2.tex,
As equation\lable(eq:1)
in chapter\lable(Ch1)
show.Because now it just shows [??]
-
Niklas over 7 yearsThe chapter work but I can't ref to the equation
-
Admin over 7 yearsThe linking works for me. But you could try this. tex.stackexchange.com/questions/37452/…