branch: main commit 84e959333b1790043283520aa34404d3bf86f156 Merge: 3091f2ca 922545e8 Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@gnu.org>
Merge remote-tracking branch 'origin/master' --- NEWS.org | 7 +- doc/changes.texi | 35 +- doc/install.texi | 16 +- font-latex.el | 6 +- latex.el | 66 ++- style/acro.el | 905 ++++++++++++++++++++++++++++++++--------- style/authblk.el | 73 ++++ style/booktabs.el | 18 +- style/listings.el | 43 +- style/longtable.el | 21 +- style/ninecolors.el | 96 +++++ style/simpleicons.el | 81 +--- style/tabularray.el | 474 +++++++++++++++++++++ tests/latex/font-latex-test.el | 17 +- tex-site.el.in | 56 ++- 15 files changed, 1552 insertions(+), 362 deletions(-) diff --git a/NEWS.org b/NEWS.org index d8ce5658..673c7c93 100644 --- a/NEWS.org +++ b/NEWS.org @@ -8,6 +8,11 @@ * [Unreleased] +** Added + +- Add new support files =style/authblk.el=, =style/ninecolors.el= and + =style/tabularray.el=. + * [14.0.6] - 2024-06-30 ** Added @@ -32,7 +37,7 @@ (~TeX-insert-backslash~). If you need one literal =$=, you can type =C-1 $= or =C-q $=. - We no longer have explicit support of the special behavior that if - ~TeX-electric-math~ is non-nil and point is inside math mode right + ~TeX-electric-math~ is non-~nil~ and point is inside math mode right between a couple of single dollars, pressing =$= will insert another pair of dollar signs and leave the point between them. diff --git a/doc/changes.texi b/doc/changes.texi index 75cdabe9..496aa799 100644 --- a/doc/changes.texi +++ b/doc/changes.texi @@ -230,11 +230,10 @@ other symbols, in particular @kbd{"} (@code{TeX-insert-quote}) and @kbd{\} (@code{TeX-insert-backslash}). If you need one literal @samp{$}, you can type @kbd{C-1 $} or @kbd{C-q $}. @item -We no longer have explicit support of the special behavior that -if @code{TeX-electric-math} is non-nil and point is inside math -mode right between a couple of single dollars, pressing @kbd{$} -will insert another pair of dollar signs and leave the point -between them. +We no longer have explicit support of the special behavior that if +@code{TeX-electric-math} is non-@code{nil} and point is inside math mode +right between a couple of single dollars, pressing @kbd{$} will insert +another pair of dollar signs and leave the point between them. It still works as before if @code{TeX-electric-math} is pair of dollars while it inserts @samp{\(} and @samp{\)} when @code{TeX-electric-math} is @@ -732,7 +731,7 @@ documented in info files nor turned into a customize option with @item The window system focus is pulled back to Emacs when viewing with evince-compatible viewers if a new customize option -@code{TeX-view-evince-keep-focus} is non-nil. +@code{TeX-view-evince-keep-focus} is non-@code{nil}. @item The usual dose of bug fixes was administered. @@ -1036,12 +1035,12 @@ only new expansion strings. @item Before running commands like @TeX{} and @LaTeX{}, now @AUCTeX{} performs -some checks. If @code{TeX-check-TeX} is non-nil, it will test whether a -working @TeX{} distribution is actually present in the system and -available to Emacs. Instead, when @code{TeX-check-engine} is non-nil, -before running @LaTeX{} commands @AUCTeX{} will check whether the -correct engine has been set, based upon known restrictions posed by -@LaTeX{} packages. +some checks. If @code{TeX-check-TeX} is non-@code{nil}, it will test +whether a working @TeX{} distribution is actually present in the system +and available to Emacs. Instead, when @code{TeX-check-engine} is +non-@code{nil}, before running @LaTeX{} commands @AUCTeX{} will check +whether the correct engine has been set, based upon known restrictions +posed by @LaTeX{} packages. @item Basic support to @ConTeXt{} Mark IV has been added. Users can now @@ -1063,9 +1062,9 @@ Numbers of bugs have been fixed, many minor features have been added. @code{TeX-PDF-mode} is now enabled by default. @item -Now @code{TeX-previous-error} works with @TeX{} commands if the new -option @code{TeX-parse-all-errors} is non-nil, which is the default. -When this option is non-nil, an overview of errors and warnings reported +Now @code{TeX-previous-error} works with @TeX{} commands if the new option +@code{TeX-parse-all-errors} is non-@code{nil}, which is the default. When +this option is non-@code{nil}, an overview of errors and warnings reported by the @TeX{} compiler can be opened with @kbd{M-x TeX-error-overview @key{RET}}. @ifclear rawfile @@ -1097,8 +1096,8 @@ Now you can insert @samp{$...$} or @samp{\(...\)} by typing a single @item @kbd{C-c @key{RET} documentclass @key{RET}} completes with all available @LaTeX{} classes, if the @code{TeX-arg-input-file-search} variable is -non-nil. Completion for class options of the standard @LaTeX{} classes -is provided as well. +non-@code{nil}. Completion for class options of the standard @LaTeX{} +classes is provided as well. @item New user options @code{LaTeX-default-author}, @@ -1420,7 +1419,7 @@ deprecated. @item @AUCTeX{} now can automatically insert a pair of braces after typing @key{_} or @key{^} in math constructs if the new variable -@code{TeX-electric-sub-and-superscript} is set to a non-nil value. +@code{TeX-electric-sub-and-superscript} is set to a non-@code{nil} value. @item Some language-specific support for French was added. There now is diff --git a/doc/install.texi b/doc/install.texi index c2499e63..74f5566d 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -371,13 +371,15 @@ list. Type to manipulate the contents of @code{TeX-modes}. @end defopt -Don't remove @code{tex-mode} from @code{TeX-modes} because it results in -inconsistent behavior. - -On Emacs 29 and later, you can alter @code{major-mode-remap-alist} instead -of @code{TeX-modes} as you like to arrange @AUCTeX{} redirections. In -fact, @code{TeX-modes} option does nothing other than setting up -@code{major-mode-remap-alist} according its value on those Emacsens. +Don't remove @code{tex-mode} from @code{TeX-modes} unless you set +@code{TeX-modes} empty to disable @AUCTeX{} completely, otherwise it +results in inconsistent behavior. + +On Emacs 29 and later, @AUCTeX{} uses either +@code{major-mode-remap-defaults} or @code{major-mode-remap-alist} for +redirection. But we recommend not to customize them directly because the +customization code for @code{TeX-modes} takes care of some other +compatibility issues. If you want to remove a preinstalled @AUCTeX{} completely before any of its modes have been used, diff --git a/font-latex.el b/font-latex.el index ec99d54c..70186748 100644 --- a/font-latex.el +++ b/font-latex.el @@ -241,9 +241,9 @@ variable `font-latex-fontify-sectioning'." ',num) "makeatletter" "makeatother" "newblock" "suppressfloats" "endinput") font-latex-warning-face 1 noarg) ("variable" - (("setlength" "|{\\{") ("settowidth" "|{\\{") ("settoheight" "{{") - ("settodepth" "{{") ("setcounter" "{|{\\") - ("addtolength" "|{\\{") ("addtocounter" "{|{\\") + (("setlength" "|{\\|{\\") ("addtolength" "|{\\|{\\") + ("settowidth" "|{\\|{\\") ("settoheight" "|{\\|{\\") ("settodepth" "|{\\|{\\") + ("setcounter" "{|{\\") ("addtocounter" "{|{\\") ("stepcounter" "{") ("refstepcounter" "{") ("counterwithin" "*[{{") ("counterwithout" "*[{{") ("arabic" "{") ("roman" "{") ("Roman" "{") ("alph" "{") ("Alph" "{") diff --git a/latex.el b/latex.el index b9014668..7f709a82 100644 --- a/latex.el +++ b/latex.el @@ -2399,11 +2399,11 @@ initial input for the label." (defvar reftex-ref-macro-prompt) (defun TeX-arg-ref (optional &optional prompt definition) - "Let-bind `reftex-ref-macro-prompt' to nil and pass arguments -to `TeX-arg-label'. + "Let-bind `reftex-ref-macro-prompt' to nil and call `TeX-arg-label'. -See the documentation of `TeX-arg-label' for details on the -arguments: OPTIONAL, PROMPT, and DEFINITION." +All arguments are passed to `TeX-arg-label'. See the documentation of +`TeX-arg-label' for details on the arguments: OPTIONAL, PROMPT, and +DEFINITION." (let ((reftex-ref-macro-prompt nil)) (TeX-arg-label optional prompt definition))) @@ -4115,15 +4115,15 @@ consideration just as is in the non-commented source code." :type 'regexp) (defcustom LaTeX-indent-environment-list - '(("verbatim" current-indentation) - ("verbatim*" current-indentation) - ("filecontents" current-indentation) + '(("verbatim" current-indentation) + ("verbatim*" current-indentation) + ("filecontents" current-indentation) ("filecontents*" current-indentation) - ("tabular" LaTeX-indent-tabular) - ("tabular*" LaTeX-indent-tabular) - ("array" LaTeX-indent-tabular) - ("eqnarray" LaTeX-indent-tabular) - ("eqnarray*" LaTeX-indent-tabular) + ("tabular" LaTeX-indent-tabular) + ("tabular*" LaTeX-indent-tabular) + ("array" LaTeX-indent-tabular) + ("eqnarray" LaTeX-indent-tabular) + ("eqnarray*" LaTeX-indent-tabular) ;; envs of amsmath.sty ("align" LaTeX-indent-tabular) ("align*" LaTeX-indent-tabular) @@ -4168,6 +4168,15 @@ consideration just as is in the non-commented source code." ("drcases" LaTeX-indent-tabular) ("drcases*" LaTeX-indent-tabular) ("cases*" LaTeX-indent-tabular) + ;; envs of tabularray.sty + ("+array" LaTeX-indent-tabular) + ("+matrix" LaTeX-indent-tabular) + ("+bmatrix" LaTeX-indent-tabular) + ("+Bmatrix" LaTeX-indent-tabular) + ("+pmatrix" LaTeX-indent-tabular) + ("+vmatrix" LaTeX-indent-tabular) + ("+Vmatrix" LaTeX-indent-tabular) + ("+cases" LaTeX-indent-tabular) ;; The following should have their own, smart indentation function. ;; Some other day. ("displaymath") @@ -9412,6 +9421,39 @@ wrapped in \\(?:...\\)? then." ;; We are done. Just search until the next closing bracket "[^]]*\\]")) +(defun LaTeX-keyval-caption-reftex-context-function (env) + "Extract and return a key=val caption context string for RefTeX in ENV. +ENV is the name of current environment passed to this function by +RefTeX. The context string is the value given to the caption key. If +no caption key is found, an error is issued. See also the docstring of +`reftex-label-alist' and its description for CONTEXT-METHOD." + (let* ((envstart (save-excursion + (re-search-backward (concat "\\\\begin{" env "}") + nil t))) + (capt-key (save-excursion + (re-search-backward "\\<caption[ \t\n\r%]*=[ \t\n\r%]*" + envstart t))) + capt-start capt-end) + (if capt-key + (save-excursion + (goto-char (match-end 0)) + (cond ((looking-at-p (regexp-quote (concat TeX-grop LaTeX-optop))) + ;; Short caption inside [] is available, extract it only + (forward-char) + (setq capt-start (1+ (point))) + (setq capt-end (1- (progn (forward-sexp) (point))))) + ;; Extract the entire caption which is enclosed in braces + ((looking-at-p TeX-grop) + (setq capt-start (1+ (point))) + (setq capt-end (1- (progn (forward-sexp) (point))))) + ;; Extract everything to next comma , + (t + (setq capt-start (point)) + (setq capt-end (progn (skip-chars-forward "^,") (point))))) + ;; Return the extracted string + (buffer-substring-no-properties capt-start capt-end)) + (error "No caption found")))) + (defvar LaTeX-font-family '("normalfont" "rmfamily" "sffamily" "ttfamily") "List of LaTeX font family declarations.") diff --git a/style/acro.el b/style/acro.el index 26e32b8d..f558db11 100644 --- a/style/acro.el +++ b/style/acro.el @@ -1,6 +1,6 @@ -;;; acro.el --- AUCTeX style for `acro.sty' version 1.2a. -*- lexical-binding: t; -*- +;;; acro.el --- AUCTeX style for `acro.sty' version v3.8 -*- lexical-binding: t; -*- -;; Copyright (C) 2013-2015, 2018, 2020 Free Software Foundation, Inc. +;; Copyright (C) 2013-2024 Free Software Foundation, Inc. ;; Maintainer: auctex-devel@gnu.org ;; Author: Mosè Giordano <giordano.m...@libero.it> @@ -25,7 +25,7 @@ ;;; Commentary: -;; This file adds support for `acro.sty' version 1.2a. +;; This file adds support for `acro.sty' version v3.8. ;;; Code: @@ -37,51 +37,203 @@ "font-latex" (keywords class)) -(defvar LaTeX-acro-package-options-list - '(;; General Options - ("version" ("0" "1")) +(defvar LaTeX-acro-acsetup-key-val-options + '(("case-sensitive" ("true" "false")) + ("case-insensitive" ("true" "false")) + ;; 6.1. Basic properties + ("use-id-as-short" ("true" "false")) + ;; 9. The first or full appearance + ("first-style" ("long-short" "short-long" "short" "long" "footnote")) + ("subsequent-style" ("long-short" "short-long" "short" "long" "footnote")) + ;; 10. Single appearances of an acronym ("single" ("true" "false")) - ("hyperref" ("true" "false")) - ("record-pages" ("true" "false")) - ("only-used" ("true" "false")) - ("mark-as-used" ("first" "any")) - ("macros" ("true" "false")) - ("xspace" ("true" "false")) - ("strict" ("true" "false")) - ("sort" ("true" "false")) - ("cite" ("all" "first" "none")) - ("cite-cmd") - ("cite-space") + ("single-style" ("long-short" "short-long" "short" "long" "footnote")) + ;; 11.1. The main command and its options + ("list/template" ("description" "tabular" "longtable" + "supertabular" "tabularray")) + ("list/display" ("all" "used")) + ("list/include") + ("list/exclude") + ("list/add" ("true" "false")) + ("list/heading" ("none" "section" "section*" "chapter" "chapter*")) + ("list/name") + ("list/preamble") + ("list/locale/display" ("true" "false")) + ;; 11.2. Add page numbers to the list + ("pages/display" ("first" "all" "none")) + ("pages/seq/use" ("true" "false")) + ("pages/seq/pre") + ("pages/seq/threshold") + ("pages/fill") + ("pages/name" ("true" "false")) + ;; 11.3. Filter lists using tags + ("list/exclude") + ("list/include") + ;; 11.4. Local lists + ("barriers/use" ("true" "false")) + ("list/local" ("true" "false")) + ;; 12. Formatting + ("format") + ("format/short") + ("format/long") + ("format/first-long") + ("format/alt") + ("format/extra") + ("format/foreign") + ("format/list") + ("format/replace" ("true" "false")) + ("short-plural-ending") + ("long-plural-ending") + ;; 15. Foreign language acronyms + ("foreign/display" ("true" "false")) + ("list/foreign/display" ("true" "false")) + ("locale/display" ("true" "false")) + ("list/locale/display" ("true" "false")) + ("locale/format") + ;; 16. Uppercasing + ("uppercase/first") + ("uppercase/title") + ("uppercase/all") + ("uppercase/none") + ("uppercase/cmd") + ("uppercase/short" ("true" "false")) + ;; 17.1. Citing + ("cite/cmd") + ("cite/group" ("true" "false")) + ("cite/display" ("first" "all" "none")) + ("cite/pre") + ("cite/group/cmd") + ("cite/group/pre") + ;; 17.2. Indexing + ("index/use" ("true" "false" "indexed")) + ("index/cmd") + ("index/disable") + ("index/clear") + ;; 18. Barriers + ("barriers/use" ("true" "false")) + ("barriers/reset" ("true" "false")) + ("barriers/single" ("true" "false")) + ;; 19. Trailing tokens + ("trailing/define") + ("trailing/activate") + ("trailing/deactivate") + ;; 21.1. Backlinks + ("make-links" ("true" "false")) + ("link-only-first" ("true" "false")) + ;; 21.3. pdf comments + ("pdfcomments/use" ("true" "false")) + ("pdfcomments/cmd") + ;; 21.4. Accessibility support + ("accsupp/use" ("true" "false")) + ("accsupp/options") + ("accsupp/method") + ;; 22. Localisation + ("language" ("auto")) + ;; 23. Patches + ("patch/floats" ("true" "false")) + ("patch/lists" ("true" "false")) + ("patch/tabularx" ("true" "false")) + ("patch/longtable" ("true" "false")) + ("patch/ltxtable" ("true" "false")) + ("patch/tabu" ("true" "false")) + ("patch/caption" ("true" "false")) + ("patch/maketitle" ("true" "false"))) + "AList of key=vals for the \\acsetup macro from the acro package.") + +(defvar LaTeX-acro-declareacronym-key-val-options + '(("case-sensitive" ("true" "false")) + ("case-insensitive" ("true" "false")) + ;; 6.1. Basic properties + ("short") + ("use-id-as-short" ("true" "false")) + ("long") + ("alt") + ("extra") + ("foreign") + ("long-post") + ("post") + ("single") + ("sort") + ("tag") + ("cite") + ("before-citation") + ("index") + ("index-sort") ("index-cmd") - ("accsupp" ("true" "false")) - ("uc-cmd") - ;; Options Regarding Acronyms + ;; 6.2. Properties related to plural and indefinite forms + ("short-plural") + ("short-plural-form") + ("long-plural") + ("long-plural-form") + ("alt-plural") + ("alt-plural-form") + ("foreign-plural") + ("foreign-plural-form") + ("short-indefinite") + ("long-indefinite") + ("alt-indefinite") + ;; 6.3. Properties related to formatting + ("format") ("short-format") ("long-format") ("first-long-format") - ("list-short-format") - ("list-long-format") + ("alt-format") ("extra-format") - ("first-style" ("default" "plain" "empty" "square" "short" "reversed" - "plain-reversed" "footnote" "sidenote")) - ("extra-style" ("default" "plain" "comma" "paren" "bracket")) - ("plural-ending") - ;; Options Regarding the List - ("page-ref" ("none" "plain" "comma" "paren")) - ("page-name") - ("pages-name") - ("page-ranges" ("true" "false")) - ("next-page") - ("next-pages") - ("list-type" ("table" "itemize" "description")) - ("list-style" ("list" "tabular" "longtable" "extra-tabular" "extra-longtable" - "extra-tabular-rev" "extra-longtable-rev")) - ("list-header" ("chapter" "chapter*" "section" "section*" "subsection" - "subsection*" "addchap" "addsec")) - ("list-name") - ("list-table-width") - ("list-caps" ("true" "false"))) - "Package options for the acro package.") + ("foreign-format") + ("list-format") + ("first-style" ("long-short" "short-long" "short" "long" "footnote")) + ("subsequent-style" ("long-short" "short-long" "short" "long" "footnote")) + ("single-style" ("long-short" "short-long" "short" "long" "footnote")) + ;; 6.4. Properties related to the created pdf file + ("pdfstring") + ("pdfcomment") + ("short-acc") + ("long-acc") + ("alt-acc") + ("foreign-acc") + ("extra-acc") + ("single-acc") + ("list-acc") + ;; 6.5. Further properties + ("list") + ("foreign-babel") + ("foreign-locale") + ("preset") + ("uselist")) + "AList of key=vals for the \\DeclareAcronym macro from the acro package. +These are used for the second mandatory argument.") + +(defvar LaTeX-acro-printacronyms-key-val-options + '(;; 11.1. The main command and its options + ("template" ("description" "tabular" "longtable" "supertabular" "tabularray")) + ("sort" ("true" "false")) + ("display" ("all" "used")) + ("include") + ("exclude") + ("add" ("true" "false")) + ("heading" ("none" "section" "section*" "chapter" "chapter*")) + ("name") + ("preamble") + ("display" ("true" "false")) + ;; 11.2. Add page numbers to the list + ("pages") + ;; 11.4. Local lists + ("barriers") + ("local" ("true" "false"))) + "AList of key=vals for the \\printacronyms macro from the acro package. +These are used in its optional argument.") + +(defvar LaTeX-acro-ac-key-val-options + '(("case-sensitive" ("true" "false")) + ("case-insensitive" ("true" "false")) + ("use-id-as-short" ("true" "false")) + ;; 9. The first or full appearance + ("first-style" ("long-short" "short-long" "short" "long" "footnote")) + ("subsequent-style" ("long-short" "short-long" "short" "long" "footnote")) + ;; 10. Single appearances of an acronym + ("single" ("true" "false")) + ("single-style" ("long-short" "short-long" "short" "long" "footnote"))) + "AList of key=vals for the various \\acX macros from the acro package.") (TeX-auto-add-type "acro-acronym" "LaTeX") @@ -98,15 +250,10 @@ (setq LaTeX-auto-acro-acronym nil)) (defun LaTeX-acro-cleanup () - "Move acronyms from `LaTeX-auto-acro-acronym' to -`LaTeX-acro-list' and to `TeX-auto-symbol' if option `macros' is -set to `true'." + "Move acronyms from `LaTeX-auto-acro-acronym' to `LaTeX-acro-acronym-list'." (mapc (lambda (acronym) (add-to-list 'LaTeX-acro-acronym-list (list acronym))) - LaTeX-auto-acro-acronym) - (when (or (LaTeX-provided-package-options-member "acro" "macros") - (LaTeX-provided-package-options-member "acro" "macros=true")) - (add-to-list 'TeX-auto-symbol LaTeX-auto-acro-acronym))) + LaTeX-auto-acro-acronym)) (add-hook 'TeX-auto-prepare-hook #'LaTeX-acro-prepare t) (add-hook 'TeX-auto-cleanup-hook #'LaTeX-acro-cleanup t) @@ -124,7 +271,7 @@ list of defined acronyms." (let ((acronym (completing-read (TeX-argument-prompt optional prompt "Acronym") (LaTeX-acro-acronym-list) nil nil nil 'LaTeX-acro-acronym-history))) - (if (and definition (not (string-equal "" acronym))) + (if (and definition (not (string-empty-p acronym))) (LaTeX-add-acro-acronyms acronym)) (TeX-argument-insert acronym optional optional))) @@ -135,163 +282,553 @@ argument, otherwise as a mandatory one. Use PROMPT as the prompt string." (LaTeX-arg-acro-acronym optional prompt t)) -(defvar LaTeX-acro-declareacronym-keys - '(("short") ("long") ("short-plural") ("long-plural") ("long-plural-form") - ("short-indefinite") ("long-indefinite") ("long-pre") ("long-post") ("alt") - ("alt-indefinite") ("extra") ("sort") ("class") ("cite") ("short-format") - ("long-format") ("first-long-format") ("pdfstring") ("accsupp") - ("index-sort") ("index") ("index-cmd")) - "List of keys accepted by `\\DeclareAcronym' macro of `acro' package -in its second mandatory argument.") - -(defvar LaTeX-acro-printacronyms-keys - '(("include-classes") ("exclude-classes") ("name") ("header")) - "List of keys accepted by `\\printacronyms' macro of `acro' package -in its optional argument.") - -(defun LaTeX-arg-acro-key-val (optional prompt key-val-alist) - "Prompt for keys and values in KEY-VAL-ALIST. -<SPC> key binding in minibuffer is removed temporarily. Insert -the given value as a TeX macro argument. - -See `TeX-read-key-val' for explanation of OPTIONAL, PROMPT and -KEY-VAL-ALIST." - ;; Remove <SPC> key binding from map used in `multi-prompt-key-value' (called - ;; by `TeX-arg-key-val') with `require-match' set to `nil'. - (let ((crm-local-completion-map - (remove (assoc 32 crm-local-completion-map) crm-local-completion-map))) - (TeX-arg-key-val optional key-val-alist prompt))) - (TeX-add-style-hook "acro" (lambda () (TeX-auto-add-regexp `(,LaTeX-acro-regexp 1 LaTeX-auto-acro-acronym)) + (TeX-add-symbols - ;; Creating New Acronyms + + ;; 5.2. Setup command + '("acsetup" + (TeX-arg-key-val LaTeX-acro-acsetup-key-val-options)) + + ;; 6. Declaring acronyms and other abbreviations '("DeclareAcronym" LaTeX-arg-define-acro-acronym - (LaTeX-arg-acro-key-val "Definition of acronym (k=v)" - LaTeX-acro-declareacronym-keys)) - ;; Using the Acronyms - '("ac" LaTeX-arg-acro-acronym) - '("ac*" LaTeX-arg-acro-acronym) - '("Ac" LaTeX-arg-acro-acronym) - '("Ac*" LaTeX-arg-acro-acronym) - '("acs" LaTeX-arg-acro-acronym) - '("acs*" LaTeX-arg-acro-acronym) - '("acl" LaTeX-arg-acro-acronym) - '("acl*" LaTeX-arg-acro-acronym) - '("Acl" LaTeX-arg-acro-acronym) - '("Acl*" LaTeX-arg-acro-acronym) - '("aca" LaTeX-arg-acro-acronym) - '("aca*" LaTeX-arg-acro-acronym) - '("acf" LaTeX-arg-acro-acronym) - '("acf*" LaTeX-arg-acro-acronym) - '("Acf" LaTeX-arg-acro-acronym) - '("Acf*" LaTeX-arg-acro-acronym) - '("acp" LaTeX-arg-acro-acronym) - '("acp*" LaTeX-arg-acro-acronym) - '("Acp" LaTeX-arg-acro-acronym) - '("Acp*" LaTeX-arg-acro-acronym) - '("acsp" LaTeX-arg-acro-acronym) - '("acsp*" LaTeX-arg-acro-acronym) - '("aclp" LaTeX-arg-acro-acronym) - '("aclp*" LaTeX-arg-acro-acronym) - '("Aclp" LaTeX-arg-acro-acronym) - '("Aclp*" LaTeX-arg-acro-acronym) - '("acap" LaTeX-arg-acro-acronym) - '("acap*" LaTeX-arg-acro-acronym) - '("acfp" LaTeX-arg-acro-acronym) - '("acfp*" LaTeX-arg-acro-acronym) - '("Acfp" LaTeX-arg-acro-acronym) - '("Acfp*" LaTeX-arg-acro-acronym) - ;; Indefinite Forms - '("iac" LaTeX-arg-acro-acronym) - '("iac*" LaTeX-arg-acro-acronym) - '("Iac" LaTeX-arg-acro-acronym) - '("Iac*" LaTeX-arg-acro-acronym) - '("iacs" LaTeX-arg-acro-acronym) - '("iacs*" LaTeX-arg-acro-acronym) - '("Iacs" LaTeX-arg-acro-acronym) - '("Iacs*" LaTeX-arg-acro-acronym) - '("iaca" LaTeX-arg-acro-acronym) - '("iaca*" LaTeX-arg-acro-acronym) - '("Iaca" LaTeX-arg-acro-acronym) - '("Iaca*" LaTeX-arg-acro-acronym) - '("iacl" LaTeX-arg-acro-acronym) - '("iacl*" LaTeX-arg-acro-acronym) - '("Iacl" LaTeX-arg-acro-acronym) - '("Iacl*" LaTeX-arg-acro-acronym) - '("iacf" LaTeX-arg-acro-acronym) - '("iacf*" LaTeX-arg-acro-acronym) - '("Iacf" LaTeX-arg-acro-acronym) - '("Iacf*" LaTeX-arg-acro-acronym) - '("iacflike" LaTeX-arg-acro-acronym) - '("iacflike*" LaTeX-arg-acro-acronym) - '("Iacflike" LaTeX-arg-acro-acronym) - '("Iacflike*" LaTeX-arg-acro-acronym) + (TeX-arg-key-val LaTeX-acro-declareacronym-key-val-options + "List of properties" + nil ?\s)) + + ;; 6.6. Presets + '("NewAcroPreset" "Set name" t) + '("RenewAcroPreset" "Set name" t) + '("DeclareAcroPreset" "Set name" t) + + ;; 7. Using acronyms + '("ac" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("ac*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Ac" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Ac*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acp" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acp*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acp" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acp*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("iac" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("iac*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iac" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iac*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + + ;; + '("acs" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acs*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acs" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acs*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acsp" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acsp*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acsp" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acsp*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("iacs" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("iacs*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iacs" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iacs*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + ;; + '("acl" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acl*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acl" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acl*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("aclp" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("aclp*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Aclp" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Aclp*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("iacl" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("iacl*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iacl" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iacl*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + ;; + '("aca" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("aca*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Aca" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Aca*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acap" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acap*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acap" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acap*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("iaca" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("iaca*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iaca" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iaca*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + ;; + '("acf" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acf*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acf" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acf*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acfp" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acfp*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acfp" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Acfp*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("iacf" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("iacf*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iacf" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iacf*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + ;; + '("iacflike" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("iacflike*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iacflike" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("Iacflike*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) ;; Simulating the First Appearance - '("acflike" LaTeX-arg-acro-acronym) - '("acflike*" LaTeX-arg-acro-acronym) - '("acfplike" LaTeX-arg-acro-acronym) - '("acfplike*" LaTeX-arg-acro-acronym) - ;; Reset or Mark as Used + '("acflike" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acflike*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acfplike" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acfplike*" + [TeX-arg-key-val LaTeX-acro-ac-key-val-options] + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + + ;; FIXME: PDF bookmarks macros seems to be gone in v3.8; we leave + ;; these macros here in case they are still used with older + ;; versions: + '("acpdfstring" + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + '("acpdfstringplural" + (TeX-arg-completing-read (LaTeX-acro-acronym-list) + "Acronym" + nil nil nil nil nil nil nil + LaTeX-acro-acronym-history)) + + ;; 11. Printing the List + '("printacronyms" + [TeX-arg-key-val LaTeX-acro-printacronyms-key-val-options + nil nil ?\s]) + + ;; 20. Using or resetting acronyms '("acreset" "List of acronyms") '("acresetall" 0) '("acuse" "List of acronyms") '("acuseall" 0) - ;; PDF bookmarks - '("acpdfstring" LaTeX-arg-acro-acronym) - '("acpdfstringplural" LaTeX-arg-acro-acronym) - ;; Printing the List - '("printacronyms" [LaTeX-arg-acro-key-val nil LaTeX-acro-printacronyms-keys]) - ;; Customization - '("acsetup" (TeX-arg-key-val LaTeX-acro-package-options-list))) + + ;; 23. Patches + '("acswitchoff" 0) + '("acswitchon" 0) + + ;; 25.2. Defining new templates + '("NewAcroTemplate" ["Type"] "Name" t) + '("RenewAcroTemplate" ["Type"] "Name" t) + '("SetupAcroTemplate" ["Type"] "Name" t) + '("SetupNextAcroTemplate" ["Type"] "Name" t) + "AcroTemplateType" "AcroTemplateName") + + (TeX-run-style-hooks "l3sort" "xspace" "xtemplate" "l3keys2e" - "xparse" "expl3") ;; Fontification (when (and (featurep 'font-latex) (eq TeX-install-font-lock 'font-latex-setup)) - (font-latex-add-keywords '(("DeclareAcronym" "{{") - ("ac" "*{") - ("Ac" "*{") - ("acs" "*{") - ("acl" "*{") - ("Acl" "*{") - ("aca" "*{") - ("acf" "*{") - ("Acf" "*{") - ("acp" "*{") - ("Acp" "*{") - ("acsp" "*{") - ("aclp" "*{") - ("Aclp" "*{") - ("acap" "*{") - ("acfp" "*{") - ("Acfp" "*{") - ("acflike" "*{") - ("acfplike" "*{") - ("iac" "*{") - ("Iac" "*{") - ("iacs" "*{") - ("Iacs" "*{") - ("iaca" "*{") - ("Iaca" "*{") - ("iacl" "*{") - ("Iacl" "*{") - ("iacf" "*{") - ("Iacf" "*{") - ("iacflike" "*{") - ("Iacflike" "*{") - ("acuse" "{")) - 'function))) + (font-latex-add-keywords '(("acsetup" "{") + ("DeclareAcronym" "{{") + ("NewAcroPreset" "{{") + ("RenewAcroPreset" "{{") + ("DeclareAcroPreset" "{{") + ("acreset" "{") + ("acresetall" "") + ("acuse" "{") + ("acuseall" "") + ("acswitchoff" "") + ("acswitchon" "") + ("NewAcroTemplate" "[{{") + ("RenewAcroTemplate" "[{{") + ("SetupAcroTemplate" "[{{") + ("SetupNextAcroTemplate" "[{{")) + 'function) + (font-latex-add-keywords '(("ac" "*[{") + ("Ac" "*[{") + ("acp" "*[{") + ("Acp" "*[{") + ("iac" "*[{") + ("Iac" "*[{") + ;; + ("acs" "*[{") + ("Acs" "*[{") + ("acsp" "*[{") + ("Acsp" "*[{") + ("iacs" "*[{") + ("Iacs" "*[{") + ;; + ("acl" "*[{") + ("Acl" "*[{") + ("aclp" "*[{") + ("Aclp" "*[{") + ("iacl" "*[{") + ("Iacl" "*[{") + ;; + ("aca" "*[{") + ("Aca" "*[{") + ("acap" "*[{") + ("Acap" "*[{") + ("iaca" "*[{") + ("Iaca" "*[{") + ;; + ("acf" "*[{") + ("Acf" "*[{") + ("acfp" "*[{") + ("Acfp" "*[{") + ("iacf" "*[{") + ("Iacf" "*[{") + ;; + ("iacflike" "*[{") + ("Iacflike" "*[{") + ("acflike" "*[{") + ("acfplike" "*[{")) + 'reference))) TeX-dialect) +(defvar LaTeX-acro-package-options-list + '(("upgrade" ("true" "false")))) + (defun LaTeX-acro-package-options () "Prompt for package options for the acro package." (TeX-read-key-val t LaTeX-acro-package-options-list)) diff --git a/style/authblk.el b/style/authblk.el new file mode 100644 index 00000000..9e482d28 --- /dev/null +++ b/style/authblk.el @@ -0,0 +1,73 @@ +;;; authblk.el --- AUCTeX style for `authblk.sty' (v1.3) -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Free Software Foundation, Inc. + +;; Author: Arash Esbati <ar...@gnu.org> +;; Maintainer: auctex-devel@gnu.org +;; Created: 2024-07-05 +;; Keywords: tex + +;; This file is part of AUCTeX. + +;; AUCTeX is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; AUCTeX is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with AUCTeX; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +;; 02110-1301, USA. + +;;; Commentary: + +;; This file adds support for `authblk.sty' (v1.3) from 2001/02/27. +;; `authblk.sty' is part of TeXLive. + +;;; Code: + +(require 'tex) +(require 'latex) + +;; Silence the compiler: +(declare-function font-latex-add-keywords + "font-latex" + (keywords class)) + +(TeX-add-style-hook + "authblk" + (lambda () + (TeX-add-symbols + '("author" ["Footnote marker"] LaTeX-arg-author) + '("affil" ["Footnote marker"] "Affiliation") + '("authorcr" 0) + "Authfont" + "Affilfont" + "Authsep" + "Authand" + "Authands") + + (LaTeX-add-counters "Maxaffil") + (LaTeX-add-lengths "affilsep") + + ;; Fontification + (when (and (featurep 'font-latex) + (eq TeX-install-font-lock 'font-latex-setup)) + (font-latex-add-keywords '(("author" "[{") + ("affil" "[{")) + 'textual) + (font-latex-add-keywords '("authorcr") + 'warning))) + TeX-dialect) + +(defvar LaTeX-authblk-package-options + '("blocks" "noblocks" "max2" "max3" "max4" "max5" "max6" + "auth-sc" "auth-sc-lg" "auth-lg" "affil-sl" "affil-it" "german") + "Package options for the authblk package.") + +;;; authblk.el ends here diff --git a/style/booktabs.el b/style/booktabs.el index bf3c0f53..23dc9889 100644 --- a/style/booktabs.el +++ b/style/booktabs.el @@ -1,6 +1,6 @@ ;;; booktabs.el -- AUCTeX style for booktabs.sty -*- lexical-binding: t; -*- -;; Copyright (C) 2003--2022 Free Software Foundation, Inc. +;; Copyright (C) 2003--2024 Free Software Foundation, Inc. ;; Author: Ralf Angeli <ang...@iwi.uni-sb.de> ;; Maintainer: auctex-devel@gnu.org @@ -51,11 +51,17 @@ '("toprule" [ "Thickness" ]) '("midrule" [ "Thickness" ]) '("bottomrule" [ "Thickness" ]) - ;; The `ignore' resets `TeX-last-optional-rejected' to nil so that the trim - ;; argument is prompted also when the thickness is skipped. - '("cmidrule" [ "Thickness" ] (ignore) - [TeX-arg-string "Trim" nil nil nil "(" ")"] - "Column(s)") + '("cmidrule" + (TeX-arg-conditional + (and (fboundp 'LaTeX-tabularray-NewTblrEnviron-list) + (member (LaTeX-current-environment) + (mapcar #'car (LaTeX-tabularray-NewTblrEnviron-list)))) + ([TeX-arg-key-val (("l") ("r") ("lr")) "Trim"] "Column(s)") + ;; The `ignore' resets `TeX-last-optional-rejected' to nil so + ;; that the trim argument is prompted also when the thickness is + ;; skipped. + (["Thickness"] (ignore) [TeX-arg-string "Trim" nil nil nil "(" ")"] + "Column(s)"))) '("addlinespace" [ "Height" ]) '("morecmidrules") '("specialrule" "Thickness" "Space above" "Space below")) diff --git a/style/listings.el b/style/listings.el index d9352fc7..d8e1dce2 100644 --- a/style/listings.el +++ b/style/listings.el @@ -1,6 +1,6 @@ ;;; listings.el --- AUCTeX style for `listings.sty' -*- lexical-binding: t; -*- -;; Copyright (C) 2004, 2005, 2009, 2013-2022 Free Software Foundation, Inc. +;; Copyright (C) 2004-2024 Free Software Foundation, Inc. ;; Author: Ralf Angeli <ang...@iwi.uni-sb.de> ;; Maintainer: auctex-devel@gnu.org @@ -322,7 +322,7 @@ (LaTeX-add-environments `(,env LaTeX-env-args - [TeX-arg-key-val (LaTeX-listings-key-val-options)] + [TeX-arg-key-val (LaTeX-listings-key-val-options) nil nil ?\s] (LaTeX-env-label-as-keyval "caption") ,(1- (string-to-number args))))) (;; mandatory argument(s) only @@ -343,7 +343,7 @@ (when (fboundp 'reftex-add-label-environments) (reftex-add-label-environments `((,env ?l "lst:" "~\\ref{%s}" - LaTeX-listings-reftex-label-context-function + LaTeX-keyval-caption-reftex-context-function (regexp "[Ll]isting"))))) (when (boundp 'reftex-label-regexps) (add-to-list (make-local-variable 'reftex-label-regexps) @@ -367,39 +367,6 @@ (add-hook 'TeX-auto-cleanup-hook #'LaTeX-listings-auto-cleanup t) (add-hook 'TeX-update-style-hook #'TeX-auto-parse t) -(defun LaTeX-listings-reftex-label-context-function (env) - "Extract and return a context string for RefTeX. -The context string is the value given to the caption key. If no -caption key is found, an error is issued." - (let* ((envstart (save-excursion - (re-search-backward (concat "\\\\begin{" env "}") - nil t))) - (capt-key (save-excursion - (re-search-backward "caption[ \t\n\r%]*=[ \t\n\r%]*" - envstart t))) - capt-start capt-end) - (if capt-key - (save-excursion - (goto-char capt-key) - (re-search-forward - "caption[ \t\n\r%]*=[ \t\n\r%]*" nil t) - (cond (;; Short caption inside [] is available, extract it only - (looking-at-p (regexp-quote (concat TeX-grop LaTeX-optop))) - (forward-char) - (setq capt-start (1+ (point))) - (setq capt-end (1- (progn (forward-sexp) (point))))) - ;; Extract the entire caption which is enclosed in braces - ((looking-at-p TeX-grop) - (setq capt-start (1+ (point))) - (setq capt-end (1- (progn (forward-sexp) (point))))) - ;; Extract everything to next comma , - (t - (setq capt-start (point)) - (setq capt-end (progn (skip-chars-forward "^,") (point))))) - ;; Return the extracted string - (buffer-substring-no-properties capt-start capt-end)) - (error "No caption found")))) - (TeX-add-style-hook "listings" (lambda () @@ -439,7 +406,7 @@ caption key is found, an error is issued." ;; New environments (LaTeX-add-environments '("lstlisting" LaTeX-env-args - [TeX-arg-key-val (LaTeX-listings-key-val-options)] + [TeX-arg-key-val (LaTeX-listings-key-val-options) nil nil ?\s] (LaTeX-env-label-as-keyval "caption"))) ;; Append "lstlisting" to `LaTeX-label-alist': @@ -458,7 +425,7 @@ caption key is found, an error is issued." (when (fboundp 'reftex-add-label-environments) (reftex-add-label-environments '(("lstlisting" ?l "lst:" "~\\ref{%s}" - LaTeX-listings-reftex-label-context-function + LaTeX-keyval-caption-reftex-context-function (regexp "[Ll]isting"))))) ;; Fontification diff --git a/style/longtable.el b/style/longtable.el index 55384bca..67bab1b1 100644 --- a/style/longtable.el +++ b/style/longtable.el @@ -1,6 +1,6 @@ ;;; longtable.el --- AUCTeX style for `longtable.sty'. -*- lexical-binding: t; -*- -;; Copyright (C) 2013--2022 Free Software Foundation, Inc. +;; Copyright (C) 2013--2024 Free Software Foundation, Inc. ;; Maintainer: auctex-devel@gnu.org ;; Author: Mosè Giordano <m...@gnu.org> @@ -117,6 +117,12 @@ insert line break macro." ;; Caption commands '("caption*" 1)) + ;; longtable.sty v4.21 provides the macro \LTcaptype (from + ;; ltcaption.sty) as well. So check here if ltcaption.el is not + ;; loaded before adding the entry as well: + (unless (member "ltcaption" (TeX-style-list)) + (TeX-add-symbols "LTcaptype")) + ;; These parameters are set with \setlength (LaTeX-add-lengths "LTleft" "LTright" "LTpre" "LTpost" "LTcapwidth") @@ -125,12 +131,13 @@ insert line break macro." (LaTeX-add-counters "LTchunksize") ;; Use the enhanced table formatting. Append to - ;; `LaTeX-indent-environment-list' in order not to override custom settings. + ;; `LaTeX-indent-environment-list' in order not to override custom + ;; settings. (add-to-list (make-local-variable 'LaTeX-indent-environment-list) '("longtable" LaTeX-indent-tabular) t) - ;; Append longtable to `LaTeX-label-alist', in order not to override possible - ;; custome values. + ;; Append longtable to `LaTeX-label-alist', in order not to override + ;; possible custome values. (add-to-list 'LaTeX-label-alist '("longtable" . LaTeX-table-label) t) ;; Append longtable to `LaTeX-item-list' with `LaTeX-item-longtable' @@ -139,9 +146,9 @@ insert line break macro." ;; Fontification (when (and (featurep 'font-latex) (eq TeX-install-font-lock 'font-latex-setup)) - ;; Actually, `\caption*{}' macro takes only one mandatory - ;; argument, not an optional one, the following is a workaround - ;; to fontify correctly also the standard `\caption[]{}' macro. + ;; Actually, `\caption*{}' macro takes only one mandatory argument, + ;; not an optional one, the following is a workaround to fontify + ;; correctly also the standard `\caption[]{}' macro. (font-latex-add-keywords '(("caption" "*[{")) 'textual))) TeX-dialect) diff --git a/style/ninecolors.el b/style/ninecolors.el new file mode 100755 index 00000000..68dbb01c --- /dev/null +++ b/style/ninecolors.el @@ -0,0 +1,96 @@ +;;; ninecolors.el --- AUCTeX style for `ninecolors.sty' (v2022D) -*- lexical-binding: t; -*- + +;; Copyright (C) 2022-2024 Free Software Foundation, Inc. + +;; Author: Arash Esbati <ar...@gnu.org> +;; Maintainer: auctex-devel@gnu.org +;; Created: 2022-09-13 +;; Keywords: tex + +;; This file is part of AUCTeX. + +;; AUCTeX is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; AUCTeX is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with AUCTeX; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +;; 02110-1301, USA. + +;;; Commentary: + +;; This file adds support for `ninecolors.sty' (v2022D) from +;; 2022/02/13. `ninecolors.sty' is part of TeXLive. + +;;; Code: + +(require 'tex) + +;; Silence the compiler: +(declare-function LaTeX-add-xcolor-definecolors "xcolor" + (&rest xcolor-definecolors)) +(declare-function font-latex-add-keywords "font-latex" + (keywords class)) + +(defvar LaTeX-ninecolors-colornames + '("gray1" "red1" "brown1" "yellow1" "olive1" + "gray2" "red2" "brown2" "yellow2" "olive2" + "gray3" "red3" "brown3" "yellow3" "olive3" + "gray4" "red4" "brown4" "yellow4" "olive4" + "gray5" "red5" "brown5" "yellow5" "olive5" + "gray6" "red6" "brown6" "yellow6" "olive6" + "gray7" "red7" "brown7" "yellow7" "olive7" + "gray8" "red8" "brown8" "yellow8" "olive8" + "gray9" "red9" "brown9" "yellow9" "olive9" + "green1" "teal1" "cyan1" "azure1" "blue1" + "green2" "teal2" "cyan2" "azure2" "blue2" + "green3" "teal3" "cyan3" "azure3" "blue3" + "green4" "teal4" "cyan4" "azure4" "blue4" + "green5" "teal5" "cyan5" "azure5" "blue5" + "green6" "teal6" "cyan6" "azure6" "blue6" + "green7" "teal7" "cyan7" "azure7" "blue7" + "green8" "teal8" "cyan8" "azure8" "blue8" + "green9" "teal9" "cyan9" "azure9" "blue9" + "violet1" "magenta1" "purple1" + "violet2" "magenta2" "purple2" + "violet3" "magenta3" "purple3" + "violet4" "magenta4" "purple4" + "violet5" "magenta5" "purple5" + "violet6" "magenta6" "purple6" + "violet7" "magenta7" "purple7" + "violet8" "magenta8" "purple8" + "violet9" "magenta9" " purple9") + "List of colors provided by ninecolors package.") + +(TeX-add-style-hook + "ninecolors" + (lambda () + ;; Run the style hook for xcolor.sty: + (TeX-run-style-hooks "xcolor") + + ;; Make the colors defined in ninecolors.sty available: + (apply #'LaTeX-add-xcolor-definecolors LaTeX-ninecolors-colornames) + + ;; Cater for the only macro provided by the package: + (TeX-add-symbols + '("NineColors" + (TeX-arg-key-val (("saturation" ("low" "medium" "high")))))) + + ;; Fontification + (when (and (featurep 'font-latex) + (eq TeX-install-font-lock 'font-latex-setup)) + (font-latex-add-keywords '(("NineColors" "{")) + 'function))) + TeX-dialect) + +(defvar LaTeX-ninecolors-package-options nil + "Package options for the ninecolors package.") + +;;; ninecolors.el ends here diff --git a/style/simpleicons.el b/style/simpleicons.el index f04d2e15..4a99e344 100644 --- a/style/simpleicons.el +++ b/style/simpleicons.el @@ -1,4 +1,4 @@ -;;; simpleicons.el --- AUCTeX style for `simpleicons.sty' (v12.4.0) -*- lexical-binding: t; -*- +;;; simpleicons.el --- AUCTeX style for `simpleicons.sty' (v13.1.0) -*- lexical-binding: t; -*- ;; Copyright (C) 2023--2024 Free Software Foundation, Inc. @@ -26,8 +26,8 @@ ;;; Commentary: -;; This file adds support for `simpleicons.sty' (v12.4.0) from -;; 2024/06/28. `simpleicons.sty' is part of TeXLive. +;; This file adds support for `simpleicons.sty' (v13.1.0) from +;; 2024/07/12. `simpleicons.sty' is part of TeXLive. ;;; Code: @@ -341,11 +341,6 @@ "awssecretsmanager" "awwwards" "axios" - "azureartifacts" - "azuredataexplorer" - "azuredevops" - "azurefunctions" - "azurepipelines" "babel" "babelio" "babylondotjs" @@ -551,6 +546,7 @@ "chocolatey" "chromatic" "chromecast" + "chromewebstore" "chrysler" "chupachups" "cilium" @@ -699,7 +695,6 @@ "cryengine" "cryptpad" "crystal" - "csharp" "css3" "cssdesignawards" "cssmodules" @@ -720,7 +715,6 @@ "daf" "dailydotdev" "dailymotion" - "daimler" "daisyui" "dapr" "darkreader" @@ -738,7 +732,6 @@ "datagrip" "dataiku" "datastax" - "dataverse" "datefns" "datev" "datocms" @@ -772,7 +765,6 @@ "dependencycheck" "depositphotos" "derspiegel" - "designernews" "deutschebahn" "deutschebank" "deutschepost" @@ -810,7 +802,6 @@ "docsify" "doctrine" "docusaurus" - "docusign" "dogecoin" "doi" "dolby" @@ -847,7 +838,6 @@ "dvc" "dwavesystems" "dwm" - "dynamics365" "dynatrace" "e" "e3" @@ -1175,7 +1165,6 @@ "googledatastudio" "googledisplayandvideo360" "googledocs" - "googledomains" "googledrive" "googleearth" "googleearthengine" @@ -1183,7 +1172,6 @@ "googlefonts" "googleforms" "googlegemini" - "googlehangouts" "googlehome" "googlekeep" "googlelens" @@ -1191,14 +1179,11 @@ "googlemarketingplatform" "googlemeet" "googlemessages" - "googlemybusiness" "googlenearby" "googlenews" - "googleoptimize" "googlepay" "googlephotos" "googleplay" - "googlepodcasts" "googlepubsub" "googlescholar" "googlesearchconsole" @@ -1344,9 +1329,6 @@ "iata" "ibeacon" "iberia" - "ibm" - "ibmcloud" - "ibmwatson" "iced" "iceland" "icicibank" @@ -1411,7 +1393,6 @@ "intermarche" "internetarchive" "internetcomputer" - "internetexplorer" "intigriti" "intuit" "invision" @@ -1541,6 +1522,7 @@ "koc" "kodak" "kodi" + "koenigsegg" "kofax" "kofi" "komoot" @@ -1768,25 +1750,6 @@ "microeditor" "microgenetics" "micropython" - "microsoft" - "microsoftacademic" - "microsoftaccess" - "microsoftazure" - "microsoftbing" - "microsoftedge" - "microsoftexcel" - "microsoftexchange" - "microsoftonedrive" - "microsoftonenote" - "microsoftoutlook" - "microsoftpowerpoint" - "microsoftsharepoint" - "microsoftsqlserver" - "microsoftstore" - "microsoftteams" - "microsofttranslator" - "microsoftvisio" - "microsoftword" "microstation" "microstrategy" "midi" @@ -1795,7 +1758,6 @@ "milanote" "milvus" "minds" - "minecraft" "minetest" "mini" "minio" @@ -1818,7 +1780,6 @@ "modin" "modrinth" "modx" - "mojangstudios" "moleculer" "momenteo" "monero" @@ -1836,6 +1797,7 @@ "moo" "moodle" "moonrepo" + "moq" "moqups" "morrisons" "moscowmetro" @@ -2037,6 +1999,7 @@ "orcid" "oreilly" "org" + "organicmaps" "origin" "osano" "osf" @@ -2162,8 +2125,8 @@ "playstation3" "playstation4" "playstation5" + "playstationportable" "playstationvita" - "playwright" "pleroma" "plesk" "plex" @@ -2203,14 +2166,7 @@ "posthog" "postman" "postmates" - "powerapps" - "powerautomate" - "powerbi" - "powerfx" - "powerpages" "powers" - "powershell" - "powervirtualagents" "prdotco" "preact" "precommit" @@ -2367,6 +2323,7 @@ "redis" "redmine" "redox" + "redsys" "redux" "reduxsaga" "redwoodjs" @@ -2380,7 +2337,7 @@ "removedotbg" "renault" "render" - "renovatebot" + "renovate" "renpy" "renren" "replit" @@ -2583,8 +2540,6 @@ "skoda" "sky" "skypack" - "skype" - "skypeforbusiness" "skyrock" "slack" "slackware" @@ -2795,6 +2750,7 @@ "teamcity" "teamspeak" "teamviewer" + "techcrunch" "ted" "teepublic" "teespring" @@ -2971,6 +2927,7 @@ "unitedairlines" "unitednations" "unity" + "unjs" "unlicense" "unocss" "unpkg" @@ -3034,10 +2991,6 @@ "virtualbox" "virustotal" "visa" - "visualbasic" - "visualstudio" - "visualstudioappcenter" - "visualstudiocode" "visx" "vite" "vitepress" @@ -3100,6 +3053,7 @@ "webex" "webflow" "webgl" + "webgpu" "weblate" "webmin" "webmoney" @@ -3133,11 +3087,6 @@ "wikiquote" "wikivoyage" "winamp" - "windows" - "windows10" - "windows95" - "windowsterminal" - "windowsxp" "wipro" "wire" "wireguard" @@ -3166,10 +3115,7 @@ "wykop" "wyze" "x" - "xamarin" - "xaml" "xampp" - "xbox" "xcode" "xdadevelopers" "xdotorg" @@ -3189,7 +3135,6 @@ "yamahacorporation" "yamahamotorcorporation" "yaml" - "yammer" "yandexcloud" "yarn" "ycombinator" diff --git a/style/tabularray.el b/style/tabularray.el new file mode 100644 index 00000000..4b5abcff --- /dev/null +++ b/style/tabularray.el @@ -0,0 +1,474 @@ +;;; tabularray.el --- AUCTeX style for `tabularray.sty' -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Free Software Foundation, Inc. + +;; Author: Arash Esbati <ar...@gnu.org> +;; Maintainer: auctex-devel@gnu.org +;; Created: 2024-06-17 +;; Keywords: tex + +;; This file is part of AUCTeX. + +;; AUCTeX is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; AUCTeX is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with AUCTeX; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +;; 02110-1301, USA. + +;;; Commentary: + +;; This file adds support for the tabularray package version 2024A from +;; 2024-02-16. + +;;; Code: + +(require 'tex) +(require 'latex) + +;; Silence the compiler: +(declare-function font-latex-add-keywords "font-latex" (keywords class)) +(declare-function reftex-compile-variables "reftex" ()) + +(defvar LaTeX-tabularray-outerspec-key-val + '(("baseline" ("t" "T" "m" "b" "B")) + ("long" ("true" "false")) + ("tall" ("true" "false")) + ("expand" ("\\expanded")) + ("t") ("T") ("m") ("b") ("B")) + "Key=value options for the outerspec of tabularray environments.") + +(defun LaTeX-tabularray-outerspec-key-val () + "Return key=value options for the outerspec of tabularray environments." + (append + (when (member (LaTeX-current-environment) '("longtblr" "talltblr")) + (let ((len (mapcar (lambda (x) (concat TeX-esc (car x))) + (LaTeX-length-list)))) + + `(("headsep" ,len) + ("footsep" ,len) + ("presep" ,len) + ("postsep" ,len) + ("theme") + ("caption") + ("entry" ("none")) + ("label" ("none")) + ("note{}") + ("remark{}")))) + (when (member "functional" (LaTeX-tabularray-used-library)) + '(("evalute"))) + LaTeX-tabularray-outerspec-key-val)) + +(defun LaTeX-tabularray-innerspec-key-val () + "Return key=value options for the innerspec of tabularray environments." + (append + (when (member (LaTeX-current-environment) '("longtblr" "talltblr")) + '(("rowhead") + ("rowfoot"))) + (when (member "functional" (LaTeX-tabularray-used-library)) + '(("process"))) + (let ((len (mapcar (lambda (x) (concat TeX-esc (car x))) + (LaTeX-length-list))) ) + `(("hlines" ("solid" "dashed" "dotted" "text" + "wd" "leftpos" "rightpos" "endpos" "{}{-}{}")) + ("vlines" ("solid" "dashed" "dotted" "text" + "wd" "abovepos" "belowpos" "{odd}{}" "{even}{}")) + ("hline{}" ("solid" "dashed" "dotted" "text" + "wd" "leftpos" "rightpos" "endpos")) + ("vline{}" ("solid" "dashed" "dotted" "text" + "wd" "abovepos" "belowpos" "{odd}{}" "{even}{}" + "{}{}")) + ("hborder{}" ("pagebreak" "abovespace" "belowspace" + "abovespace+" "belowspace+")) + ("vborder{}" ("leftspace" "rightspace" + "leftspace+" "rightspace+")) + + ("cells" ("halign" "l" "c" "r" "j" "valign" "t" "m" "b" "wd" + "bg" "fg" "font" "mode" "$" "$$" "cmd" "preto" "appto")) + ("cell{}{}" ("halign" "l" "c" "r" "j" "valign" "t" "m" "b" "wd" + "bg" "fg" "font" "mode" "$" "$$" "cmd" "preto" "appto")) + + ("rows" ("halign" "l" "c" "r" "j" "valign" "t" "m" "b" "h" "f" + "ht" "bg" "fg" "font" "mode" "$" "$$" "cmd" + "abovesep" "abovesep+" "belowsep" "belowsep+" + "rowsep" "rowsep+" "preto" "appto")) + ("columns" ("halign" "l" "c" "r" "j" "valign" "t" "m" "b" "h" "f" + "wd" "co" "bg" "fg" "font" "mode" "$" "$$" "cmd" + "leftsep" "leftsep+" "rightsep" "rightsep+" + "colsep" "colsep+" "preto" "appto")) + + ("row{}" ("halign" "l" "c" "r" "j" "valign" "t" "m" "b" "h" "f" + "ht" "bg" "fg" "font" "mode" "$" "$$" "cmd" + "abovesep" "abovesep+" "belowsep" "belowsep+" + "rowsep" "rowsep+" "preto" "appto")) + ("column{}" ("halign" "l" "c" "r" "j" "valign" "t" "m" "b" "h" "f" + "wd" "co" "bg" "fg" "font" "mode" "$" "$$" "cmd" + "leftsep" "leftsep+" "rightsep" "rightsep+" + "colsep" "colsep+" "preto" "appto")) + ("width" ,len) + ("colspec" ("{}")) + ("rulesep" ,len) + ("stretch") + ("abovesep" ,len) + ("belowsep" ,len) + ("rowsep" ,len) + ("leftsep" ,len) + ("rightsep" ,len) + ("colsep" ,len) + ("hspan" ("default" "even" "minimal")) + ("vspan" ("default" "even")) + ("baseline" ("t" "T" "m" "b" "B")))))) + +(defvar LaTeX-tabularray-longtable-template-elements + '("contfoot-text" + "contfoot" + "conthead-text" + "conthead" + "caption-tag" + "caption-sep" + "caption-text" + "caption" + "note-tag" + "note-sep" + "note-text" + "note" + "remark-tag" + "remark-sep" + "remark-text" + "remark" + "firsthead" + "middlehead" + "lasthead" + "head" + "firstfoot" + "middlefoot" + "lastfoot" + "foot") + "List of longtable template elements defined by tabularray.sty.") + +(defvar LaTeX-tabularray-longtable-template-names + '(("normal") ("empty") ("fg") ("font") ("halign") ("indent") ("hang")) + "AList of longtable template names and keys defined by tabularray.sty.") + +(TeX-auto-add-type "tabularray-NewColumnType" "LaTeX") + +(defvar LaTeX-tabularray-NewColumnType-regexp + '("\\\\NewColumnType{\\([^}]+\\)}" + 1 LaTeX-auto-tabularray-NewColumnType) + "Matches the argument of \\NewColumnType from tabularray package.") + +(defun LaTeX-tabularray-update-column-letters () + "Update and uniquify the local value of `LaTeX-array-column-letters'." + (setq-local LaTeX-array-column-letters + (let* ((newtypes (mapconcat #'car + (LaTeX-tabularray-NewColumnType-list) + "")) + (alltypes (concat LaTeX-array-column-letters newtypes))) + (seq-concatenate 'string (seq-uniq alltypes #'=))))) + +(TeX-auto-add-type "tabularray-UseTblrLibrary" + "LaTeX" + "tabularray-UseTblrLibraries") + +(defvar LaTeX-tabularray-UseTblrLibrary-regexp + '("\\\\UseTblrLibrary{\\([^}]+\\)}" + 1 LaTeX-auto-tabularray-UseTblrLibrary) + "Matches the argument of \\UseTblrLibrary from tabularray package.") + +(defun LaTeX-tabularray-used-library () + "Return a list of used tabularray libraries in current document." + (when LaTeX-auto-tabularray-UseTblrLibrary + (apply #'append + (mapcar (lambda (x) (string-split x "," t)) + (mapcar (lambda (y) + (replace-regexp-in-string "[ %\n\r\t]" "" y)) + LaTeX-auto-tabularray-UseTblrLibrary))))) + +(TeX-auto-add-type "tabularray-NewTblrEnviron" "LaTeX") + +(defvar LaTeX-tabularray-NewTblrEnviron-regexp + '("\\\\NewTblrEnviron{\\([^}]+\\)}" + 1 LaTeX-auto-tabularray-NewTblrEnviron) + "Matches the argument of \\NewTblrEnviron from tabularray package.") + +(defun LaTeX-tabularray-NewTblrEnviron-cleanup () + "Process user defined environments with tabularray package." + (let (result) + (dolist (elt (LaTeX-tabularray-NewTblrEnviron-list)) + (push (cons (car elt) + '(LaTeX-env-args + [TeX-arg-key-val LaTeX-tabularray-outerspec-key-val + "Outer spec" nil ?\s] + (TeX-arg-key-val (LaTeX-tabularray-innerspec-key-val) + "Inner spec") + (LaTeX-env-label-as-keyval "caption") + (lambda (_) + (LaTeX-item-tabularray t)))) + result)) + (apply #'LaTeX-add-environments result))) + +(defun LaTeX-tabularray-auto-prepare () + "Clear `LaTeX-auto-tabularray-*' before parsing." + (setq LaTeX-auto-tabularray-NewColumnType nil + LaTeX-auto-tabularray-UseTblrLibrary nil + LaTeX-auto-tabularray-NewTblrEnviron nil)) + +(defun LaTeX-tabularray-auto-cleanup () + "Process parsed elements for tabularray package. +This function updates the value of `LaTeX-array-column-letters' with +newly defined column specifications, runs `TeX-run-style-hooks' for +loaded libraries and adds support for new environments via +`LaTeX-add-environments'." + (LaTeX-tabularray-update-column-letters) + (apply #'TeX-run-style-hooks (LaTeX-tabularray-used-library)) + (LaTeX-tabularray-NewTblrEnviron-cleanup)) + +(add-hook 'TeX-auto-prepare-hook #'LaTeX-tabularray-auto-prepare t) +(add-hook 'TeX-auto-cleanup-hook #'LaTeX-tabularray-auto-cleanup t) +(add-hook 'TeX-update-style-hook #'TeX-auto-parse t) + +(defvar LaTeX-tabularray-skipping-regexp + "[ \t]*\\(?:\\[[^]]+\\]\\)?[ \t]*" + "Regexp matching between \\begin{tblr} and column specification. +For tblr environment only. See `LaTeX-insert-ampersands' for detail. + +This regexp assumes that the optional outer specification doesn't +contain a closing ] in any fashion.") + +(defun LaTeX-tabularray-count-columns (start end) + "Adjust START and END acc. to column spec inside the tabularray env's. +This function checks if the column specification is given as value to +the \"colspec\" key and adjusts the values of START and END before +running `LaTeX-array-count-columns' with them." + (save-excursion + (when (re-search-forward "colspec[ \t]*=[ \t]*" end t) + (if (= (following-char) ?\{) + ;; The columns spec is enclosed in a group, so handle it: + (progn + (forward-char) + (setq start (point)) + (setq end (1- (TeX-find-closing-brace)))) + ;; The spec is given without a group, i.e., colspec=lcr, so we + ;; travel until the next ',' or '}': + (setq start (point)) + (skip-chars-forward "^,}") + (setq end (point))))) + (LaTeX-array-count-columns start end)) + +(defun LaTeX-item-tabularray (&optional suppress) + "Insert line break macro on the last line and suitable number of &'s. +For tabularray environments. If SUPPRESS is non-nil, do not +insert line break macro." + (if suppress + (save-excursion + (goto-char TeX-exit-mark) + (LaTeX-insert-ampersands + LaTeX-tabularray-skipping-regexp #'LaTeX-tabularray-count-columns)) + (save-excursion + (end-of-line 0) + (just-one-space) + (TeX-insert-macro "\\")) + (LaTeX-insert-ampersands + LaTeX-tabularray-skipping-regexp #'LaTeX-tabularray-count-columns))) + +(TeX-add-style-hook + "tabularray" + (lambda () + + (TeX-auto-add-regexp LaTeX-tabularray-NewColumnType-regexp) + (TeX-auto-add-regexp LaTeX-tabularray-UseTblrLibrary-regexp) + (TeX-auto-add-regexp LaTeX-tabularray-NewTblrEnviron-regexp) + + ;; Pre-defined environments: + (LaTeX-add-tabularray-NewTblrEnvirons "tblr" "longtblr" "talltblr") + ;; 5.2 Library booktabs + (when (member "booktabs" (LaTeX-tabularray-used-library)) + (LaTeX-add-tabularray-NewTblrEnvirons "booktabs")) + ;; Pre-defined column types: + (LaTeX-add-tabularray-NewColumnTypes "Q" "t" "m" "b" "h" "f" "X") + ;; Update the internals: + (LaTeX-tabularray-NewTblrEnviron-cleanup) + (LaTeX-tabularray-update-column-letters) + + ;; Load ninecolors.el if xcolor.el is loaded: + (when (member "xcolor" (TeX-style-list)) + (TeX-run-style-hooks "ninecolors")) + + (TeX-add-symbols + ;; 2.6.2 Column Types + '("NewColumnType" + (lambda (optional) + (let ((col (TeX-read-string + (TeX-argument-prompt optional nil "Column type")))) + (LaTeX-add-tabularray-NewColumnTypes col) + (LaTeX-tabularray-update-column-letters) + (TeX-argument-insert col optional))) + [ "Number of arguments" ] [ "Default value for first argument" ] t) + + ;; 2.6.3 Row Types + '("NewRowType" "Row type" [ "Number of arguments" ] t) + + ;; 3.3 Default Specifications + '("SetTblrInner" + (TeX-arg-key-val + [TeX-arg-completing-read-multiple (LaTeX-tabularray-NewTblrEnviron-list) + "Tabularray environment(s)"] + (LaTeX-tabularray-innerspec-key-val))) + + '("SetTblrOuter" + (TeX-arg-key-val + [TeX-arg-completing-read-multiple (LaTeX-tabularray-NewTblrEnviron-list) + "Tabularray environment(s)"] + (LaTeX-tabularray-innerspec-key-val))) + + '("UseTblrLibrary" + (TeX-arg-completing-read-multiple ("amsmath" + "booktabs" + "counter" + "diagbox" + "functional" + "nameref" + "siunitx" + "varwidth" + "zref") + "Library") + (lambda (_) + (save-excursion + (re-search-backward "\\\\UseTblrLibrary{\\([^}]+\\)}" + (line-beginning-position) t) + (LaTeX-add-tabularray-UseTblrLibraries + (match-string-no-properties 1)) + (apply #'TeX-run-style-hooks (LaTeX-tabularray-used-library))))) + + ;; 3.4 New Tabularray Environments + '("NewTblrEnviron" + (lambda (optional) + (let ((env (TeX-read-string + (TeX-argument-prompt optional nil "New enviroment")))) + (LaTeX-add-tabularray-NewTblrEnvirons env) + (LaTeX-tabularray-NewTblrEnviron-cleanup) + (TeX-argument-insert env optional)))) + + ;; 4.2 Customize Templates + '("DefTblrTemplate" + (TeX-arg-completing-read-multiple LaTeX-tabularray-longtable-template-elements + "Template element") + (TeX-arg-key-val LaTeX-tabularray-longtable-template-names + "Template name") + t) + + '("SetTblrTemplate" + (TeX-arg-completing-read-multiple LaTeX-tabularray-longtable-template-elements + "Template element") + (TeX-arg-key-val LaTeX-tabularray-longtable-template-names + "Template name")) + + '("UseTblrTemplate" + (TeX-arg-completing-read-multiple LaTeX-tabularray-longtable-template-elements + "Template element") + (TeX-arg-key-val LaTeX-tabularray-longtable-template-names + "Template name")) + + '("InsertTblrText" + (TeX-arg-completing-read LaTeX-tabularray-longtable-template-elements + "Template element")) + + '("MapTblrNotes" t) + "InsertTblrNoteTag" + "InsertTblrNoteText" + "InsertTblrRemarkTag" + "InsertTblrRemarkText" + + ;; 4.4 Define Themes + '("NewTblrTheme" "Theme" t) ) + + ;; 5.1 Library amsmath + (when (member "amsmath" (LaTeX-tabularray-used-library)) + (LaTeX-add-environments + '("+array" LaTeX-env-array) + '("+matrix" LaTeX-env-args + [TeX-arg-key-val (LaTeX-tabularray-innerspec-key-val)]) + '("+bmatrix" LaTeX-env-args + [TeX-arg-key-val (LaTeX-tabularray-innerspec-key-val)]) + '("+Bmatrix" LaTeX-env-args + [TeX-arg-key-val (LaTeX-tabularray-innerspec-key-val)]) + '("+pmatrix" LaTeX-env-args + [TeX-arg-key-val (LaTeX-tabularray-innerspec-key-val)]) + '("+vmatrix" LaTeX-env-args + [TeX-arg-key-val (LaTeX-tabularray-innerspec-key-val)]) + '("+Vmatrix" LaTeX-env-args + [TeX-arg-key-val (LaTeX-tabularray-innerspec-key-val)]) + '("+cases" LaTeX-env-args + [TeX-arg-key-val (LaTeX-tabularray-innerspec-key-val)]))) + + ;; 5.4 Library diagbox + (when (member "diagbox" (LaTeX-tabularray-used-library)) + (TeX-add-symbols + '("diagboxthree" + [TeX-arg-key-val (LaTeX-diagbox-key-val-options)] 3))) + + ;; Add env's to `LaTeX-item-list': + (dolist (env (mapcar #'car (LaTeX-tabularray-NewTblrEnviron-list))) + (add-to-list 'LaTeX-item-list (cons env 'LaTeX-item-tabularray) t)) + + ;; Cater for label prefix and tell RefTeX: + (let ((envs '("longtblr" "talltblr"))) + (dolist (env envs) + (add-to-list 'LaTeX-label-alist (cons env 'LaTeX-table-label) t) + (when (fboundp 'reftex-add-label-environments) + (reftex-add-label-environments + `((,env ?t nil nil LaTeX-keyval-caption-reftex-context-function))))) + (when (boundp 'reftex-label-regexps) + (let ((re (concat (regexp-quote TeX-esc) + "begin[[:space:]]*" + (regexp-quote TeX-grop) + (regexp-opt envs) + (regexp-quote TeX-grcl) + "[[:space:]]*" + ;; Match the opening [ and the following chars + "\\[[^][]*" + ;; Allow nested levels of chars enclosed in braces + "\\(?:{[^}{]*" + "\\(?:{[^}{]*" + "\\(?:{[^}{]*}[^}{]*\\)*" + "}[^}{]*\\)*" + "}[^][]*\\)*" + ;; Match the label key + "\\<label[[:space:]]*=[[:space:]]*" + ;; Match the label value; braces around the value are + ;; optional. + "{?\\(?1:[^] ,}\r\n\t%]+\\)"))) + (unless (member re reftex-label-regexps) + (add-to-list 'reftex-label-regexps re t) + (reftex-compile-variables))))) + + ;; Fontification + (when (and (featurep 'font-latex) + (eq TeX-install-font-lock 'font-latex-setup)) + (font-latex-add-keywords '(("NewColumnType" "{[[{") + ("NewRowType" "{[{") + ("SetTblrInner" "[{") + ("SetTblrOuter" "[{") + ("NewTblrEnviron" "{") + ("UseTblrLibrary" "{") + ("DefTblrTemplate" "{{{") + ("SetTblrTemplate" "{{") + ("NewTblrTheme" "{{")) + 'function) + (when (member "diagbox" (LaTeX-tabularray-used-library)) + (font-latex-add-keywords '(("diagboxthree" "[{{{")) + 'textual))) ) + TeX-dialect) + +(defvar LaTeX-tabularray-package-options nil + "Package options for the tabularray package.") + +;;; tabularray.el ends here diff --git a/tests/latex/font-latex-test.el b/tests/latex/font-latex-test.el index 94150ac0..3039bf15 100644 --- a/tests/latex/font-latex-test.el +++ b/tests/latex/font-latex-test.el @@ -1,6 +1,6 @@ ;;; font-latex-test.el --- tests for font-latex -*- lexical-binding: t; -*- -;; Copyright (C) 2020-2023 Free Software Foundation, Inc. +;; Copyright (C) 2020-2024 Free Software Foundation, Inc. ;; This file is part of AUCTeX. @@ -107,6 +107,10 @@ $a$") (font-latex-fontify-sectioning 'color)) (insert "\ \\documentclass[10pt]{article} + +\\setlength{\\parskip}{3cm} +\\addtolength\\parskip\\foo + \\begin{document} \\section{Macros} @@ -186,6 +190,17 @@ x (should (font-latex-faces-present-p 'font-lock-function-name-face)) (end-of-line) + ;; Test for \setlength alternatives: + (re-search-forward "\\\\setlength{\\\\p") + (should (font-latex-faces-present-p 'font-lock-variable-name-face + (match-end 0))) + (re-search-forward "\\\\addtolength\\\\p") + (should (font-latex-faces-present-p 'font-lock-variable-name-face + (match-end 0))) + (re-search-forward "\\\\f") + (should (font-latex-faces-present-p 'font-lock-variable-name-face + (match-end 0))) + ;; Test for \section macro itself: (re-search-forward "\\\\sec\\(?1:t\\)ion{") (should (font-latex-faces-present-p 'font-lock-keyword-face diff --git a/tex-site.el.in b/tex-site.el.in index 5abf351a..2e8b4b50 100644 --- a/tex-site.el.in +++ b/tex-site.el.in @@ -113,29 +113,51 @@ Arrange the redirection of the built-in TeX modes according to VALUE. - The built-in modes in VALUE are redirected to the corresponding AUCTeX major modes. - The built-in modes not in VALUE discard redirection, if any. -If `major-mode-remap-alist' is available, use it for redirection. -Otherwise, use advice facility." +If either `major-mode-remap-defaults' or `major-mode-remap-alist' is +available, use it for redirection in that order. Otherwise, use advice +facility." (custom-set-default var value) (let (elt dst) (dolist (entry TeX-mode-alist) (setq elt (car entry) dst (cdr entry)) (if (memq elt value) - (if (boundp 'major-mode-remap-alist) - (or (eq (cdr-safe (assq elt major-mode-remap-alist)) dst) - (push (cons elt dst) major-mode-remap-alist)) - ;; COMPATIBILITY for Emacs<29 - (advice-add elt :override dst - ;; COMPATIBILITY for Emacs 28.[12] - ;; Give it higher precedence than the :around - ;; advice given to `tex-mode' in tex-mode.el. - ;; <URL:https://lists.gnu.org/r/auctex-devel/2022-09/msg00050.html> - '((depth . -10)))) - (if (boundp 'major-mode-remap-alist) - (setq major-mode-remap-alist - (delete entry major-mode-remap-alist)) - ;; COMPATIBILITY for Emacs<29 - (advice-remove elt dst)))))) + (progn + (cond ((boundp 'major-mode-remap-defaults) + ;; For Emacs 30 and later + (add-to-list 'major-mode-remap-defaults (cons elt dst))) + ((boundp 'major-mode-remap-alist) + ;; COMPATIBILITY for Emacs 29 + (add-to-list 'major-mode-remap-alist (cons elt dst))) + (t + ;; COMPATIBILITY for Emacs<29 + (advice-add elt :override dst + ;; COMPATIBILITY for Emacs 28 + ;; Give it higher precedence than the :around + ;; advice given to `tex-mode' in tex-mode.el. + ;; <URL:https://lists.gnu.org/r/auctex-devel/2022-09/msg00050.html> + '((depth . -10))))) + ;; Keep compatibility. (bug#71363) + (if (eq elt 'latex-mode) + (with-eval-after-load 'org-src + (defvar org-src-lang-modes) ; Silence byte compiler. + ;; Check the actual presence in the entry in case that + ;; the user once choosed AUCTeX LaTeX mode and + ;; abandoned it afterwards in the same emacs session. + (when (memq 'latex-mode TeX-modes) + (push '("latex" . LaTeX) org-src-lang-modes) + (push '("beamer" . LaTeX) org-src-lang-modes))))) + (cond ((boundp 'major-mode-remap-defaults) + ;; For Emacs 30 and later + (setq major-mode-remap-defaults + (delete entry major-mode-remap-defaults))) + ((boundp 'major-mode-remap-alist) + ;; COMPATIBILITY for Emacs 29 + (setq major-mode-remap-alist + (delete entry major-mode-remap-alist))) + (t + ;; COMPATIBILITY for Emacs<29 + (advice-remove elt dst))))))) (defcustom TeX-modes (mapcar #'car TeX-mode-alist)