C-c C-s
produces a dialog hook which says Level: (default section)
. The manual says that the code for subsection is supposed to be 3
. But if one types 3 RET
, after completing the remaining dialogs hooks for the section name and label, one gets
\3{title}
\label{label}
which obviously is not the expected or desired behavior.
Question: Is there a way to fix this behavior so that it behaves more like I expected?
Writing out the entire word subsection
would seem to nullify the entire point of AucTeX macros. Do people commonly need to modify AucTeX's defaults substantially, like is done here? Any suggestions for how to change this, get use to this, or try a different solution for inserting sections, subsections, etc. into a document altogether would be appreciated.
EDIT: The manual says further that:
User Option: LaTeX-section-hook
List of hooks to run when a new section is inserted.
The following variables are set before the hooks are run
level
Numeric section level, default set by prefix arg to LaTeX-section.
name
Name of the sectioning command, derived from level.
To me it seems like when the hook/dialog/prompt (I am new to emacs and do not know the correct terminology) asks for the Level
which should be a numeric, and from which AucTeX should deduce Name
, instead it is asking for Name
. Is this correct, and perhaps my settings are interfering with AucTeX somehow? (I am using the version of AucTeX coming with an AquaMacs installation, which is presumably heavily pre-configured.)
EDIT: The manual online contradicts the information given about the LaTeX-section hooks inside of emacs, specifically that says that:
LaTeX-section-heading
Hook to prompt for LaTeX section name. Hide
Insert this hook into ‘LaTeX-section-hook’ to allow the user to change
the name of the sectioning command inserted with ‘M-x LaTeX-section’.
In other words, this hook is intentionally designed to only allow the user to specify the name, not the level. This in direct contrast to the online AucTeX documentation which falsely claims that this hook allows one to change the name and the level.
Again, this does not make sense to me -- the level uniquely determines the name, does it not? So why allow the user to specify an incorrect section command, like \notasection{}
, which also takes longer to type than the level number anyway, and additionally not allow the level of the section to specified? It makes no sense to me.
It also says that
The following variables are set before the hooks are run: level, name, ...
i.e. that it sets the value of the level before any of the hooks are run. And none of the hooks allow one to change the value of the level.
The documentation says something about the level being a prefix argument. As far as I can tell, this means that it can only be changed in an emacs lisp configuration file, but can not be changed in real time when using emacs, which does not make sense to me. This is based off of the emacs documentation for "Prefix Command Arguments" here, which I don't actually understand. So I guess this question comes down to how to specify a prefix command argument in real time while using emacs.
LaTeX-section
, but I get the same as you. So ask the developers, gnu.org/software/auctex/mailing-lists.html – daleif Feb 27 '18 at 14:06C-c C-s subsec TAB
, easier to remember – daleif Feb 27 '18 at 14:27