bug-auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-AUCTeX] TeX fill instead of LaTeX fill for \subsection at top o


From: Chris Pickett
Subject: Re: [Bug-AUCTeX] TeX fill instead of LaTeX fill for \subsection at top of file
Date: Sat, 22 Nov 2008 01:24:43 -0500
User-agent: Thunderbird 1.5.0.14 (Macintosh/20071210)

Ralf Angeli wrote:

Wow, you make me jump through hoops.  I had to switch to a Linux console
to see what you mean because the GTK port behaves differently.  So I
guess I can confirm it.  But couldn't you just have said "Yes, there is
a menu called 'Command'"?

I'm sorry, I thought you meant there should be a Command sub-menu or menu item specific for AUCTeX. I didn't realize everything in Command was AUCTeX specific, or I thought a Command menu existed normally, or I don't even know what I thought. Something illogical, but I guess I rarely use menus. Mea culpa for not reading closely.

This was just an example demonstrating that forcing LaTeX mode under
every circumstance is not a good idea.

Looking at the manual and seeing it applies to TeXinfo too which I do edit occasionally, this makes sense for me personally also.

Okay, I now actually checked with a file as you provided it (shame on me
for not doing so before) and yes, it falls back to Plain TeX mode
because there is no string which is recognized by AUCTeX identifying the
file as being a LaTeX file.

Perhaps, getting down to the supposed "bug" here, it would be possible to make \subsection be such a string. After all, if \section is such a string, presumably there's an argument for \subsection being derived from it and inheriting many of its properties/connotations/whatever. (Of course the same would apply to other section headers too.)

You have two options dealing with the problem:

1) Set `TeX-force-default-mode' to t.

   This will disable the automatic file type recognition and always use
   the mode specified in `TeX-default-mode'.  However, I don't recommend
   this because it will disable a useful feature and is usually not
   necessary because there is option 2.

2) Set the variables `TeX-auto-save', `TeX-parse-self' and `TeX-master'
   as described on the first page of the AUCTeX manual.

   Especially the `TeX-master' setting will lead to AUCTeX prompting you
   for a master file each time you start a new file and then insert a
   "Local variables" stanza into the file like this:

%%% Local Variables: %%% mode: latex
   %%% TeX-master: t
%%% End:

Ah, I remember these guys from some past life.  Now I know what they do!

   You can see that in the stanza the mode is specified and this is
   usually the default mode, namely LaTeX mode.  Each time you open the
   file this mode will be activated regardless of what the automatic
   detection would propose.

   For your existing files you can force the insertion of the stanza by
   typing `C-c _'.  You will have to replace `plain-tex' with `latex'
   and then type `C-c C-n' to reinitialize the mode.

   Note that this feature is mainly about the master file.  (The mode
   setting is secondary.)  The master file is the LaTeX should be run on
   in order to typeset the document if it is spread across different
   files.  Since you mentioned you actually _are_ dealing with documents
   spread across several files this is likely useful for you.

Thanks for your help,
Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]