I am using overleaf. I have two .tex
files like table.tex
and results.tex
. Please note that none of them are main.tex
. So all my preamble are in main.tex
file. Now, I would like to refer to a table in my results.tex
file and the table is written in table.tex
. I tried to use the xr package but latex won't allow me to have \usepackage{xr}
line in any other .tex
files as I need to declare it only in my preamble, i.e. main.tex
file. So, my question is, is there a way to cross reference between two .tex
files which are not main.tex
file?
Asked
Active
Viewed 1,173 times
1

Samiur Rahman
- 63
- 1
- 6
-
Do you include both files in your main document? – samcarter_is_at_topanswers.xyz Oct 22 '21 at 08:08
-
1@samcarter_is_at_topanswers.xyz yes, i just write `\begin{document} \input{tables} \input{results}` – Samiur Rahman Oct 22 '21 at 08:26
-
1The referencing should work out of the box with `\ref{...}`. If it does not work for you, please add a [mre] to your question. – samcarter_is_at_topanswers.xyz Oct 22 '21 at 08:37