[Tex/LaTex] TexMaker – working with multiple tex files, autocomplete is not working

cross-referencingincludetexmaker

Background:

The document that I am currently writing is getting pretty big, so I decided to split it.

I've tried \include and \input commands, but the problem still remains to be solved.

I have split Chapter one to file 1.tex from the main document, and include it with the mentioned commands (tried both).

Main file is marked as Master.

I am having cross referencing (equations, labels and so on) between different sections.

Problem

In file 1.tex, I am referencing labels and equations from different parts on the main document – before and after the \include command.

However, the auto-complete is only working for labels and equations that are mentioned before \include command, but not working for the ones which are inserted in main file after \include command.

Is there any way to fix this?

MWE:

Main.tex:

\documentclass{article}
\begin{document}
\section{1st}
\begin{equation}
    a=1
    \label{eq:1}
\end{equation}
all the equations of the paper: \ref{eq:1}, \ref{eq:2}, \ref{eq:3}

\include{2}

\section{3rd}
\begin{equation}
    a=3
    \label{eq:3}
\end{equation}
all the equations of the paper: \ref{eq:1}, \ref{eq:2}, \ref{eq:3}
\end{document}

2.tex:

\section{2st}
\begin{equation}
    a=2
    \label{eq:2}
\end{equation}
all the equations of the paper: \ref{eq:1}, \ref{eq:2}, \ref{eq:3}

In Main.tex autocomplete is working (when writing \ref…) for all 3 equations, but in 2.tex auto-complete is working only for the second one.

Best Answer

Have your main document in the current editing window. Now select Options-Define Current >Document as "Master Document". This will do what you are asking for, I just did it. Also, now you can compile from any of the files and it will work.

Just worked for me, thanks heaps. That was really annoying me. Much happier now...

Related Question