Auctex comes with a folding mode that already folds most of the uninteresting things. However, acronym macros are not folded. How can I instruct Auctex to fold acronym macros (e.g., \ac, \acp, \acf, etc.)?



% Acronyms
  \acro{IDS}{Intrusion Detection Systems}
  \acro{ML}{Machine Learning}


\title{Just another Auctex document}

\section{Section 1}
This section uses acronyms. For example, \ac{IDS} or \ac{ML}.


If I enable folding mode (TeX-fold-mode), how could I instruct Auctex to also fold the macros \ac{}?

1 Answer 1


I have discovered the variable "TeX-fold-macro-spec-list". This variable contains a list of macros that are folded by "TeX-fold-mode". To fold the acronym macros (e.g.: \ac{}, \acp{}, \acf{}, \acpf{}), I have placed the following lines in my init.el file:

;; Set custom folds for Acronyms
(add-to-list 'TeX-fold-macro-spec-list '("{1}" ("ac" "acf")))
(add-to-list 'TeX-fold-macro-spec-list '("{1}s" ("acp" "acpf")))

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.