Clarification
If I understand your question correctly, this is how your files are structured.
File: main.tex
\documentclass[a4paper]{article}
% ---- Load Packages ----
\usepackage[utf8]{inputenc} % Use UTF8 encoding
\usepackage{fullpage}
\usepackage{lipsum}
\usepackage{hyperref}
\begin{document}
\title{Some MWE}
\author{Samuel}
\maketitle
% Include file1.tex
\input{./file1}
% Include file2.tex
\input{./file2}
\end{document}
File: file1.tex
\section{Introduction}
\label{sec:intro}
\lipsum[1-2]
\section{Method}
\label{sec:method}
\lipsum[1-2]
File: file2.tex
\section{Results}
\label{sec:results}
\lipsum[1-2]
\section{Conclusion}
\label{sec:conc}
\lipsum[1-2]
\par As seen in section~\ref{sec:intro}, we know that we can
link back to it from a separate file!
Solution
If you noticed, I've sneaked the solution in above. In the main file I specified the preamble, the packages to be used and declared the document structure.
In the body of the main document (main.tex
), I have used the \input{...}
command to take the contents of the other .tex
files named file1.tex
and file2.tex
and inject it at the points specified.
When compiled, the file looks like this: (tidied for clarity)
\documentclass[a4paper]{article}
% ---- Load Packages ----
\usepackage[utf8]{inputenc} % Use UTF8 encoding
\usepackage{fullpage}
\usepackage{lipsum}
\usepackage{hyperref}
\begin{document}
\title{Some MWE}
\author{Samuel}
\maketitle
% Include file1.tex
\section{Introduction}
\label{sec:intro}
\lipsum[1-2]
\section{Method}
\label{sec:method}
\lipsum[1-2]
% Include file2.tex
\section{Results}
\label{sec:results}
\lipsum[1-2]
\section{Conclusion}
\label{sec:conc}
\lipsum[1-2]
\par As seen in section~\ref{sec:intro}, we know that we can
link back to it from a separate file!
\end{document}
From the above, you can see that the cross referencing will work just fine with the standard \ref
and \ref*
and also their enhanced forms such as when used with the hyperref
package as above.