1

Is it possible to do the following with AucTeX:

Suppose you have a master file (master.tex) like:

\documentclass{minimal}
\begin{document}
   \input{fileA}
   \input{fileB}
\end{document}

and for example fileA.tex looks like:

Some text

%% Local Variables:
%% coding: utf-8
%% TeX-master: "master.tex"
%% End:

Now I am looking for an easy way to navigate between the master and input files, so I need the following:

  1. Click (with modifier) on \input{fileA} in the master file to open fileA.tex or just switch to its buffer if it exists. Alternatively to clicking: move point to fileA an press some key sequence to do the same.

  2. When you are fileA.tex: Press a key sequence to open the master file or just switch to its buffer if it exists and move the point to the line \input{fileA}.

Same with \include instead of \input.

So, how can I do this or something similar in AucTeX?

student
  • 29,003
  • Have a look at find-file-at-point for question 1. Question 2 would require some elisp hacks with TeX-master and search-forward, and you would have to be very careful for example if you inadvertently input the same file twice (even in a comment). As an out-of-the-box solution, you can check reftex, and in particular its table of contents feature (C-c =). In that table of contents, pressing F will show the file boundaries, allowing you to perform the kind of navigation you request. – T. Verron Jun 04 '14 at 17:07
  • To find the master file I use (find-file (TeX-master-file t nil t)). – giordano Jun 04 '14 at 20:54

0 Answers0