Function: LaTeX-common-initialization

LaTeX-common-initialization is a byte-compiled function defined in latex.el.

Signature

(LaTeX-common-initialization)

Documentation

Common initialization for LaTeX derived modes.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/latex.el
(defun LaTeX-common-initialization ()
  "Common initialization for LaTeX derived modes."
  (setq-local indent-line-function #'LaTeX-indent-line)

  ;; Filling
  (setq-local paragraph-ignore-fill-prefix t)
  (setq-local fill-paragraph-function #'LaTeX-fill-paragraph)
  (setq-local adaptive-fill-mode nil)
  ;; Cater for \verb|...| (and similar) contructs which should not be
  ;; broken.
  (add-to-list (make-local-variable 'fill-nobreak-predicate)
               #'LaTeX-verbatim-p t)

  (or LaTeX-largest-level
      (setq LaTeX-largest-level (LaTeX-section-level "section")))

  (setq TeX-header-end LaTeX-header-end
        TeX-trailer-start LaTeX-trailer-start)
  (setq-local TeX-style-hook-dialect TeX-dialect)

  (require 'outline)
  (setq-local outline-level #'LaTeX-outline-level)
  (setq-local outline-regexp (LaTeX-outline-regexp t))
  (when (boundp 'outline-heading-alist)
    (setq outline-heading-alist
          (mapcar (lambda (x)
                    (cons (concat "\\" (nth 0 x)) (nth 1 x)))
                  LaTeX-section-list)))

  (setq-local TeX-auto-full-regexp-list
              (delete-dups (append LaTeX-auto-regexp-list
                                   ;; Prevent inadvertent destruction
                                   ;; of `plain-TeX-auto-regexp-list'.
                                   (copy-sequence
                                    plain-TeX-auto-regexp-list))))

  ;; Moved after `run-mode-hooks'. (bug#65750)
  ;; (LaTeX-set-paragraph-start)
  (setq paragraph-separate
        (concat
         "[ \t]*%*[ \t]*\\("
         "\\$\\$"                       ; Plain TeX display math
         "\\|$\\)"))

  (setq TeX-verbatim-p-function #'LaTeX-verbatim-p)
  (setq TeX-search-forward-comment-start-function
        #'LaTeX-search-forward-comment-start)
  (setq-local TeX-search-files-type-alist LaTeX-search-files-type-alist)

  (setq-local beginning-of-defun-function #'LaTeX-find-matching-begin)
  (setq-local end-of-defun-function       #'LaTeX-find-matching-end)

  ;; Moved after `run-mode-hooks'. (bug#65750)
  ;; (LaTeX-indent-commands-regexp-make)

  ;; Standard Emacs completion-at-point support.  We prepend the entry
  ;; in order to let `TeX--completion-at-point' be next in the list.
  ;; See discussion in this thread:
  ;; https://lists.gnu.org/archive/html/auctex-devel/2025-10/msg00013.html
  (add-hook 'completion-at-point-functions
            #'LaTeX--arguments-completion-at-point nil t)

  (setq-local LaTeX-item-list '(("description" . LaTeX-item-argument)
                                ("thebibliography" . LaTeX-item-bib)
                                ("array" . LaTeX-item-array)
                                ("tabular" . LaTeX-item-array)
                                ("tabular*" . LaTeX-item-tabular*)))

  (LaTeX-add-environments
   '("document" LaTeX-env-document)
   '("enumerate" LaTeX-env-item)
   '("itemize" LaTeX-env-item)
   '("list" LaTeX-env-list)
   '("trivlist" LaTeX-env-item)
   '("picture" LaTeX-env-picture)
   '("tabular" LaTeX-env-array)
   '("tabular*" LaTeX-env-tabular*)
   '("array" LaTeX-env-array)
   '("eqnarray" LaTeX-env-label)
   '("equation" LaTeX-env-label)
   '("minipage" LaTeX-env-minipage)

   ;; The following have no special support, but are included in
   ;; case the auto files are missing.

   "sloppypar" "tabbing" "verbatim" "verbatim*"
   "flushright" "flushleft" "displaymath" "math" "quote" "quotation"
   "center" "titlepage" "verse" "eqnarray*"

   ;; The following are not defined in latex.el, but in a number of
   ;; other style files.  I'm to lazy to copy them to all the
   ;; corresponding .el files right now.

   ;; This means that AUCTeX will complete e.g.
   ;; ``thebibliography'' in a letter, but I guess we can live with
   ;; that.

   '("description" LaTeX-env-item)
   '("figure" LaTeX-env-figure)
   '("figure*" LaTeX-env-figure)
   '("table" LaTeX-env-figure)
   '("table*" LaTeX-env-figure)
   '("thebibliography" LaTeX-env-bib)
   '("theindex" LaTeX-env-item))

  ;; `latex.ltx' defines `plain' and `empty' pagestyles
  (LaTeX-add-pagestyles "plain" "empty")

  ;; `latex.ltx' defines the following counters
  (LaTeX-add-counters "page" "equation" "enumi" "enumii" "enumiii"
                      "enumiv" "footnote" "mpfootnote")

  (LaTeX-add-lengths "arraycolsep" "arrayrulewidth" "baselineskip" "baselinestretch"
                     "bibindent" "columnsep" "columnseprule" "columnwidth"
                     "dblfloatsep" "dbltextfloatsep" "doublerulesep" "evensidemargin"
                     "fboxrule" "fboxsep" "floatsep" "footnotesep"
                     "headheight" "headsep"
                     "intextsep" "linewidth"
                     "marginparpush" "marginparsep" "marginparwidth"
                     "oddsidemargin" "paperwidth" "paperheight" "parindent" "parskip"
                     "stockheight" "stockwidth"
                     "tabcolsep" "textfloatsep" "textheight" "textwidth" "topmargin"
                     "unitlength")

  (TeX-add-symbols
   '("addtocounter" TeX-arg-counter "Value")
   '("alph" TeX-arg-counter)
   '("arabic" TeX-arg-counter)
   '("fnsymbol" TeX-arg-counter)
   '("newcounter" TeX-arg-define-counter
     [ TeX-arg-counter "Within counter" ])
   '("roman" TeX-arg-counter)
   '("setcounter" TeX-arg-counter "Value")
   '("usecounter" TeX-arg-counter)
   '("value" TeX-arg-counter)
   '("stepcounter" TeX-arg-counter)
   '("refstepcounter" TeX-arg-counter)
   '("label" TeX-arg-define-label)
   '("pageref" TeX-arg-ref)
   '("ref" TeX-arg-ref)
   ;; \Ref and \labelformat are part of kernel with LaTeX 2019-10-01:
   '("Ref" TeX-arg-ref)
   '("labelformat" TeX-arg-counter t)
   ;; \footref is part of kernel with LaTeX 2021-06-01:
   '("footref" TeX-arg-ref)
   '("newcommand" TeX-arg-define-macro [ TeX-arg-define-macro-arguments ] t)
   '("renewcommand" TeX-arg-macro [ TeX-arg-define-macro-arguments ] t)
   '("newenvironment" TeX-arg-define-environment
     [ TeX-arg-define-macro-arguments ] 2)
   '("renewenvironment" TeX-arg-environment
     [ TeX-arg-define-macro-arguments ] 2)
   '("providecommand" TeX-arg-define-macro [ TeX-arg-define-macro-arguments ] t)
   '("providecommand*" TeX-arg-define-macro [ TeX-arg-define-macro-arguments ] t)
   '("newcommand*" TeX-arg-define-macro [ TeX-arg-define-macro-arguments ] t)
   '("renewcommand*" TeX-arg-macro [ TeX-arg-define-macro-arguments ] t)
   '("newenvironment*" TeX-arg-define-environment
     [ TeX-arg-define-macro-arguments ] 2)
   '("renewenvironment*" TeX-arg-environment
     [ TeX-arg-define-macro-arguments ] 2)
   ;; \newtheorem comes in 3 flavors:
   ;; \newtheorem{name}{title} or
   ;; \newtheorem{name}[numbered_like]{title} or
   ;; \newtheorem{name}{title}[numbered_within]
   ;; Both optional args are not allowed
   '("newtheorem" TeX-arg-define-environment
     [ TeX-arg-environment "Numbered like" ]
     "Title"
     (TeX-arg-conditional (save-excursion
                            (skip-chars-backward (concat "^" TeX-grcl))
                            (backward-list)
                            (= (preceding-char) ?\]))
         ()
       ([TeX-arg-counter "Within counter"])))
   '("newfont" TeX-arg-define-macro t)
   '("circle" "Diameter")
   '("circle*" "Diameter")
   '("dashbox" "Dash Length" TeX-arg-size
     [ TeX-arg-corner ] t)
   '("frame" t)
   '("framebox" (TeX-arg-conditional
                    (string-equal (LaTeX-current-environment) "picture")
                    (TeX-arg-size [ TeX-arg-corner ] t)
                  ([ "Length" ] [ TeX-arg-lr ] t)))
   '("line" (TeX-arg-pair "X slope" "Y slope") "Length")
   '("linethickness" "Dimension")
   '("makebox" (TeX-arg-conditional
                   (string-equal (LaTeX-current-environment) "picture")
                   (TeX-arg-size [ TeX-arg-corner ] t)
                 ([ "Length" ] [ TeX-arg-lr ] t)))
   '("multiput"
     TeX-arg-coordinate
     (TeX-arg-pair "X delta" "Y delta")
     "Number of copies"
     t)
   '("oval" TeX-arg-size [ TeX-arg-corner "Portion" ])
   '("put" TeX-arg-coordinate t)
   '("savebox" TeX-arg-savebox
     (TeX-arg-conditional
         (string-equal (LaTeX-current-environment) "picture")
         (TeX-arg-size [ TeX-arg-corner ] t)
       ([ "Length" ] [ TeX-arg-lr ] t)))
   '("shortstack" [ TeX-arg-lr ] t)
   '("vector" (TeX-arg-pair "X slope" "Y slope") "Length")
   '("cline" "Span `i-j'")
   '("multicolumn" "Columns" "Format" t)
   '("item"
     (TeX-arg-conditional (or TeX-arg-item-label-p
                              (string-equal (LaTeX-current-environment)
                                            "description"))
         ([ "Item label" ])
       ())
     (TeX-arg-literal " "))
   '("bibitem" [ "Bibitem label" ] TeX-arg-define-cite)
   '("cite"
     (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) ())
     TeX-arg-cite)
   '("nocite" TeX-arg-cite)
   '("bibliographystyle" TeX-arg-bibstyle)
   '("bibliography" TeX-arg-bibliography)
   '("newblock" (TeX-arg-literal " "))
   '("footnote"
     (TeX-arg-conditional TeX-arg-footnote-number-p ([ "Number" ]) nil)
     t)
   '("footnotetext"
     (TeX-arg-conditional TeX-arg-footnote-number-p ([ "Number" ]) nil)
     t)
   '("footnotemark"
     (TeX-arg-conditional TeX-arg-footnote-number-p ([ "Number" ]) nil))
   '("newlength" (TeX-arg-define-length "Length macro"))
   '("setlength" (TeX-arg-length "Length macro" nil "\\")
     (TeX-arg-length "Length value"))
   '("addtolength" (TeX-arg-length "Length macro" nil "\\")
     (TeX-arg-length "Length to add"))
   '("settowidth" (TeX-arg-length "Length macro" nil "\\") "Text")
   '("settoheight" (TeX-arg-length "Length macro" nil "\\") "Text")
   '("settodepth" (TeX-arg-length "Length macro" nil "\\") "Text")
   '("\\" [ "Space" ])
   '("\\*" [ "Space" ])
   '("hyphenation" t)
   '("linebreak" [ "How much [0 - 4]" ])
   '("nolinebreak" [ "How much [0 - 4]" ])
   '("nopagebreak" [ "How much [0 - 4]" ])
   '("pagebreak" [ "How much [0 - 4]" ])
   '("stackrel" t nil)
   '("frac" t nil)
   '("lefteqn" t)
   '("overbrace" t)
   '("overline" t)
   '("overleftarrow" t)
   '("overrightarrow" t)
   '("sqrt" [ "Root" ] t)
   '("underbrace" t)
   '("underline" t)
   '("acute" t) '("grave" t) '("ddot" t) '("tilde" t) '("bar" t)
   '("breve" t) '("check" t) '("hat" t) '("vec" t) '("dot" t)
   '("widetilde" t) '("widehat" t)
   '("author" LaTeX-arg-author)
   '("date" TeX-arg-date)
   '("thanks" t)
   '("title" t)
   '("pagenumbering" (TeX-arg-completing-read
                      ("arabic" "roman" "Roman" "alph" "Alph")
                      "Numbering style"))
   '("pagestyle" TeX-arg-pagestyle)
   '("markboth" t nil)
   '("markright" t)
   '("thispagestyle" TeX-arg-pagestyle)
   '("addvspace" TeX-arg-length)
   '("fbox" t)
   '("hspace*" TeX-arg-length)
   '("hspace" TeX-arg-length)
   '("mbox" t)
   '("newsavebox" TeX-arg-define-savebox)
   '("parbox"
     [TeX-arg-tb nil center]
     [TeX-arg-length "Height"]
     [TeX-arg-tb "Inner position" stretch]
     (TeX-arg-length "Width")
     t)
   '("raisebox" "Raise" [ "Height above" ] [ "Depth below" ] t)
   '("rule" [ "Raise" ] "Width" "Thickness")
   '("sbox" TeX-arg-savebox t)
   '("usebox" TeX-arg-savebox)
   '("vspace*" TeX-arg-length)
   '("vspace" TeX-arg-length)
   '("documentstyle" TeX-arg-document)
   '("include" (TeX-arg-input-file "File" t))
   '("includeonly" t)
   '("input" TeX-arg-input-file)
   '("addcontentsline"
     (TeX-arg-completing-read ("toc" "lof" "lot") "File")
     (TeX-arg-completing-read LaTeX-section-list "Numbering style") t)
   '("addtocontents"
     (TeX-arg-completing-read ("toc" "lof" "lot") "File") t)
   '("typeout" t)
   '("typein" [ TeX-arg-define-macro ] t)
   '("verb" TeX-arg-verb)
   '("verb*" TeX-arg-verb)
   '("extracolsep" t)
   '("index" TeX-arg-index)
   '("glossary" TeX-arg-index)
   '("numberline" "Section number" "Heading")
   '("caption" t)
   '("marginpar" [ "Left margin text" ] "Text")
   '("left" TeX-arg-insert-braces)
   ;; The following 4 macros are not specific to amsmath.
   '("bigl" TeX-arg-insert-braces)
   '("Bigl" TeX-arg-insert-braces)
   '("biggl" TeX-arg-insert-braces)
   '("Biggl" TeX-arg-insert-braces)

   '("langle" TeX-arg-insert-right-brace-maybe)
   '("lceil" TeX-arg-insert-right-brace-maybe)
   '("lfloor" TeX-arg-insert-right-brace-maybe)

   ;; These have no special support, but are included in case the
   ;; auto files are missing.

   "TeX" "LaTeX"
   "samepage" "newline"
   "smallskip" "medskip" "bigskip" "fill" "stretch"
   "thinspace" "negthinspace" "enspace" "enskip" "quad" "qquad"
   "nonumber" "centering" "raggedright"
   "raggedleft" "kill" "pushtabs" "poptabs" "protect" "arraystretch"
   "hline" "vline" "cline" "thinlines" "thicklines" "and" "makeindex"
   "makeglossary" "reversemarginpar" "normalmarginpar"
   "raggedbottom" "flushbottom" "sloppy" "fussy" "newpage"
   "clearpage" "cleardoublepage" "twocolumn" "onecolumn"

   "maketitle" "tableofcontents" "listoffigures" "listoftables"
   '("tiny" -1) '("scriptsize" -1) '("footnotesize" -1) '("small" -1)
   '("normalsize" -1) '("large" -1) '("Large" -1) '("LARGE" -1) '("huge" -1)
   '("Huge" -1)
   '("oldstylenums" "Numbers")
   ;; The next macro is provided by LaTeX2e 2020-02-02 release:
   '("legacyoldstylenums" "Numbers")
   "pounds" "copyright"
   "hfil" "hfill" "vfil" "vfill" "hrulefill" "dotfill"
   "indent" "noindent" "today"
   "appendix"
   "dots"
   "makeatletter" "makeatother" "jobname")

  (when (string-equal LaTeX-version "2e")
    (LaTeX-add-environments
     '("filecontents" LaTeX-env-args
       [TeX-arg-completing-read-multiple
        ("overwrite" "force" "nosearch" "nowarn" "noheader")]
       "File")
     '("filecontents*" LaTeX-env-args
       [TeX-arg-completing-read-multiple
        ("overwrite" "force" "nosearch" "nowarn")]
       "File"))

    (TeX-add-symbols
     '("enlargethispage"  (TeX-arg-length nil "1.0\\baselineskip"))
     '("enlargethispage*" (TeX-arg-length nil "1.0\\baselineskip"))
     '("tabularnewline" [ TeX-arg-length ])
     '("suppressfloats" [ TeX-arg-tb "Suppress floats position" ])
     '("ensuremath" "Math commands")
     '("textsuperscript" "Text")
     '("textsubscript" "Text")
     '("textcircled" "Text")
     '("mathring" t)
     '("chaptermark" "Text")
     '("sectionmark" "Text")
     '("subsectionmark" "Text")
     '("subsubsectionmark" "Text")
     '("paragraphmark" "Text")
     '("subparagraphmark" "Text")

     "LaTeXe"
     "frontmatter" "mainmatter" "backmatter"
     "leftmark" "rightmark"
     "textcompwordmark" "textvisiblespace" "textemdash" "textendash"
     "textexclamdown" "textquestiondown" "textquotedblleft"
     "textquotedblright" "textquoteleft" "textquoteright"
     "textbackslash" "textbar" "textless" "textgreater"
     "textasciicircum" "textasciitilde"

     ;; With the advent of LaTeX2e release 2020-02-02, all symbols
     ;; provided by textcomp.sty are available out of the box by the
     ;; kernel.  The next block is moved here from textcomp.el:
     "capitalgrave"                 ; Type: Accent -- Slot: 0
     "capitalacute"                 ; Type: Accent -- Slot: 1
     "capitalcircumflex"            ; Type: Accent -- Slot: 2
     "capitaltilde"                 ; Type: Accent -- Slot: 3
     "capitaldieresis"              ; Type: Accent -- Slot: 4
     "capitalhungarumlaut"          ; Type: Accent -- Slot: 5
     "capitalring"                  ; Type: Accent -- Slot: 6
     "capitalcaron"                 ; Type: Accent -- Slot: 7
     "capitalbreve"                 ; Type: Accent -- Slot: 8
     "capitalmacron"                ; Type: Accent -- Slot: 9
     "capitaldotaccent"             ; Type: Accent -- Slot: 10
     "textquotestraightbase"        ; Type: Symbol -- Slot: 13
     "textquotestraightdblbase"     ; Type: Symbol -- Slot: 18
     "texttwelveudash"              ; Type: Symbol -- Slot: 21
     "textthreequartersemdash"      ; Type: Symbol -- Slot: 22
     "textcapitalcompwordmark"      ; Type: Symbol -- Slot: 23
     "textleftarrow"                ; Type: Symbol -- Slot: 24
     "textrightarrow"               ; Type: Symbol -- Slot: 25
     "t"                            ; Type: Accent -- Slot: 26
     "capitaltie"                   ; Type: Accent -- Slot: 27
     "newtie"                       ; Type: Accent -- Slot: 28
     "capitalnewtie"                ; Type: Accent -- Slot: 29
     "textascendercompwordmark"     ; Type: Symbol -- Slot: 31
     "textblank"                    ; Type: Symbol -- Slot: 32
     "textdollar"                   ; Type: Symbol -- Slot: 36
     "textquotesingle"              ; Type: Symbol -- Slot: 39
     "textasteriskcentered"         ; Type: Symbol -- Slot: 42
     "textdblhyphen"                ; Type: Symbol -- Slot: 45
     "textfractionsolidus"          ; Type: Symbol -- Slot: 47
     "textzerooldstyle"             ; Type: Symbol -- Slot: 48
     "textoneoldstyle"              ; Type: Symbol -- Slot: 49
     "texttwooldstyle"              ; Type: Symbol -- Slot: 50
     "textthreeoldstyle"            ; Type: Symbol -- Slot: 51
     "textfouroldstyle"             ; Type: Symbol -- Slot: 52
     "textfiveoldstyle"             ; Type: Symbol -- Slot: 53
     "textsixoldstyle"              ; Type: Symbol -- Slot: 54
     "textsevenoldstyle"            ; Type: Symbol -- Slot: 55
     "texteightoldstyle"            ; Type: Symbol -- Slot: 56
     "textnineoldstyle"             ; Type: Symbol -- Slot: 57
     "textlangle"                   ; Type: Symbol -- Slot: 60
     "textminus"                    ; Type: Symbol -- Slot: 61
     "textrangle"                   ; Type: Symbol -- Slot: 62
     "textmho"                      ; Type: Symbol -- Slot: 77
     "textbigcircle"                ; Type: Symbol -- Slot: 79
     "textohm"                      ; Type: Symbol -- Slot: 87
     "textlbrackdbl"                ; Type: Symbol -- Slot: 91
     "textrbrackdbl"                ; Type: Symbol -- Slot: 93
     "textuparrow"                  ; Type: Symbol -- Slot: 94
     "textdownarrow"                ; Type: Symbol -- Slot: 95
     "textasciigrave"               ; Type: Symbol -- Slot: 96
     "textborn"                     ; Type: Symbol -- Slot: 98
     "textdivorced"                 ; Type: Symbol -- Slot: 99
     "textdied"                     ; Type: Symbol -- Slot: 100
     "textleaf"                     ; Type: Symbol -- Slot: 108
     "textmarried"                  ; Type: Symbol -- Slot: 109
     "textmusicalnote"              ; Type: Symbol -- Slot: 110
     "texttildelow"                 ; Type: Symbol -- Slot: 126
     "textdblhyphenchar"            ; Type: Symbol -- Slot: 127
     "textasciibreve"               ; Type: Symbol -- Slot: 128
     "textasciicaron"               ; Type: Symbol -- Slot: 129
     "textacutedbl"                 ; Type: Symbol -- Slot: 130
     "textgravedbl"                 ; Type: Symbol -- Slot: 131
     "textdagger"                   ; Type: Symbol -- Slot: 132
     "textdaggerdbl"                ; Type: Symbol -- Slot: 133
     "textbardbl"                   ; Type: Symbol -- Slot: 134
     "textperthousand"              ; Type: Symbol -- Slot: 135
     "textbullet"                   ; Type: Symbol -- Slot: 136
     "textcelsius"                  ; Type: Symbol -- Slot: 137
     "textdollaroldstyle"           ; Type: Symbol -- Slot: 138
     "textcentoldstyle"             ; Type: Symbol -- Slot: 139
     "textflorin"                   ; Type: Symbol -- Slot: 140
     "textcolonmonetary"            ; Type: Symbol -- Slot: 141
     "textwon"                      ; Type: Symbol -- Slot: 142
     "textnaira"                    ; Type: Symbol -- Slot: 143
     "textguarani"                  ; Type: Symbol -- Slot: 144
     "textpeso"                     ; Type: Symbol -- Slot: 145
     "textlira"                     ; Type: Symbol -- Slot: 146
     "textrecipe"                   ; Type: Symbol -- Slot: 147
     "textinterrobang"              ; Type: Symbol -- Slot: 148
     "textinterrobangdown"          ; Type: Symbol -- Slot: 149
     "textdong"                     ; Type: Symbol -- Slot: 150
     "texttrademark"                ; Type: Symbol -- Slot: 151
     "textpertenthousand"           ; Type: Symbol -- Slot: 152
     "textpilcrow"                  ; Type: Symbol -- Slot: 153
     "textbaht"                     ; Type: Symbol -- Slot: 154
     "textnumero"                   ; Type: Symbol -- Slot: 155
     "textdiscount"                 ; Type: Symbol -- Slot: 156
     "textestimated"                ; Type: Symbol -- Slot: 157
     "textopenbullet"               ; Type: Symbol -- Slot: 158
     "textservicemark"              ; Type: Symbol -- Slot: 159
     "textlquill"                   ; Type: Symbol -- Slot: 160
     "textrquill"                   ; Type: Symbol -- Slot: 161
     "textcent"                     ; Type: Symbol -- Slot: 162
     "textsterling"                 ; Type: Symbol -- Slot: 163
     "textcurrency"                 ; Type: Symbol -- Slot: 164
     "textyen"                      ; Type: Symbol -- Slot: 165
     "textbrokenbar"                ; Type: Symbol -- Slot: 166
     "textsection"                  ; Type: Symbol -- Slot: 167
     "textasciidieresis"            ; Type: Symbol -- Slot: 168
     "textcopyright"                ; Type: Symbol -- Slot: 169
     "textordfeminine"              ; Type: Symbol -- Slot: 170
     "textcopyleft"                 ; Type: Symbol -- Slot: 171
     "textlnot"                     ; Type: Symbol -- Slot: 172
     "textcircledP"                 ; Type: Symbol -- Slot: 173
     "textregistered"               ; Type: Symbol -- Slot: 174
     "textasciimacron"              ; Type: Symbol -- Slot: 175
     "textdegree"                   ; Type: Symbol -- Slot: 176
     "textpm"                       ; Type: Symbol -- Slot: 177
     "texttwosuperior"              ; Type: Symbol -- Slot: 178
     "textthreesuperior"            ; Type: Symbol -- Slot: 179
     "textasciiacute"               ; Type: Symbol -- Slot: 180
     "textmu"                       ; Type: Symbol -- Slot: 181
     "textparagraph"                ; Type: Symbol -- Slot: 182
     "textperiodcentered"           ; Type: Symbol -- Slot: 183
     "textreferencemark"            ; Type: Symbol -- Slot: 184
     "textonesuperior"              ; Type: Symbol -- Slot: 185
     "textordmasculine"             ; Type: Symbol -- Slot: 186
     "textsurd"                     ; Type: Symbol -- Slot: 187
     "textonequarter"               ; Type: Symbol -- Slot: 188
     "textonehalf"                  ; Type: Symbol -- Slot: 189
     "textthreequarters"            ; Type: Symbol -- Slot: 190
     "texteuro"                     ; Type: Symbol -- Slot: 191
     "texttimes"                    ; Type: Symbol -- Slot: 214
     "textdiv"                      ; Type: Symbol -- Slot: 246
     '("capitalcedilla"       1)    ; Type: Command -- Slot: N/A
     '("capitalogonek"        1)    ; Type: Command -- Slot: N/A

     "rmfamily" "sffamily" "ttfamily"
     '("mdseries" -1) '("bfseries" -1)
     '("itshape"  -1) '("slshape"  -1)
     '("upshape"  -1) '("scshape"  -1)
     '("eminnershape" -1)
     ;; The next 3 were added to LaTeX kernel with 2020-02-02 release:
     '("sscshape" -1) '("swshape"  -1) '("ulcshape" -1)
     ;; These are for the default settings:
     "encodingdefault" "familydefault" "seriesdefault" "shapedefault"
     "rmdefault" "sfdefault" "ttdefault"
     "bfdefault" "mddefault"
     "itdefault" "sldefault" "scdefault" "updefault"
     "sscdefault" "swdefault" "ulcdefault"
     ;; This macro is for `spaced small caps'.  Currently, only some
     ;; commercial fonts offer this.  It should be moved into
     ;; `LaTeX-font-list' once it is needed more frequently.
     '("textssc" t)
     ;; User level reset macros:
     '("normalfont" -1) '("normalshape" -1)

     ;; Low level commands for selecting a font:
     '("fontencoding" "Encoding")
     '("fontfamily" "Family")
     '("fontseries" "Series")
     '("fontseriesforce" "Series")
     '("fontshape" "Shape")
     '("fontshapeforce" "Shape")
     '("fontsize" "Size" "Baselineskip")
     "selectfont"
     '("usefont" "Encoding" "Family" "Series" "Shape")
     '("linespread" "Factor")

     ;; This one only be used outside math mode:
     '("mathversion" (TeX-arg-completing-read ("normal" "bold") "Version"))

     ;; Macros for document-command parser, aka xparse added to LaTeX
     ;; kernel with 2020-10-01 release and documented in usrguide.pdf
     '("NewDocumentCommand"
       TeX-arg-define-macro "Argument specification" t)
     '("RenewDocumentCommand"
       TeX-arg-macro "Argument specification" t)
     '("ProvideDocumentCommand"
       TeX-arg-define-macro "Argument specification" t)
     '("DeclareDocumentCommand"
       TeX-arg-define-macro "Argument specification" t)

     ;; Declaring environments
     '("NewDocumentEnvironment" TeX-arg-define-environment
       "Argument specification" t t)
     '("RenewDocumentEnvironment" TeX-arg-environment
       "Argument specification" t t)
     '("ProvideDocumentEnvironment" TeX-arg-define-environment
       "Argument specification" t t)
     '("DeclareDocumentEnvironment" TeX-arg-define-environment
       "Argument specification" t t)

     ;; Fully-expandable document commands
     '("DeclareExpandableDocumentCommand"
       TeX-arg-define-macro "Argument specification" t)
     '("NewExpandableDocumentCommand"
       TeX-arg-define-macro "Argument specification" t)
     '("RenewExpandableDocumentCommand"
       TeX-arg-macro "Argument specification" t)
     '("ProvideExpandableDocumentCommand"
       TeX-arg-define-macro "Argument specification" t)

     ;; Testing special values
     '("IfNoValueTF" 3)
     '("IfNoValueT" 2)
     '("IfNoValueF" 2)
     '("IfValueTF" 3)
     '("IfValueT" 2)
     '("IfValueF" 2)
     '("IfBlankTF" 3)
     '("IfBlankT" 2)
     '("IfBlankF" 2)
     "BooleanTrue"
     "BooleanFalse"
     '("IfBooleanTF" 3)
     '("IfBooleanT" 2)
     '("IfBooleanF" 2)

     ;; Argument processors
     '("SplitArgument" "Number" "Token")
     '("SplitList" "Token")
     '("ProcessList" "List" "Function")
     "ReverseBoolean"
     "TrimSpaces"
     "ProcessedArgument"

     ;; Copying and showing (robust) commands and environments
     '("NewCommandCopy" TeX-arg-define-macro TeX-arg-macro)
     '("RenewCommandCopy" TeX-arg-define-macro TeX-arg-macro)
     '("DeclareCommandCopy" TeX-arg-define-macro TeX-arg-macro)
     '("ShowCommand"        TeX-arg-macro)

     '("NewEnvironmentCopy" TeX-arg-define-environment TeX-arg-environment)
     '("RenewEnvironmentCopy" TeX-arg-define-environment TeX-arg-environment)
     '("DeclareEnvironmentCopy" TeX-arg-define-environment TeX-arg-environment)
     '("ShowEnvironment" TeX-arg-environment)

     ;; Preconstructing command names (or otherwise expanding arguments)
     '("UseName" "String")
     ;; Only offer the predictable part
     '("ExpandArgs"
       (TeX-arg-completing-read ("c" "cc" "Nc") "Spec"))

     ;; Expandable floating point (and other) calculations
     '("fpeval" t)
     '("inteval" t)
     '("dimeval" t)
     '("skipeval" t)

     ;; Case changing
     '("MakeUppercase" [TeX-arg-key-val (("lang") ("locale"))] t)
     '("MakeLowercase" [TeX-arg-key-val (("lang") ("locale"))] t)
     '("MakeTitlecase" [TeX-arg-key-val (("lang") ("locale")
                                         ("words" ("first" "all")))]
       t)
     '("DeclareLowercaseExclusions" t)
     '("DeclareTitlecaseExclusions" t)
     '("DeclareUppercaseExclusions" t)
     '("DeclareLowercaseMapping" ["Locale"] "Codepoint" "Output")
     '("DeclareTitlecaseMapping" ["Locale"] "Codepoint" "Output")
     '("DeclareUppercaseMapping" ["Locale"] "Codepoint" "Output")

     ;; Support for problem solving
     '("listfiles"
       [TeX-arg-completing-read-multiple ("hashes" "sizes")])

     ;; LaTeX hook macros:
     '("AddToHook"      TeX-arg-hook [ "Label" ] t)
     '("RemoveFromHook" TeX-arg-hook [ "Label" ])
     '("AddToHookNext"  TeX-arg-hook t)

     ;; Added in LaTeX 2021-11-15
     '("counterwithin"
       [TeX-arg-completing-read ("\\arabic" "\\roman" "\\Roman"
                                 "\\alph" "\\Alph")
                                "Format"]
       (TeX-arg-counter)
       (TeX-arg-counter "Within counter"))
     '("counterwithin*"
       [TeX-arg-completing-read ("\\arabic" "\\roman" "\\Roman"
                                 "\\alph" "\\Alph")
                                "Format"]
       (TeX-arg-counter)
       (TeX-arg-counter "Within counter"))

     '("counterwithout"
       [TeX-arg-completing-read ("\\arabic" "\\roman" "\\Roman"
                                 "\\alph" "\\Alph")
                                "Format"]
       (TeX-arg-counter)
       (TeX-arg-counter "Within counter"))
     '("counterwithout*"
       [TeX-arg-completing-read ("\\arabic" "\\roman" "\\Roman"
                                 "\\alph" "\\Alph")
                                "Format"]
       (TeX-arg-counter)
       (TeX-arg-counter "Within counter"))

     ;; Added in LaTeX 2022-06-01
     '("NewMarkClass" "Class")
     '("InsertMark" "Class" t)
     '("TopMark"
       [TeX-arg-completing-read ("page"         "previous-page"
                                 "column"       "previous-column"
                                 "first-column" "last-column")
                                "Region"]
       (TeX-arg-completing-read ("2e-left" "2e-right" "2e-right-nonempty")
                                "Class"))
     '("FirstMark"
       [TeX-arg-completing-read ("page"         "previous-page"
                                 "column"       "previous-column"
                                 "first-column" "last-column")
                                "Region"]
       (TeX-arg-completing-read ("2e-left" "2e-right" "2e-right-nonempty")
                                "Class"))
     '("LastMark"
       [TeX-arg-completing-read ("page"         "previous-page"
                                 "column"       "previous-column"
                                 "first-column" "last-column")
                                "Region"]
       (TeX-arg-completing-read ("2e-left" "2e-right" "2e-right-nonempty")
                                "Class"))
     '("IfMarksEqualTF"
       [TeX-arg-completing-read ("page"         "previous-page"
                                 "column"       "previous-column"
                                 "first-column" "last-column")
                                "Region"]
       (TeX-arg-completing-read ("2e-left" "2e-right" "2e-right-nonempty")
                                "Class")
       (TeX-arg-completing-read ("top" "first" "last")
                                "Position 1")
       (TeX-arg-completing-read ("top" "first" "last")
                                "Position 2")
       2)

     '("DocumentMetadata"
       (TeX-arg-key-val (("backend")
                         ("pdfversion")
                         ("uncompress")
                         ("lang")
                         ("pdfstandard" ("A-1b" "A-2a" "A-2b" "A-2u" "A-3a"
                                         "A-3b" "A-3u" "A-4" "A-4E" "A-4F"
                                         "X-4" "X-4p" "X-5g" "X-5n" "X-5pg"
                                         "X-6" "X-6n" "X-6p" "UA-1" "UA-2"))
                         ("xmp" ("true" "false"))
                         ("colorprofiles")
                         ;; Skip the individual modules:
                         ("testphase" ("phase-I" "phase-II" "phase-III"))
                         ("debug" ("para" "log" "uncompress" "pdfmanagement"
                                   "firstaidoff" "xmp-export" "tagpdf"))))) ))

  (TeX-run-style-hooks "LATEX")

  (make-local-variable 'TeX-font-list)
  (make-local-variable 'TeX-font-replace-function)
  (if (string-equal LaTeX-version "2")
      ()
    (setq TeX-font-list LaTeX-font-list)
    (setq TeX-font-replace-function #'TeX-font-replace-macro)
    (TeX-add-symbols
     '("usepackage" LaTeX-arg-usepackage)
     '("RequirePackage" LaTeX-arg-usepackage)
     '("ProvidesPackage" (TeX-arg-file-name-sans-extension "Package name")
       [ TeX-arg-conditional (y-or-n-p "Insert version? ")
           ([ TeX-arg-version ]) nil])
     '("ProvidesClass" (TeX-arg-file-name-sans-extension "Class name")
       [ TeX-arg-conditional (y-or-n-p "Insert version? ")
           ([ TeX-arg-version ]) nil])
     '("ProvidesFile" (TeX-arg-file-name "File name")
       [ TeX-arg-conditional (y-or-n-p "Insert version? ")
           ([ TeX-arg-version ]) nil ])
     '("documentclass" TeX-arg-document)))

  (TeX-add-style-hook "latex2e"
                      ;; Use new fonts for `\documentclass' documents.
                      (lambda ()
                        (setq TeX-font-list LaTeX-font-list)
                        (setq TeX-font-replace-function #'TeX-font-replace-macro)
                        (run-hooks 'LaTeX2e-hook))
                      TeX-dialect)

  (TeX-add-style-hook "latex2"
                      ;; Use old fonts for `\documentstyle' documents.
                      (lambda ()
                        (setq TeX-font-list (default-value 'TeX-font-list))
                        (setq TeX-font-replace-function
                              (default-value 'TeX-font-replace-function))
                        (run-hooks 'LaTeX2-hook))
                      TeX-dialect)

  ;; There must be something better-suited, but I don't understand the
  ;; parsing properly.  -- dak
  (TeX-add-style-hook "pdftex" #'TeX-PDF-mode-on :classopt)
  (TeX-add-style-hook "pdftricks" #'TeX-PDF-mode-on :classopt)
  (TeX-add-style-hook "pst-pdf" #'TeX-PDF-mode-on :classopt)
  (TeX-add-style-hook "dvips"
                      (lambda ()
                        ;; Leave at user's choice whether to disable
                        ;; `TeX-PDF-mode' or not.
                        (setq TeX-PDF-from-DVI "Dvips"))
                      :classopt)
  ;; This is now done in style/pstricks.el because it prevents other
  ;; pstricks style files from being loaded.
  ;;   (TeX-add-style-hook "pstricks" 'TeX-PDF-mode-off)
  (TeX-add-style-hook "psfrag" #'TeX-PDF-mode-off :classopt)
  (TeX-add-style-hook "dvipdf" #'TeX-PDF-mode-off :classopt)
  (TeX-add-style-hook "dvipdfm" #'TeX-PDF-mode-off :classopt)
  (TeX-add-style-hook "dvipdfmx"
                      (lambda ()
                        (TeX-PDF-mode-on)
                        ;; XeLaTeX normally don't use dvipdfmx
                        ;; explicitly.
                        (unless (eq TeX-engine 'xetex)
                          (setq TeX-PDF-from-DVI "Dvipdfmx")))
                      :classopt)
  ;;  (TeX-add-style-hook "DVIoutput" 'TeX-PDF-mode-off)
  ;;
  ;;  Well, DVIoutput indicates that we want to run PDFTeX and expect to
  ;;  get DVI output.  Ugh.
  (TeX-add-style-hook "ifpdf" (lambda ()
                                (TeX-PDF-mode-on)
                                (TeX-PDF-mode-off))
                      :classopt)
  ;; ifpdf indicates that we cater for either.  So calling both
  ;; functions will make sure that the default will get used unless the
  ;; user overrode it.

  (setq-local imenu-create-index-function
              #'LaTeX-imenu-create-index-function)

  ;; Initialization of `add-log-current-defun-function':
  (setq-local add-log-current-defun-function #'TeX-current-defun-name)

  ;; Set LaTeX-specific help messages for error so that it's available
  ;; in `TeX-help-error'.
  (setq-local TeX-error-description-list-local
              LaTeX-error-description-list))