Subject: bug#22504: 2014-11-01; RefTeX fails to find \input unless it is at the beginning of the line

From: Arash Esbati <[email-masked]>
Date: Mon, 01 Feb 2016 22:50:37 +0100

[email-masked] writes:

> The main file of my LaTeX document is mostly just a wrapper that
> includes the actual content:
>
>   \clearpage \input{algebra}
>   \clearpage\input{constructions}
>   \clearpage
>   \input{logic}
>   \clearpage
>   \input{model}
>   \clearpage
>   \input{derived}
>
> I would expect RefTeX to properly follow the \input commands, and find
> sections and labels in all the files. However, RefTeX only sees the
> sections and labels from logic, model and derived - the ones from
> algebra and constructions are missing. It seems that following \input
> only works if that command is right at the beginning of the file.

This is a documented feature of RefTeX:

,----
| 6.9 Problems and Work-arounds
| 
|     LaTeX commands
|     \input, \include, and \section (etc.) statements have to be first on
|     a line (except for white space).
| 
| http://www.gnu.org/software/auctex/manual/reftex.html#SEC54
`----

Move \input{algebra} and \input{constructions} into single lines and
you should be done.

Best, Arash