Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm writing my PhD thesis with LaTeX-Sweave and I use EMACS with AucTex and ESS. I have a master file (master.tex) and some slave files and my question is about the use of the TOC in the slave files. How should I do to see the TOC on the slave files? Because when I pres C-c= I see only an empty TOC.

Do you have any suggestion?

share|improve this question
    
@ Ricca when you start Emacs in nw mode, do you get any error (at the bottom of the screen, just above the minibuffer)? –  richiemorrisroe Aug 23 '11 at 13:48
    
No, I don't see any error when I start EMACS in nw mode. –  Ricca Aug 28 '11 at 20:57
    
if you supply a simple, reproducible example, then you stand a much better chance of finding a solution. –  richiemorrisroe Aug 30 '11 at 9:27

4 Answers 4

You will have to provide further information. This works fine for me. Things to try/check:

  • Make sure reftex-mode is actually on. Your minibuffer/status line thing should say something like (LaTeX/MP Ref Abbrev)
  • Try refreshing the window: type r when in the C-c = window.
  • Add things to the variable reftex-include-file-commands (which is the variable which lists the commands reftex looks for when working out what other files to scrape TOC information from).
  • Go to the inputted file and type C-c = there. Then go back to the main file to see if that's made a difference.
  • Make sure the files contain some \section commands or similar, since they are the kind of things that show up in the TOC.

To add a new input command to the reftex-include-file-commands variable, type: M-x customize-variable RET reftex-include-file-commands. Something like this should appear:

emacs customize variable

move the cursor to INS so an empty line shows up and type the name of the input command there. for example, I have added schminput to my command list. Now, if I had \let\schminput\input in my .tex file, reftex would know to search schminput-ed files for TOC info.

share|improve this answer
    
Hi, thanks for you suggestion:1) reftex is on; I hve tried to refresh the TOC but nothing happens; 3) how can I include the variable to reftex-include-file-command?? Have I to add some code to .emacs?? –  Ricca Aug 22 '11 at 13:26
    
@Ricca see edits: (a) a new thing to check (b) an explanation of how to customise a variable. –  Seamus Aug 22 '11 at 13:43
    
Thanks but what is schminput?? I haven't understand wich file. –  Ricca Aug 22 '11 at 14:13
    
schminput is an example. If you are including files using commands other than \input and \include then reftex won't recognise them. This is illustrating emacs' user interface to edit its variables. It doesn't matter what file you type the command in. –  Seamus Aug 22 '11 at 14:17
    
Ok, I included the slave file I work with but, neither in master file neither in slave file TOC is running OK –  Ricca Aug 22 '11 at 14:44

I believe (having recently experienced similar problems) that it may be the result of one of the following:

Firstly, ensure that reftex-mode is turned on - M-x reftex-mode.

1) You may need to integrate reftex with auctex - M-x reftex-toggle-plug-into-AUCTeX, and/or

2) You may need to go to the ref menu, and then select Parse-Entire Document.

Hope this helps.

share|improve this answer
    
Just done but nothing changed, still empty TOC... –  Riccardo Aug 23 '11 at 9:37
    
is there any chance you could post a reproducible example? Starting emacs using -nw might also help, as something could be interfering with reftex. –  richiemorrisroe Aug 23 '11 at 9:43
    
How can I start EMACS using -nw?? What should do?? –  Riccardo Aug 23 '11 at 10:56
    
@ Ricardo - what system are you using. On Linux (possibly also Mac) you go to a terminal, and type emacs -nw. Let me know what system it is and i can try to help. –  richiemorrisroe Aug 23 '11 at 11:13
    
I work with a MacBook with osX 10.5.8; I have tried to start emacs in -nw mode but typing C-c = the TOC is still empty. –  Ricca Aug 24 '11 at 9:41

Multifile support in AUCTeX is off by default since it does surprising things for users who have no idea what a .tex file is. The first page of the manual tells you how to enable this (and syntax parsing).

Your subordinate files need to have set the top file as "master file". If this structure is known to AUCTeX, table of contents should work.

However, RefTeX does not talk by default with AUCTeX, so you should consult its manual as well to figure out the required settings for letting it take the multifile info over from AUCTeX.

share|improve this answer

I solved this problem by using the complete file name including the extension. That may not be necessary for LaTeX to include the files but apparently, AucTeX needs the extension to find the files. So, instead of

\include{introduction}

I used

\include{introduction.tex}

That did the trick for me.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.