2

If I try to create a LaTeX file named notes.tex, AUCTeX automatically adds the style "notes" and runs the style hook for "notes". This creates a bunch of environments in LaTeX-environment-list that conflict with my custom environments. Is there a way to prevent AUCTeX from automatically applying this style?

Alternatively, is there a way to remove a style hook?

7
  • Does this happen for all LaTeX files, or just when you use the name notes.tex?
    – Tyler
    Commented Nov 22, 2023 at 15:41
  • It's when I use the name notes.tex. More generally, it seems to be when I use files whose name matches something in /var/lib/auctex/emacs/ For example, there's a file in there named postnotes.elc, and if I make a file named postnotes.tex, then AUCTeX gives is the style "postnotes"
    – Janet
    Commented Nov 22, 2023 at 16:38
  • When you create/open your .tex file, what's the value of TeX-auto-save in that buffer? Commented Nov 23, 2023 at 14:57
  • TeX-auto-save is nil
    – Janet
    Commented Nov 23, 2023 at 15:13
  • That's puzzling. I wonder how that notes.el was generated. AUCTeX itself doesn't contain a notes.el, as you can see here. Maybe you've generated that last time you created another notes.tex? In that case, you can probably remove that .el file. Commented Nov 23, 2023 at 18:51

1 Answer 1

1

This is part of AucTeX's customization features. It's explained in the manual. I don't understand all the details, but it appears to include applying styles for files when the filename (in your case notes.tex) matches an AucTeX style file (i.e., notes.elc).

There doesn't appear to be a way to turn it off. However, you can customize the variable TeX-style-path, removing the directory containing the style files you don't want to use.

Someone else may be able to provide more complete help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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