branch: main
commit d78fc3fa0358dc74eca354985b234310624d5502
Author: Arash Esbati <[email protected]>
Commit: Arash Esbati <[email protected]>
Add new style/figureversions.el
* NEWS.org (Added): Announce the new style.
* style/figureversions.el: New file.
* style/fontaxes.el ("fontaxes"): Adjust provided macros to
package v2.0.1 and load the new style figureversions.el.
---
NEWS.org | 3 +-
style/figureversions.el | 114 ++++++++++++++++++++++++++++++++++++++++++++++++
style/fontaxes.el | 82 ++++++----------------------------
3 files changed, 130 insertions(+), 69 deletions(-)
diff --git a/NEWS.org b/NEWS.org
index eaca9f38..6594cd0e 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -15,7 +15,8 @@
environment at point to inline math and the more general
~LaTeX-modify-math~ which converts the mathematical construct at point
into one with different kind of delimiter or another environment.
-- Add new support files =style/embedfile.el= and =style/needspace.el=.
+- Add new support files =style/embedfile.el=, =style/figureversions.el=
+ and =style/needspace.el=.
** Changed
diff --git a/style/figureversions.el b/style/figureversions.el
new file mode 100644
index 00000000..6db7966d
--- /dev/null
+++ b/style/figureversions.el
@@ -0,0 +1,114 @@
+;;; figureversions.el --- AUCTeX style for `figureversions.sty' v1.0.1 -*-
lexical-binding: t; -*-
+
+;; Copyright (C) 2025 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <[email protected]>
+;; Maintainer: [email protected]
+;; Created: 2025-04-06
+;; 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 this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file adds support for `figureversions.sty' v1.0.1 from
+;; 2025-04-29. `figureversions.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
+ "figureversions"
+ (lambda ()
+ (TeX-add-symbols
+ ;; 2.1 High-level document commands
+ '("lnfigures" -1) ; style: lining figures
+ '("txfigures" -1) ; style: text figures (osf)
+ '("liningfigures" "Text")
+ '("textfigures" "Text")
+
+ '("prfigures" -1) ; alignment: proportional figures
+ '("tbfigures" -1) ; alignment: tabular figures
+ '("proportionalfigures" "Text")
+ '("tabularfigures" "Text")
+
+ ;; Math versions
+ '("boldmath" -1) ; math weight
+ '("unboldmath" -1)
+ '("tabularmath" -1) ; math figure alignment
+ '("proportionalmath" -1)
+
+ ;; Figure versions
+ '("figureversion"
+ (TeX-arg-completing-read-multiple ("text" "osf"
+ "lining" "lf"
+ "tabular" "tab"
+ "proportional" "prop")
+ "Style, alignment"))
+
+ ;; 2.2 Low-level document commands
+ '("fontfigurestyle"
+ (TeX-arg-completing-read ("text" "lining")
+ "Style"))
+ '("fontfigurealignment"
+ (TeX-arg-completing-read ("tabular" "proportional")
+ "Alignment"))
+ '("fontbasefamily" "Font family")
+
+ '("mathweight"
+ (TeX-arg-completing-read ("bold" "normal")
+ "Math weight"))
+ '("mathfigurealignment"
+ (TeX-arg-completing-read ("tabular" "proportional")
+ "Math figure alignment")))
+
+ ;; 2.3 Code-level interface
+ ;; Add the macros only in `docTeX-mode':
+ (when (derived-mode-p 'docTeX-mode)
+ (TeX-run-style-hooks "expl3")
+ (TeX-add-symbols
+ '("figureversions_new_figurestyle:nnn"
+ TeX-arg-space "Name"
+ TeX-arg-space "Proportional suffixes"
+ TeX-arg-space "Tabular suffixes")
+ '("figureversions_new_figureversion:nn"
+ TeX-arg-space "Option"
+ TeX-arg-space t)))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("liningfigures" "{")
+ ("textfigures" "{")
+ ("proportionalfigures" "{")
+ ("tabularfigures" "{"))
+ 'type-command)
+ (font-latex-add-keywords '("lnfigures" "txfigures"
+ "prfigures" "tbfigures")
+ 'type-declaration)
+ (font-latex-add-keywords '(("figureversion" "{"))
+ 'variable)))
+ TeX-dialect)
+
+(defvar LaTeX-figureversions-package-options nil
+ "Package options for the figureversions package.")
+
+;;; figureversions.el ends here
diff --git a/style/fontaxes.el b/style/fontaxes.el
index f1e648c7..f2ea39af 100644
--- a/style/fontaxes.el
+++ b/style/fontaxes.el
@@ -1,6 +1,6 @@
-;;; fontaxes.el --- AUCTeX style for `fontaxes.sty' version v1.0d -*-
lexical-binding: t; -*-
+;;; fontaxes.el --- AUCTeX style for `fontaxes.sty' v2.0.1 -*-
lexical-binding: t; -*-
-;; Copyright (C) 2014--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2014--2025 Free Software Foundation, Inc.
;; Author: Arash Esbati <[email protected]>
;; Maintainer: [email protected]
@@ -24,82 +24,28 @@
;;; Commentary:
-;; This file adds support for `fontaxes.sty' version v1.0d from
-;; 2014/03/23. `fontaxes.sty' is part of TeXLive.
-
-;; Thanks to Mos� Giordano for his perceptive comments on
-;; implementation of "figureversion".
+;; This file adds support for `fontaxes.sty' v2.0.1 from 2025-05-24.
+;; `fontaxes.sty' is deprecated in favor of `figureversions.sty'. This
+;; style reflects this change and loads `figureversions.el', adding the
+;; remaining compatibility macros to AUCTeX.
;;; Code:
(require 'tex)
-;; Silence the compiler:
-(declare-function font-latex-add-keywords
- "font-latex"
- (keywords class))
-
(TeX-add-style-hook
"fontaxes"
(lambda ()
+
+ (TeX-run-style-hooks "figureversions")
+
(TeX-add-symbols
- ;; Various font shapes:
- ;; These macros are now part of LaTeX kernel 2020-02-02
- ;; '("swshape" -1) ; swash shape
- ;; '("sscshape" -1) ; spaced small caps
- ;; '("swdefault" 0)
- ;; '("sscdefault" 0)
- ;; '("ulcdefault" 0)
'("fontprimaryshape" t)
- '("fontsecondaryshape" t)
-
- ;; Figure versions
- '("figureversion"
- (TeX-arg-completing-read-multiple ("text" "osf"
- "lining" "lf"
- "tabular" "tab"
- "proportional" "prop")
- "Style, alignment"))
- '("txfigures" -1) ; style: text figures (osf)
- '("lnfigures" -1) ; style: lining figures
- '("tbfigures" -1) ; alignment: tabular figures
- '("prfigures" -1) ; alignment: proportional figures
- '("fontfigurestyle"
- (TeX-arg-completing-read ("text" "lining") "Style"))
- '("fontfigurealignment"
- (TeX-arg-completing-read ("tabular" "proportional") "Alignment"))
- '("fontbasefamily" t)
-
- ;; Math versions
- '("boldmath" -1) ; math weight
- '("unboldmath" -1) ;
- '("tabularmath" -1) ; math figure alignment
- '("proportionalmath" -1) ;
- '("mathweight"
- (TeX-arg-completing-read ("bold" "normal") "Math weight"))
- '("mathfigurealignment"
- (TeX-arg-completing-read ("tabular" "proportional") "Math figure
alignment"))
-
- ;; Additional commands
- ;; These macros are now part of LaTeX kernel 2020-02-02
- ;; '("textsw" t)
- ;; '("textssc" t)
- ;; '("textulc" t)
- '("textfigures" t)
- '("liningfigures" t)
- '("tabularfigures" t)
- '("proportionalfigures" t))
-
- ;; Fontification
- (when (and (featurep 'font-latex)
- (eq TeX-install-font-lock 'font-latex-setup))
- (font-latex-add-keywords '(("textfigures" "{")
- ("liningfigures" "{")
- ("tabularfigures" "{")
- ("proportionalfigures" "{"))
- 'type-command)
- (font-latex-add-keywords '(("figureversion" "{"))
- 'variable)))
+ '("fontsecondaryshape" t))
+
+ (when (derived-mode-p 'docTeX-mode)
+ (TeX-add-symbols
+ '("fa@naming@exception" 3))))
TeX-dialect)
(defvar LaTeX-fontaxes-package-options nil