branch: main
commit 8636bec01d02c2de8a2ac8cb1b54e3c1772a250d
Author: Arash Esbati <[email protected]>
Commit: Arash Esbati <[email protected]>

    Add new style/sourcesans.el and style/sourceserif.el
    
    * NEWS.org (Added): Announce the new styles.
    
    * style/sourceserif.el:
    * style/sourcesans.el: New files.
---
 NEWS.org             |  3 +-
 style/sourcesans.el  | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 style/sourceserif.el | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 170 insertions(+), 1 deletion(-)

diff --git a/NEWS.org b/NEWS.org
index 614f8020..506b3fc9 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -11,7 +11,8 @@
 
 ** Added
 
-- Add new support file =style/lua-unicode-math.el=.
+- Add new support files =style/lua-unicode-math.el=,
+  =style/sourcesans.el= and =style/sourceserif.el=.
 
 ** Changed
 
diff --git a/style/sourcesans.el b/style/sourcesans.el
new file mode 100644
index 00000000..646c42c7
--- /dev/null
+++ b/style/sourcesans.el
@@ -0,0 +1,85 @@
+;;; sourcesans.el --- AUCTeX style for `sourcesans.sty' (v3.0)  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2026 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <[email protected]>
+;; Maintainer: [email protected]
+;; Created: 2026-03-08
+;; 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 `sourcesans.sty' (v3.0) from 2026-03-01.
+;; `sourcesans.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
+ "sourcesans"
+ (lambda ()
+
+   ;; Load "fontspec" with package options "opentype" or "otf":
+   (when (or (LaTeX-provided-package-options-member "sourcesans" "opentype")
+             (LaTeX-provided-package-options-member "sourcesans" 
"opentype=true")
+             (LaTeX-provided-package-options-member "sourcesans" "otf")
+             (LaTeX-provided-package-options-member "sourcesans" "otf=true"))
+     (TeX-run-style-hooks "fontspec"))
+
+   ;; The next set of macros is only available when package "fontspec"
+   ;; is loaded, by this style or by user.  We just check against
+   ;; "fontspec" and do not go through a check of `TeX-engine':
+   (when (member "fontspec" (TeX-style-list))
+     (TeX-add-symbols
+      '("sourcesans"        -1)
+      '("sourcesansmedium"  -1)
+      '("sourcesanslight"   -1)
+      '("sourcesansextreme" -1)
+      '("sourcesanslf"      -1)))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup)
+              (member "fontspec" (TeX-style-list)))
+     (font-latex-add-keywords '(("sourcesans"        "")
+                                ("sourcesansmedium"  "")
+                                ("sourcesanslight"   "")
+                                ("sourcesansextreme" "")
+                                ("sourcesanslf"      ""))
+                              'type-declaration)))
+ TeX-dialect)
+
+(defvar LaTeX-sourcesans-package-options
+  '("oldstyle" "osf"
+    "lining" "nf" "lf"
+    "tabular" "proportional"
+    "black" "semibold" "bold"
+    "light" "extralight"
+    "regular" "medium"
+    "scale" "scaled"
+    "default" "nosfdefault" "sfdefault"
+    "type1" "t1"
+    "opentype" "otf")
+  "Prompt for package options for the sourcesans package.")
+
+;;; sourcesans.el ends here
diff --git a/style/sourceserif.el b/style/sourceserif.el
new file mode 100644
index 00000000..6593e7fa
--- /dev/null
+++ b/style/sourceserif.el
@@ -0,0 +1,83 @@
+;;; sourceserif.el --- AUCTeX style for `sourceserif.sty' (v2.0)  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2026 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <[email protected]>
+;; Maintainer: [email protected]
+;; Created: 2026-03-08
+;; 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 `sourceserif.sty' (v2.0) from 2026-03-01.
+;; `sourceserif.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
+ "sourceserif"
+ (lambda ()
+
+   ;; Load "fontspec" with package options "opentype" or "otf":
+   (when (or (LaTeX-provided-package-options-member "sourceserif" "opentype")
+             (LaTeX-provided-package-options-member "sourceserif" 
"opentype=true")
+             (LaTeX-provided-package-options-member "sourceserif" "otf")
+             (LaTeX-provided-package-options-member "sourceserif" "otf=true"))
+     (TeX-run-style-hooks "fontspec"))
+
+   ;; The next set of macros is only available when package "fontspec"
+   ;; is loaded, by this style or by user.  We just check against
+   ;; "fontspec" and do not go through a check of `TeX-engine':
+   (when (member "fontspec" (TeX-style-list))
+     (TeX-add-symbols
+      '("sourceserif"        -1)
+      '("sourceseriflight"   -1)
+      '("sourceserifextreme" -1)
+      '("sourceseriflf"      -1)))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup)
+              (member "fontspec" (TeX-style-list)))
+     (font-latex-add-keywords '(("sourceserif"        "")
+                                ("sourceseriflight"   "")
+                                ("sourceserifextreme" "")
+                                ("sourceseriflf"      ""))
+                              'type-declaration)))
+ TeX-dialect)
+
+(defvar LaTeX-sourceserif-package-options
+  '("oldstyle" "osf"
+    "lining" "nf" "lf"
+    "tabular" "proportional"
+    "black" "semibold" "bold"
+    "light" "extralight"
+    "regular"
+    "scale" "scaled"
+    "default" "normdefault" "rmdefault"
+    "type1" "t1"
+    "opentype" "otf")
+  "Prompt for package options for the sourceserif package.")
+
+;;; sourceserif.el ends here

Reply via email to