Entries in LaTeX-indent-environment-list
control the filling behavior in environments. If you want the standard filling AUCTeX applies to environments, remove entries for your appendices
from it and M-q should work again.
The appendices
environment is provided by LaTeX package appendix.sty
. In order to get auto-completion for it when you hit C-c C-e, you need a small AUCTeX style appendix.el
which makes the addition to AUCTeX. Such a style can look like this:
(TeX-add-style-hook
"appendix"
(lambda ()
(TeX-add-symbols
"appendixpage"
"addappheadtotoc"
"noappendicestocpagenum"
"appendicestocpagenum"
"appendixname"
"appendixtocname"
"appendixpagename"
"appendixtocon"
"appendixtocoff"
"appendixpageon"
"appendixpageoff"
"appendixtitleon"
"appendixtitleoff"
"appendixtitletocon"
"appendixtitletocoff"
"appendixheaderon"
"appendixheaderoff"
"restoreapp"
"setthesection"
"setthesubsection")
(LaTeX-add-environments
'("appendices")
'("subappendices"))
;; Don't indent the content inside \(sub\)?appendices environments:
(unless (string-match "appendices" LaTeX-document-regexp)
(set (make-local-variable 'LaTeX-document-regexp)
(concat LaTeX-document-regexp "\\|\\(?:sub\\)?appendices"))))
LaTeX-dialect)
(defvar LaTeX-appendix-package-options '("toc" "page" "title"
"titletoc" "header")
"Package options for the appendix package.")
Set the variable TeX-style-private
to a directory of your choice, e.g.
(setq TeX-style-private
'("~/.emacs.d/auctex-styles"))
and save the code above there as appendix.el
. Now re-start Emacs and open your .tex file. If you have this in your init file as well
(setq TeX-parse-self t)
the auto-completion should be available directly.
LaTeX-indent-environment-list
in that buffer?. You can check it withC-h v LaTeX-indent-environment-list RET
. Do you see an entry forappendices
?