[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 16e0a0cc 2/2: Add new style/xtab.el
From: |
Arash Esbati |
Subject: |
master 16e0a0cc 2/2: Add new style/xtab.el |
Date: |
Sun, 21 Jul 2024 15:53:51 -0400 (EDT) |
branch: master
commit 16e0a0cc499b7f2cb9e9139dce7a6abdba31ea36
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Add new style/xtab.el
* Makefile.in (STYLESRC): Add new style.
* NEWS.org (Added): Announce the new style.
* latex.el (LaTeX-indent-environment-list): Add environments
provided by the xtab.sty.
* style/xtab.el: New file.
---
Makefile.in | 2 +-
NEWS.org | 2 +-
latex.el | 5 ++++
style/xtab.el | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 85 insertions(+), 2 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 2cb9397a..8c29df7e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -201,7 +201,7 @@ STYLESRC = style/prosper.el \
style/changebar.el style/amsrefs.el style/standalone.el \
style/diagbox.el style/contract.el style/enotez.el \
style/authblk.el style/tabularray.el style/ninecolors.el \
- style/supertabular.el
+ style/xtab.el style/supertabular.el
STYLEELC = $(STYLESRC:.el=.elc)
diff --git a/NEWS.org b/NEWS.org
index a8335a22..2a27df2f 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -11,7 +11,7 @@
** Added
- Add new support files =style/authblk.el=, =style/ninecolors.el=,
- =style/supertabular.el= and =style/tabularray.el=.
+ =style/supertabular.el=, =style/tabularray.el= and =style/xtab.el=.
* [14.0.6] - 2024-06-30
diff --git a/latex.el b/latex.el
index e65dbdf9..76400178 100644
--- a/latex.el
+++ b/latex.el
@@ -4182,6 +4182,11 @@ consideration just as is in the non-commented source
code."
("+vmatrix" LaTeX-indent-tabular)
("+Vmatrix" LaTeX-indent-tabular)
("+cases" LaTeX-indent-tabular)
+ ;; envs of tabularray.sty
+ ("xtabular" LaTeX-indent-tabular)
+ ("xtabular*" LaTeX-indent-tabular)
+ ("mpxtabular" LaTeX-indent-tabular)
+ ("mpxtabular*" LaTeX-indent-tabular)
;; The following should have their own, smart indentation function.
;; Some other day.
("displaymath")
diff --git a/style/xtab.el b/style/xtab.el
new file mode 100644
index 00000000..f05e1c59
--- /dev/null
+++ b/style/xtab.el
@@ -0,0 +1,78 @@
+;;; xtab.el --- AUCTeX style for `xtab.sty' (v2.3f) -*- lexical-binding: t;
-*-
+
+;; Copyright (C) 2024 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2024-07-21
+;; 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 `xtab.sty' (v2.3f) from 2011/07/31.
+;; `xtab.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
+ "xtab"
+ (lambda ()
+
+ ;; Run the style hook for supertabular.el:
+ (TeX-run-style-hooks "supertabular")
+
+ (TeX-add-symbols
+ '("tablelasthead" t)
+ '("notablelasthead" 0)
+ '("xentrystretch" "Fraction"))
+
+ ;; Add the environments provided by the package:
+ (LaTeX-add-environments
+ '("xtabular" LaTeX-env-array)
+ '("xtabular*" LaTeX-env-array)
+ '("mpxtabular" LaTeX-env-array)
+ '("mpxtabular*" LaTeX-env-array))
+
+ ;; Append the environments to `LaTeX-item-list':
+ (dolist (env '("xtabular" "mpxtabular"))
+ (add-to-list 'LaTeX-item-list (cons env 'LaTeX-item-array) t)
+ (add-to-list 'LaTeX-item-list (cons (concat env "*") 'LaTeX-item-array)
t))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("notablelasthead" "")
+ ("xentrystretch" "{"))
+ 'function)
+ (font-latex-add-keywords '(("tablelasthead" "{"))
+ 'textual)))
+ TeX-dialect)
+
+(defvar LaTeX-xtab-package-options
+ '("errorshow" "pageshow" "debugshow")
+ "Package options for the xtab package.")
+
+;;; xtab.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 16e0a0cc 2/2: Add new style/xtab.el,
Arash Esbati <=