* xemacs-packages/auctex/style/Alegreya.el: New.
* xemacs-packages/auctex/style/AlegreyaSans.el: New.
* xemacs-packages/auctex/style/AnonymousPro.el: New.
* xemacs-packages/auctex/style/FiraMono.el: New.
* xemacs-packages/auctex/style/FiraSans.el: New.
* xemacs-packages/auctex/style/MyriadPro.el: New.
* xemacs-packages/auctex/style/XCharter.el: New.
* xemacs-packages/auctex/style/amsfonts.el: New.
* xemacs-packages/auctex/style/arabxetex.el: New.
* xemacs-packages/auctex/style/attachfile.el: New.
* xemacs-packages/auctex/style/australian.el: New.
* xemacs-packages/auctex/style/baskervaldx.el: New.
* xemacs-packages/auctex/style/bicaption.el: New.
* xemacs-packages/auctex/style/bidi.el: New.
* xemacs-packages/auctex/style/bidibeamer.el: New.
* xemacs-packages/auctex/style/breqn.el: New.
* xemacs-packages/auctex/style/canadian.el: New.
* xemacs-packages/auctex/style/caption.el: New.
* xemacs-packages/auctex/style/color.el: New.
* xemacs-packages/auctex/style/colortbl.el: New.
* xemacs-packages/auctex/style/commath.el: New.
* xemacs-packages/auctex/style/currvita.el: New.
* xemacs-packages/auctex/style/dcolumn.el: New.
* xemacs-packages/auctex/style/empheq.el: New.
* xemacs-packages/auctex/style/enumitem.el: New.
* xemacs-packages/auctex/style/environ.el: New.
* xemacs-packages/auctex/style/erewhon.el: New.
* xemacs-packages/auctex/style/eso-pic.el: New.
* xemacs-packages/auctex/style/exam.el: New.
* xemacs-packages/auctex/style/expl3.el: New.
* xemacs-packages/auctex/style/fbb.el: New.
* xemacs-packages/auctex/style/floatrow.el: New.
* xemacs-packages/auctex/style/fontaxes.el: New.
* xemacs-packages/auctex/style/fontenc.el: New.
* xemacs-packages/auctex/style/framed.el: New.
* xemacs-packages/auctex/style/fvextra.el: New.
* xemacs-packages/auctex/style/geometry.el: New.
* xemacs-packages/auctex/style/gloss-italian.el: New.
* xemacs-packages/auctex/style/hologo.el: New.
* xemacs-packages/auctex/style/ifluatex.el: New.
* xemacs-packages/auctex/style/jsreport.el: New.
* xemacs-packages/auctex/style/ltablex.el: New.
* xemacs-packages/auctex/style/ltxtable.el: New.
* xemacs-packages/auctex/style/luatextra.el: New.
* xemacs-packages/auctex/style/mdframed.el: New.
* xemacs-packages/auctex/style/mdsymbol.el: New.
* xemacs-packages/auctex/style/menukeys.el: New.
* xemacs-packages/auctex/style/minted.el: New.
* xemacs-packages/auctex/style/mn2e.el: New.
* xemacs-packages/auctex/style/mnras.el: New.
* xemacs-packages/auctex/style/moodle.el: New.
* xemacs-packages/auctex/style/newfloat.el: New.
* xemacs-packages/auctex/style/newpxmath.el: New.
* xemacs-packages/auctex/style/newpxtext.el: New.
* xemacs-packages/auctex/style/newtxmath.el: New.
* xemacs-packages/auctex/style/newtxsf.el: New.
* xemacs-packages/auctex/style/newtxtext.el: New.
* xemacs-packages/auctex/style/newtxttt.el: New.
* xemacs-packages/auctex/style/newzealand.el: New.
* xemacs-packages/auctex/style/ntheorem.el: New.
* xemacs-packages/auctex/style/paracol.el: New.
* xemacs-packages/auctex/style/pdflscape.el: New.
* xemacs-packages/auctex/style/pdfpages.el: New.
* xemacs-packages/auctex/style/polyglossia.el: New.
* xemacs-packages/auctex/style/preview.el: New.
* xemacs-packages/auctex/style/relsize.el: New.
* xemacs-packages/auctex/style/sourcecodepro.el: New.
* xemacs-packages/auctex/style/splitidx.el: New.
* xemacs-packages/auctex/style/subcaption.el: New.
* xemacs-packages/auctex/style/subfiles.el: New.
* xemacs-packages/auctex/style/tarticle.el: New.
* xemacs-packages/auctex/style/tbook.el: New.
* xemacs-packages/auctex/style/tcolorbox.el: New.
* xemacs-packages/auctex/style/tcolorboxlib-raster.el: New.
* xemacs-packages/auctex/style/textcomp.el: New.
* xemacs-packages/auctex/style/textpos.el: New.
* xemacs-packages/auctex/style/theorem.el: New.
* xemacs-packages/auctex/style/tikz.el: New.
* xemacs-packages/auctex/style/titleps.el: New.
* xemacs-packages/auctex/style/titlesec.el: New.
* xemacs-packages/auctex/style/titletoc.el: New.
* xemacs-packages/auctex/style/transparent.el: New.
* xemacs-packages/auctex/style/treport.el: New.
* xemacs-packages/auctex/style/vwcol.el: New.
* xemacs-packages/auctex/style/wrapfig.el: New.
* xemacs-packages/auctex/style/xcolor.el: New.
* xemacs-packages/auctex/style/xltabular.el: New.
* xemacs-packages/auctex/style/zlmtt.el: New.
Signed-off-by: Steve Youngs <steve@sxemacs.org>
--- /dev/null
+;;; Alegreya.el --- AUCTeX style for `Alegreya.sty' (v2015/10/22)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-09-12
+;; 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 `Alegreya.sty' (v2015/10/22).
+;; `Alegreya.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "Alegreya"
+ (lambda ()
+
+ ;; Run style hook for packages loaded by Alegreya
+ (TeX-run-style-hooks "textcomp")
+
+ ;; Load `fontaxes' or `fontspec' dep. on `type1' option:
+ (if (or (LaTeX-provided-package-options-member "Alegreya" "type1")
+ (LaTeX-provided-package-options-member "Alegreya" "type1=true"))
+ (TeX-run-style-hooks "fontaxes")
+ (TeX-run-style-hooks "fontspec"))
+
+ (TeX-add-symbols
+ ;; Should be used in preamble only
+ '("useosf")
+ ;; Text commands
+ '("Alegreya" -1)
+ '("AlegreyaBlack" -1)
+ '("AlegreyaLF" -1)
+ '("AlegreyaOsF" -1)
+ '("AlegreyaTLF" -1)
+ '("AlegreyaTOsF" -1)
+ '("textsu" t) ; superior figures
+ '("sufigures" -1) ;
+ '("textin" t) ; inferior figures
+ '("infigures" -1))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("textsu" "{")
+ ("textin" "{"))
+ 'type-command)
+ (font-latex-add-keywords '(("Alegreya" "")
+ ("AlegreyaBlack" "")
+ ("AlegreyaLF" "")
+ ("AlegreyaOsF" "")
+ ("AlegreyaTLF" "")
+ ("AlegreyaTOsF" "")
+ ("sufigures" "")
+ ("infigures" ""))
+ 'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-Alegreya-package-options-list
+ '(("lining" ("true" "false"))
+ ("lf" ("true" "false"))
+ ("oldstyle" ("true" "false"))
+ ("osf" ("true" "false"))
+ ("tabular" ("true" "false"))
+ ("tf" ("true" "false"))
+ ("proportional" ("true" "false"))
+ ("pf" ("true" "false"))
+ ("black" ("true" "false"))
+ ("type1" ("true" "false"))
+ ("scaled")
+ ("scale"))
+ "Package options for the Alegreya package.")
+
+(defun LaTeX-Alegreya-package-options ()
+ "Prompt for package options for the Alegreya package."
+ (TeX-read-key-val t LaTeX-Alegreya-package-options-list))
+
+;;; Alegreya.el ends here
--- /dev/null
+;;; AlegreyaSans.el --- AUCTeX style for `AlegreyaSans.sty' (v2015/10/22)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-09-12
+;; 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 `AlegreyaSans.sty' (v2015/10/22).
+;; `AlegreyaSans.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "AlegreyaSans"
+ (lambda ()
+
+ ;; Run style hook for packages loaded by AlegreyaSans
+ (TeX-run-style-hooks "textcomp")
+
+ ;; Load `fontaxes' or `fontspec' dep. on `type1' option:
+ (if (or (LaTeX-provided-package-options-member "AlegreyaSans" "type1")
+ (LaTeX-provided-package-options-member "AlegreyaSans" "type1=true"))
+ (TeX-run-style-hooks "fontaxes")
+ (TeX-run-style-hooks "fontspec"))
+
+ (TeX-add-symbols
+ ;; Should be used in preamble only
+ '("useosf")
+ ;; Text commands
+ '("AlegreyaSans" -1)
+ '("AlegreyaSansLF" -1)
+ '("AlegreyaSansOsF" -1)
+ '("AlegreyaSansTLF" -1)
+ '("AlegreyaSansTOsF" -1)
+ '("AlegreyaSansThin" -1)
+ '("AlegreyaSansLight" -1)
+ '("AlegreyaSansMedium" -1)
+ '("AlegreyaSansExtraBold" -1)
+ '("AlegreyaSansBlack" -1)
+ '("textsu" t) ; superior figures
+ '("sufigures" -1) ;
+ '("textin" t) ; inferior figures
+ '("infigures" -1))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("textsu" "{")
+ ("textin" "{"))
+ 'type-command)
+ (font-latex-add-keywords '(("AlegreyaSans" "")
+ ("AlegreyaSansLF" "")
+ ("AlegreyaSansOsF" "")
+ ("AlegreyaSansTLF" "")
+ ("AlegreyaSansTOsF" "")
+ ("AlegreyaSansLight" "")
+ ("AlegreyaSansMedium" "")
+ ("AlegreyaSansExtraBold" "")
+ ("AlegreyaSansBlack" "")
+ ("sufigures" "")
+ ("infigures" ""))
+ 'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-AlegreyaSans-package-options-list
+ '(("lining" ("true" "false"))
+ ("lf" ("true" "false"))
+ ("oldstyle" ("true" "false"))
+ ("osf" ("true" "false"))
+ ("tabular" ("true" "false"))
+ ("tf" ("true" "false"))
+ ("proportional" ("true" "false"))
+ ("pf" ("true" "false"))
+ ("black" ("true" "false"))
+ ("extrabold" ("true" "false"))
+ ("thin" ("true" "false"))
+ ("light" ("true" "false"))
+ ("medium" ("true" "false"))
+ ("type1" ("true" "false"))
+ ("sfdefault" ("true" "false"))
+ ("scaled")
+ ("scale"))
+ "Package options for the AlegreyaSans package.")
+
+(defun LaTeX-AlegreyaSans-package-options ()
+ "Prompt for package options for the AlegreyaSans package."
+ (TeX-read-key-val t LaTeX-AlegreyaSans-package-options-list))
+
+;;; AlegreyaSans.el ends here
--- /dev/null
+;;; AnonymousPro.el --- AUCTeX style for `AnonymousPro.sty' (v2.1)
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-10-30
+;; 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 `AnonymousPro.sty' (v2.1) from
+;; 2014/03/22. `AnonymousPro.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "AnonymousPro"
+ (lambda ()
+
+ ;; Run style hook for textcomp
+ (TeX-run-style-hooks "textcomp")
+
+ ;; New symbols
+ (TeX-add-symbols
+ "ANPapplelogo"
+ "ANPappleopen"
+ "ANPapproxequal"
+ "ANPback"
+ "ANPblackdiamond"
+ "ANPcheckmark"
+ "ANPcopy"
+ "ANPellipsis"
+ "ANPendtab"
+ "ANPerasetotheright"
+ "ANPgreaterequal"
+ "ANPHbar"
+ "ANPhbar"
+ "ANPinfinity"
+ "ANPinsert"
+ "ANPintegral"
+ "ANPlessequal"
+ "ANPlozenge"
+ "ANPnotequal"
+ "ANPoptionkey"
+ "ANPpartialdiff"
+ "ANPPi"
+ "ANPpi"
+ "ANPproduct"
+ "ANPshift"
+ "ANPshiftlock"
+ "ANPSigma"
+ "ANPsigma"
+ "ANPsigmaone"
+ "ANPsummation"
+ "ANPtab"
+ "ANPReturnSign"
+ "ANPShoulderedOpenBox"
+ "ANPUpArrowHead"
+ "ANPInsertSign"
+ "ANPUpArrowHeadBars"
+ "ANPHelm"
+ "ANPOpenBox"
+ "ANPDelta"
+ "ANPverticaltab"
+ "ANPNumeroSign"))
+ LaTeX-dialect)
+
+(defvar LaTeX-AnonymousPro-package-options
+ '("ttdefault" "scale")
+ "Package options for the AnonymousPro package.")
+
+;;; AnonymousPro.el ends here
--- /dev/null
+;;; FiraMono.el --- AUCTeX style for `FiraMono.sty' (v2016/02/13)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-11-11
+;; 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 `FiraMono.sty' (v2016/02/13).
+;; `FiraMono.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "FiraMono"
+ (lambda ()
+
+ ;; `textcomp' is always loaded:
+ (TeX-run-style-hooks "textcomp")
+
+ ;; If package option `type1' is given, load `fontaxes':
+ (when (LaTeX-provided-package-options-member "FiraMono" "type1")
+ (TeX-run-style-hooks "fontaxes"))
+
+ ;; Macros:
+ (TeX-add-symbols
+ '("sufigures" -1)
+ '("firamonooldstyle" -1)
+ '("firamonolining" -1)
+ '("firamonomedium" -1))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("sufigures" "")
+ ("firamonooldstyle" "")
+ ("firamonolining" "")
+ ("firamonomedium" ""))
+ 'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-FiraMono-package-options '("scaled" "scale"
+ "type1"
+ "lining" "lf"
+ "oldstyle" "osf"
+ "nomap"
+ "medium" "mb")
+ "Package options for the FiraMono package.")
+
+;;; FiraMono.el ends here
--- /dev/null
+;;; FiraSans.el --- AUCTeX style for `FiraSans.sty' (v2016/11/20)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-11-11
+;; 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 `FiraSans.sty' (v2016/11/20).
+;; `FiraSans.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "FiraSans"
+ (lambda ()
+
+ ;; `textcomp' is always loaded:
+ (TeX-run-style-hooks "textcomp")
+
+ ;; If package option `type1' is given, load `fontaxes':
+ (when (LaTeX-provided-package-options-member "FiraSans" "type1")
+ (TeX-run-style-hooks "fontaxes"))
+
+ ;; Macros:
+ (TeX-add-symbols
+ '("sufigures" -1)
+ '("firaoldstyle" -1)
+ '("firalining" -1)
+ '("firatabular" -1)
+ '("firaproportional" -1)
+ '("firathin" -1)
+ '("firalight" -1)
+ '("firaextralight" -1)
+ '("firaultralight" -1)
+ '("firamedium" -1)
+ '("firabook" -1)
+ '("firasemibold" -1)
+ '("firaextrabold" -1)
+ '("firaheavy" -1))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("sufigures" "")
+ ("firaoldstyle" "")
+ ("firalining" "")
+ ("firatabular" "")
+ ("firaproportional" "")
+ ("firathin" "")
+ ("firalight" "")
+ ("firaextralight" "")
+ ("firaultralight" "")
+ ("firamedium" "")
+ ("firabook" "")
+ ("firasemibold" "")
+ ("firaextrabold" "")
+ ("firaheavy" ""))
+ 'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-FiraSans-package-options
+ '("scaled" "scale"
+ "type1"
+ "lining" "lf"
+ "oldstyle" "osf"
+ "tabular" "t"
+ "proportional" "p"
+ "book"
+ "medium" "mb"
+ "semibold" "sb"
+ "light" "l"
+ "extralight"
+ "ultralight"
+ "thin"
+ "extrabold"
+ "heavy"
+ "default"
+ "sfdefault")
+ "Package options for the FiraSans package.")
+
+;;; FiraSans.el ends here
--- /dev/null
+;;; MyriadPro.el --- AUCTeX style for `MyriadPro.sty' (v0.5)
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-10-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 `MyriadPro.sty' (v0.5) from 2013/04/20.
+;; The latest version of MyriadPro is available as part of FontPro
+;; bundle from <https://www.github.com/sebschub>. `MyriadPro.sty' is
+;; not part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "MyriadPro"
+ (lambda ()
+
+ ;; Run style hook for various packages loaded by MyriadPro
+ (TeX-run-style-hooks "textcomp" "amsmath" "fontaxes" "mdsymbol")
+
+ ;; New symbols
+ (TeX-add-symbols
+ '("smallfrac" "Numerator" "Denominator")
+ '("slantfrac" "Numerator" "Denominator")
+ '("boldsymbol" "Symbol"))
+
+ ;; More control over spacing in `\slantfrac':
+ (LaTeX-add-lengths "MdSlantfracSpacingBeforeSlash"
+ "MdSlantfracSpacingAfterSlash")
+
+ ;; `\mathversion' is available with sansmath option
+ (when (LaTeX-provided-package-options-member "MyriadPro" "sansmath")
+ (TeX-add-symbols
+ '("mathversion"
+ (TeX-arg-eval completing-read "Math version: "
+ '(("sans") ("sansbold")
+ ("sanstabular") ("sansboldtabular"))))))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("smallfrac" "{{")
+ ("slantfrac" "{{"))
+ 'textual)
+ (font-latex-add-keywords '(("mathversion" "{"))
+ 'variable)))
+ LaTeX-dialect)
+
+(defvar LaTeX-MyriadPro-package-options
+ '(;; Font selection
+ "smallfamily" "medfamily" "onlytext" "onlymath" "math" "sansmath"
+
+ ;; Figure selection
+ "textosf" "mathosf" "osf" "textlf" "mathlf" "lf" "mathtabular"
+
+ ;; Calligraphic fonts
+ "cmsy" "swash" "abx"
+
+ ;; Blackboard bold letters
+ "amsbb" "fourierbb" "lucidabb"
+
+ ;; Greek letters
+ "mixedgreek" "italicgreek" "frenchmath"
+
+ ;; Miscellaneous options
+ "scale" "loosequotes" "footnotefigures"
+
+ ;; Additional mathversions
+ "sansmath")
+ "Package options for the MyriadPro package.")
+
+;;; MyriadPro.el ends here
--- /dev/null
+;;; XCharter.el --- AUCTeX style for `XCharter.sty' (v1.094)
+
+;; Copyright (C) 2014, 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-10-30
+;; 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 `XCharter.sty' (v1.094) from 2017/08/08.
+;; `XCharter.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "XCharter"
+ (lambda ()
+
+ ;; Run style hook for various packages loaded by XCharter
+ (TeX-run-style-hooks "textcomp" "fontaxes")
+
+ ;; New symbols
+ (TeX-add-symbols
+
+ ;; Only preamble commands
+ '("useosf" 0)
+ '("useosfI" 0)
+
+ ;; Text commands
+ '("textsu" t) ; superior figures
+ '("sustyle" -1) ;
+ '("textin" t) ; inferior figures
+ '("instyle" -1) ;
+ '("textlf" t) ; lining figures
+ '("lfstyle" -1) ;
+ '("textosf" t) ; oldstyle figures
+ '("textosfI" t) ; oldstyle figures alternate
+ '("osfstyle" -1) ; whatever oldstyle option is in force
+ '("textnumerator" t) ; numerators
+ '("textnu" t) ;
+ '("textdenominator" t) ; denominators
+ '("textde" t) ;
+ '("textfrac" 2))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("textsu" "{")
+ ("textin" "{")
+ ("textlf" "{")
+ ("textosf" "{")
+ ("textosfI" "{")
+ ("textnumerator" "{")
+ ("textnu" "{")
+ ("textdenominator" "{")
+ ("textde" "{")
+ ("textfrac" "{{"))
+ 'type-command)
+ (font-latex-add-keywords '(("sustyle" "")
+ ("instyle" "")
+ ("lfstyle" "")
+ ("osfstyle" ""))
+ 'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-XCharter-package-options
+ '("lining" "lf" "oldstyle" "osf" "oldstyleI" "osfI"
+ "scaled" "sups" "scosf")
+ "Package options for the XCharter package.")
+
+;;; XCharter.el ends here
--- /dev/null
+;;; amsfonts.el --- AUCTeX style for `amsfonts.sty' version 3.01
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Maintainer: auctex-devel@gnu.org
+;; Author: Mosè Giordano <mose@gnu.org>
+;; 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 `amsfonts.sty' version 3.01.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "amsfonts"
+ (lambda ()
+ (TeX-add-symbols
+ '("bold" 1))
+ ;; New math font by `amsfonts'.
+ (setq TeX-font-list
+ (append
+ TeX-font-list
+ '((?\C-k "" "" "\\mathfrak{" "}"))))
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("bold" "{"))
+ 'bold-command)))
+ LaTeX-dialect)
+
+;; The `psamsfonts' option is obsolete in AMSFonts v3
+(defvar LaTeX-amsfonts-package-options nil
+ "Package options for the amsfonts package.")
+
+;;; amsfonts.el ends here.
--- /dev/null
+;;; arabxetex.el --- AUCTeX style for `arabxetex.sty' (v1.2.1)
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-08-12
+;; 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 `arabxetex.sty' (v1.2.1) from 2015/09/04.
+;; `arabxetex.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "arabxetex"
+ (lambda ()
+
+ ;; Run the style hooks for packages required by arabxetex:
+ (TeX-run-style-hooks "amsmath" "fontspec" "bidi")
+
+ ;; We need xelatex, so check for the engine here:
+ (TeX-check-engine-add-engines 'xetex)
+
+ ;; New macros & environments:
+ (let ((langs '("arab"
+ "farsi" "persian"
+ "urdu"
+ "sindhi"
+ "pashto"
+ "ottoman" "turk"
+ "kurdisch"
+ "kashmiri"
+ "malay" "jawi"
+ "uighur")))
+ ;; Add \text<language>[option]{...}
+ (mapc #'TeX-add-symbols
+ (mapcar
+ (lambda (symbol)
+ (list symbol
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Mode")
+ LaTeX-arabxetex-package-options ]
+ t))
+ (mapcar (lambda (lang) (concat "text" lang)) langs)))
+ ;;
+ ;; Add \begin{<language>}[option] ... \end{<language>}
+ (mapc #'LaTeX-add-environments
+ (mapcar
+ (lambda (environment)
+ (list environment
+ #'LaTeX-env-args
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Mode")
+ LaTeX-arabxetex-package-options ]))
+ langs))
+ ;;
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords (mapcar (lambda (lang)
+ (list (concat "text" lang) "[{"))
+ langs)
+ 'textual)))
+
+ ;; Other macros:
+ (TeX-add-symbols
+ '("textLR" t)
+ '("aemph" t)
+
+ ;; 3.3 Transliteration
+ '("SetTranslitConvention"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Mapping")
+ '("dmg" "loc")))
+ '("SetTranslitStyle" "Style"))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("textLR" "{"))
+ 'textual)
+ (font-latex-add-keywords '(("aemph" "{"))
+ 'italic-command)
+ (font-latex-add-keywords '(("SetTranslitConvention" "{")
+ ("SetTranslitStyle" "{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-arabxetex-package-options
+ '("novoc" "voc" "fullvoc" "trans" "utf")
+ "Package options for the arabxetex package.")
+
+;;; arabxetex.el ends here
--- /dev/null
+;;; attachfile.el --- AUCTeX style for `attachfile.sty' (v1.6)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-04-11
+;; 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 `attachfile.sty' (v1.6) from 2015/04/04.
+;; `attachfile.sty' is part of TeXLive.
+
+;;; Code:
+(defvar LaTeX-attachfile-key-val-options
+ '(("appearance" ("true" "false"))
+ ("author")
+ ("color")
+ ("created")
+ ("date")
+ ("description")
+ ("icon" ("Graph" "Paperclip" "PushPin" "Tag"))
+ ;; This can only be a small excerpt:
+ ("mimetype"
+ ("application/javascript"
+ "application/pdf"
+ "application/postscript"
+ "application/vnd.ms-excel"
+ "application/vnd.ms-powerpoint"
+ "application/zip"
+ "audio/mpeg"
+ "audio/ogg"
+ "image/jpeg"
+ "image/png"
+ "image/tiff"
+ "text/csv"
+ "text/plain"
+ "video/H264"
+ "video/mp4"))
+ ("modified")
+ ("print" ("true" "false"))
+ ("size")
+ ("subject")
+ ("timezone")
+ ("zoom" ("true" "false")))
+ "Key=value options for attachfile macros.")
+
+(TeX-add-style-hook
+ "attachfile"
+ (lambda ()
+ ;; Run style hook for packages loaded by attachfile; both packages
+ ;; are required for running LaTeX, but not necessary within AUCTeX
+ (TeX-run-style-hooks "hyperref" "color")
+
+ (TeX-add-symbols
+ ;; \attachfile[<options>]{<filename>}
+ '("attachfile"
+ [TeX-arg-key-val LaTeX-attachfile-key-val-options]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((atfi (file-relative-name
+ (read-file-name "File to attach: "))))
+ (format "%s" atfi)))))
+
+ ;; \noattachfile[<options>]
+ '("noattachfile"
+ [TeX-arg-key-val LaTeX-attachfile-key-val-options] )
+
+ ;; \textattachfile[<options>]{<filename>}{<text>}
+ '("textattachfile"
+ [TeX-arg-key-val LaTeX-attachfile-key-val-options]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((atfi (file-relative-name
+ (read-file-name "File to attach: "))))
+ (format "%s" atfi))))
+ t)
+
+ ;; \notextattachfile[<options>]{<text>}
+ '("notextattachfile"
+ [TeX-arg-key-val LaTeX-attachfile-key-val-options] t)
+
+ ;; \attachfilesetup{<options>}
+ '("attachfilesetup"
+ (TeX-arg-key-val LaTeX-attachfile-key-val-options)))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("attachfilesetup" "{")
+ ("attachfile" "[{")
+ ("noattachfile" "[")
+ ("textattachfile" "[{{")
+ ("notextattachfile" "[{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-attachfile-package-options nil
+ "Prompt for package options for the attachfile package.")
+
+;;; attachfile.el ends here
--- /dev/null
+;;; australian.el --- AUCTeX style for the `australian' babel option.
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-07-02
+;; 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:
+
+;; Set up AUCTeX for editing Australian text in connection with the
+;; `australian' babel option.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "australian"
+ (lambda ()
+ (TeX-run-style-hooks "english"))
+ LaTeX-dialect)
+
+;;; australian.el ends here
--- /dev/null
+;;; baskervaldx.el --- AUCTeX style for `baskervaldx.sty' (v1.07)
+
+;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-11-18
+;; 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 `baskervaldx.sty' (v1.07) from 2015/04/06.
+;; `baskervaldx.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "baskervaldx"
+ (lambda ()
+
+ ;; Run style hook for various packages loaded by baskervaldx
+ (TeX-run-style-hooks "textcomp" "fontaxes")
+
+ ;; New symbols
+ (TeX-add-symbols
+
+ ;; Only preamble commands
+ '("useosf" 0)
+
+ ;; Text commands
+ '("lfstyle" -1) ; lf declaration
+ '("tlfstyle" -1) ; tlf declaration
+ '("osfstyle" -1) ; osf declaration
+ '("tosfstyle" -1) ; tosf declaration
+ '("sufigures" -1) ; superior figures declaration
+ '("textlf" t) ; proportional lining figures
+ '("texttlf" t) ; tabular lining figures
+ '("textosf" t) ; proportional oldstyle figures
+ '("texttosf" t) ; tabular oldstyle figures
+ '("textsu" t) ; superior figures
+ '("swshape" -1)) ; italic shape with ligatures activated
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("textlf" "{")
+ ("texttlf" "{")
+ ("textosf" "{")
+ ("texttosf" "{")
+ ("textsu" "{"))
+ 'type-command)
+ (font-latex-add-keywords '(("lfstyle" "")
+ ("tlfstyle" "")
+ ("osfstyle" "")
+ ("tosfstyle" "")
+ ("sufigures" ""))
+ 'type-declaration)
+ (font-latex-add-keywords '(("swshape" ""))
+ 'bold-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-baskervaldx-package-options
+ '("lining" "lf" "oldstyle" "osf" "tabular" "proportional" "p"
+ "scale" "scaled" "sups" "swash")
+ "Package options for the baskervaldx package.")
+
+;;; baskervaldx.el ends here
--- /dev/null
+;;; bicaption.el --- AUCTeX style for `bicaption.sty' (v1.1-158)
+
+;; Copyright (C) 2016, 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-11-11
+;; 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 `bicaption.sty' (v1.1-158) from
+;; 2016/03/27. `bicaption.sty' is part of TeXLive.
+
+;; If things do not work or when in doubt, press `C-c C-n'. Comments
+;; for improvement are welcome.
+
+;;; Code:
+
+(defvar LaTeX-bicaption-key-val-options
+ '(("bi-lang" ("first" "second" "both"))
+ ("bi-singlelinecheck" ("false" "no" "off" "0" "true" "yes" "on" "1"))
+ ("bi-slc" ("false" "no" "off" "0" "true" "yes" "on" "1"))
+ ("bi-swap" ("false" "no" "off" "0" "true" "yes" "on" "1"))
+ ("listtype+"))
+ "Key=value options for bicaption macros.")
+
+(defun LaTeX-arg-bicaption-bicaption (optional &optional prompt star cap-box label-inside)
+ "Query for the arguments of \"\\bicaption\" incl. a label and insert them.
+PROMPT replaces the standard one. If STAR is non-nil, then do
+not query for a \\label and short captions, insert only captions.
+If CAP-BOX is non-nil, also query and include optional arguments
+for the box command. If LABEL-INSIDE is non-nil, insert \\label
+inside the first mandatory argument, otherwise after all
+arguments."
+ (let* (;; \bisubcaption needs an environment, "minipage" will be
+ ;; popular. If so, check next higher environment to find out
+ ;; where we are
+ (currenv (if (string= (LaTeX-current-environment) "minipage")
+ (LaTeX-current-environment 2)
+ (LaTeX-current-environment)))
+ (captionI (TeX-read-string
+ (TeX-argument-prompt
+ optional (when prompt
+ (concat "1. " prompt "bicaption"))
+ "1. bicaption")))
+ (short-captionI
+ (when (and (not star)
+ (>= (length captionI) LaTeX-short-caption-prompt-length))
+ (TeX-read-string
+ (TeX-argument-prompt t (when prompt
+ (concat "Short 1. " prompt "bicaption"))
+ "Short 1. bicaption"))))
+ (captionII (TeX-read-string
+ (TeX-argument-prompt
+ optional (when prompt
+ (concat "2. " prompt "bicaption"))
+ "2. bicaption")))
+ (short-captionII
+ (when (and (not star)
+ (>= (length captionII) LaTeX-short-caption-prompt-length))
+ (TeX-read-string
+ (TeX-argument-prompt t (when prompt
+ (concat "Short 2. " prompt "bicaption"))
+ "Short 2. bicaption")))))
+ (indent-according-to-mode)
+ ;; Insert short & regular 1. caption
+ (when (and short-captionI (not (string= short-captionI "")))
+ (insert LaTeX-optop short-captionI LaTeX-optcl))
+ (insert TeX-grop captionI)
+ ;; For \bi(sub)?captionbox, the label must be inserted here
+ (when (and label-inside (not star))
+ (LaTeX-label currenv 'environment))
+ (insert TeX-grcl)
+ (LaTeX-fill-paragraph)
+ (LaTeX-newline)
+ (indent-according-to-mode)
+ ;; Insert short & regular 2. caption
+ (when (and short-captionII (not (string= short-captionII "")))
+ (insert LaTeX-optop short-captionII LaTeX-optcl))
+ (insert TeX-grop captionII TeX-grcl)
+ ;; Insert width & pos in case of captionbox macros:
+ (when cap-box
+ (let* ((TeX-arg-opening-brace "[")
+ (TeX-arg-closing-brace "]")
+ (width (completing-read (TeX-argument-prompt t nil "Width")
+ (mapcar (lambda (elt) (concat TeX-esc (car elt)))
+ (LaTeX-length-list))))
+ (inpos (if (and width (not (string-equal width "")))
+ (completing-read (TeX-argument-prompt t nil "Inner position")
+ '("c" "l" "r" "s"))
+ "")))
+ (TeX-argument-insert width t)
+ (TeX-argument-insert inpos t)))
+ (LaTeX-fill-paragraph)
+ ;; Insert label -- a new line is inserted only if label is there:
+ (when (and (not label-inside) (not star)
+ (save-excursion (LaTeX-label currenv 'environment)))
+ (LaTeX-newline)
+ (indent-according-to-mode)
+ (end-of-line))))
+
+(defun LaTeX-arg-bicaption-captionsetup (optional)
+ "Query for 2 arguments for \"\\captionsetup\" with bicaption.sty loaded.
+When OPTIONAL is non-nil, include both as optional arguments in
+square brackets."
+ (let* ((flttype (completing-read (TeX-argument-prompt optional nil "Float type")
+ LaTeX-caption-supported-float-types))
+ (biflt (if (and (not (or (string= flttype "bi")
+ (string= flttype "bi-first")
+ (string= flttype "bi-second")))
+ flttype (not (string= flttype "")))
+ (completing-read (TeX-argument-prompt optional nil "Bicaption type")
+ '("bi" "bi-first" "bi-second"))
+ "")))
+ (TeX-argument-insert flttype optional)
+ (TeX-argument-insert biflt optional)))
+
+(TeX-add-style-hook
+ "bicaption"
+ (lambda ()
+
+ ;; Load caption.el:
+ (TeX-run-style-hooks "caption")
+
+ ;; Macros
+ (TeX-add-symbols
+ '("bicaption" (LaTeX-arg-bicaption-bicaption))
+ '("bicaption*" (LaTeX-arg-bicaption-bicaption nil t))
+ '("bicaptionbox" (LaTeX-arg-bicaption-bicaption nil nil t t) t)
+ '("bicaptionbox*" (LaTeX-arg-bicaption-bicaption nil t t) t)
+ '("bisubcaption" (LaTeX-arg-bicaption-bicaption "sub-"))
+ '("bisubcaption*" (LaTeX-arg-bicaption-bicaption "sub-" t))
+ '("bisubcaptionbox" (LaTeX-arg-bicaption-bicaption "sub-" nil t t) t)
+ '("bisubcaptionbox*" (LaTeX-arg-bicaption-bicaption "sub-" t t t) t))
+
+ ;; \bi(sub)?caption(box)? macros should get their own lines
+ (LaTeX-paragraph-commands-add-locally '("bicaption" "bicaptionbox"
+ "bisubcaption" "bisubcaptionbox"))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("bicaption" "*[{[{")
+ ("bicaptionbox" "*[{[{[[")
+ ("bisubcaption" "*[{[{")
+ ("bisubcaptionbox" "*[{[{[["))
+ 'textual)))
+ LaTeX-dialect)
+
+(defun LaTeX-bicaption-package-options ()
+ "Prompt for package options for the bicaption package."
+ (TeX-read-key-val t
+ (append
+ `(,(list "language"
+ (cond ((and (member "babel" (TeX-style-list))
+ (LaTeX-babel-active-languages))
+ (butlast (LaTeX-babel-active-languages)))
+ ((and (member "polyglossia" (TeX-style-list))
+ (LaTeX-polyglossia-active-languages))
+ (butlast (LaTeX-babel-active-languages)))
+ (t nil))))
+ LaTeX-bicaption-key-val-options
+ LaTeX-caption-key-val-options)))
+
+;;; bicaption.el ends here
--- /dev/null
+;;; bidi.el --- AUCTeX style for the (XeLaTeX) bidi package
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Uwe Brauer <oub@mat.ucm.es>
+;; Created: 2016-03-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 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 bidi package.
+
+;;; Code:
+
+(defvar LaTeX-bidi-package-options '("RTLdocument" "rldocument")
+ "Package options for the bidi package.")
+
+(TeX-add-style-hook
+ "bidi"
+ (lambda ()
+ (TeX-check-engine-add-engines 'xetex)
+ (LaTeX-add-environments
+ "LTR"
+ "RTL")
+ ;; Fontification
+ (TeX-add-symbols
+ '("setRL" 0)
+ '("unsetRL" 0)
+ '("setRTL" 0)
+ '("unsetRTL" 0)
+ '("setLR" 0)
+ '("unsetLR" 0)
+ '("setLTR" 0)
+ '("unsetLTR" 0)
+ '("LR" 1)
+ '("LRE" 1)
+ '("RLE" 1)
+ '("RL" 1)))
+ LaTeX-dialect)
+
+
+;;; bidi.el ends here
--- /dev/null
+;;; bidibeamer.el --- AUCTeX style for the bidibeamer class
+
+;; Copyright (C) 2015 Free Software Foundation
+
+;; Author: Tassilo Horn <tsdh@gnu.org>
+;; Created: 2015-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 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 bidibeamer class which offers the same
+;; functionality and interface as latex-beamer, so we simply call the style
+;; hook of the latter.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "bidibeamer"
+ (lambda ()
+ (TeX-run-style-hooks "beamer"))
+ LaTeX-dialect)
+
+;;; bidibeamer.el ends here
--- /dev/null
+;;; breqn.el --- AUCTeX style for `breqn.sty' (v0.98e)
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-01-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 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 `breqn.sty' (v0.98e) from 2017/01/27.
+;; `breqn.sty' is part of TeXLive.
+
+;; In breqn documentation, there is the following statement:
+;;
+;; 9 Various environment options
+;;
+;; Use of the normal \label command instead of the label option
+;; works, I think, most of the time (untested).
+;;
+;; To be on the safe side, a label should be written in the optional
+;; argument of an environment as value to the `label' key, e.g.:
+;;
+;; \begin{dmath}[label={eq:42}]
+;; ...
+;; \end{dmath}
+;;
+;; This style achieves this requirement by using the function
+;; `LaTeX-env-label-as-keyval'.
+
+;;; Code:
+
+(defvar LaTeX-breqn-key-val-options
+ '(("style" ("\\tiny" "\\scriptsize" "\\footnotesize" "\\small"
+ "\\normalsize" "\\large" "\\Large" "\\LARGE"
+ "\\huge" "\\Huge"))
+ ("number")
+ ("indentstep")
+ ("compact")
+ ("spread")
+ ("frame")
+ ("framesep")
+ ("background")
+ ("color")
+ ("breakdepth"))
+ "Key=value options for breqn environments.
+The keys \"label\" and \"labelprefix\" are omitted.")
+
+(defvar LaTeX-breqn-key-val-options-local nil
+ "Buffer-local key=value options for breqn environments.")
+(make-variable-buffer-local 'LaTeX-breqn-key-val-options-local)
+
+(defvar LaTeX-breqn-key-val-label-regexp
+ `(,(concat
+ "\\\\begin{"
+ (regexp-opt '("dmath" "dseries" "dgroup" "darray"))
+ "}"
+ "\\(?:\\[[^][]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*}[^}{]*\\)*"
+ "}[^}{]*\\)*"
+ "}[^][]*\\)*"
+ "label[ \t]*=[ \t]*{\\([^}]+\\)}"
+ "\\(?:[^]]*\\)*"
+ "\\]\\)")
+ 1 LaTeX-auto-label)
+ "Matches the label inside an optional argument after \\begin{<breqn-env's>}.")
+
+(defun LaTeX-breqn-env (env)
+ "Insert ENV from breqn package incl. optional key=val argument.
+Keys offered for key=val query depend on ENV. \"label\" and
+\"labelprefix\" are omitted."
+ (let ((keyvals
+ (TeX-read-key-val t
+ (cond ((or (string= env "dgroup")
+ (string= env "dgroup*"))
+ (append '(("noalign") ("brace"))
+ LaTeX-breqn-key-val-options-local))
+ ((or (string= env "darray")
+ (string= env "darray*"))
+ (append '(("noalign") ("brace") ("cols" ("{}")))
+ LaTeX-breqn-key-val-options-local))
+ (t LaTeX-breqn-key-val-options-local)))))
+ (LaTeX-insert-environment env (when (and keyvals
+ (not (string= keyvals "")))
+ (concat LaTeX-optop keyvals LaTeX-optcl)))
+ (LaTeX-env-label-as-keyval nil nil keyvals env)))
+
+(defun LaTeX-breqn-update-color-keys ()
+ "Update color relevant keys from `LaTeX-breqn-key-val-options-local'."
+ (when (or (member "xcolor" (TeX-style-list))
+ (member "color" (TeX-style-list)))
+ (let* ((colorcmd (if (member "xcolor" (TeX-style-list))
+ #'LaTeX-xcolor-definecolor-list
+ #'LaTeX-color-definecolor-list))
+ (keys '("color" "background"))
+ (tmp (copy-alist LaTeX-breqn-key-val-options-local)))
+ (dolist (x keys)
+ (setq tmp (assq-delete-all (car (assoc x tmp)) tmp))
+ (push (list x (mapcar #'car (funcall colorcmd))) tmp))
+ (setq LaTeX-breqn-key-val-options-local
+ (copy-alist tmp)))))
+
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-breqn-update-color-keys t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "breqn"
+ (lambda ()
+
+ ;; Local version of key-val options
+ (setq LaTeX-breqn-key-val-options-local
+ (copy-alist LaTeX-breqn-key-val-options))
+
+ ;; Add breqn to parser:
+ (TeX-auto-add-regexp LaTeX-breqn-key-val-label-regexp)
+
+ ;; Tell AUCTeX that we want to prefix the labels with `LaTeX-equation-label':
+ (let ((envs '("dmath" "dseries" "dgroup" "darray")))
+ (dolist (env envs)
+ (add-to-list 'LaTeX-label-alist `(,env . LaTeX-equation-label) t)))
+
+ ;; For RefTeX, we must distinguish between equation and eqnarray-like:
+ ;; breqn env == equivalent -- starred
+ ;; dmath == equation -- dmath* == unnumbered
+ ;; dseries == equation -- dseries* == unnumbered
+ ;; dgroup == align -- dgroup* == unnumbered
+ ;; darray == eqnarray -- darray* == unnumbered
+ (when (fboundp 'reftex-add-label-environments)
+ (dolist (env '("dmath" "dseries" "dgroup"))
+ (reftex-add-label-environments `((,env ?e nil nil t))))
+ (reftex-add-label-environments '(("darray" ?e nil nil eqnarray-like))))
+
+ (LaTeX-add-environments
+ '("dmath" LaTeX-breqn-env)
+ '("dmath*" LaTeX-breqn-env)
+ '("dseries" LaTeX-breqn-env)
+ '("dseries*" LaTeX-breqn-env)
+ '("dgroup" LaTeX-breqn-env)
+ '("dgroup*" LaTeX-breqn-env)
+ '("darray" LaTeX-breqn-env)
+ '("darray*" LaTeX-breqn-env)
+ '("dsuspend"))
+
+ (TeX-add-symbols
+ '("condition" [ "Punctuation mark (default ,)" ] t)
+ '("condition*" [ "Punctuation mark (default ,)" ] t)
+ '("hiderel" t))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup)
+ (boundp 'font-latex-math-environments))
+ (make-local-variable 'font-latex-math-environments)
+ (let ((envs '(;; Do not insert the starred versions here;
+ ;; function `font-latex-match-math-envII' takes
+ ;; care of it
+ "dmath" "dseries" "dgroup" "darray")))
+ (dolist (env envs)
+ (add-to-list 'font-latex-math-environments env t)))))
+ LaTeX-dialect)
+
+(defvar LaTeX-breqn-package-options nil
+ "Package options for the breqn package.")
+
+;;; breqn.el ends here
--- /dev/null
+;;; canadian.el --- AUCTeX style for the `canadian' babel option.
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-07-02
+;; 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:
+
+;; Set up AUCTeX for editing Canadian text in connection with the
+;; `canadian' babel option.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "canadian"
+ (lambda ()
+ (TeX-run-style-hooks "english"))
+ LaTeX-dialect)
+
+;;; canadian.el ends here
--- /dev/null
+;;; caption.el --- AUCTeX style for `caption.sty' (v3.3-111)
+
+;; Copyright (C) 2015--2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-02-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 `caption.sty' (v3.3-111) from 2015/09/17.
+;; `caption.sty' is part of TeXLive.
+
+;; If things do not work or when in doubt, press `C-c C-n'. Comments
+;; for improvement are welcome.
+
+;;; Code:
+
+;; Needed for compiling `pushnew':
+(eval-when-compile (require 'cl))
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+(defvar LaTeX-caption-key-val-options
+ '(("aboveskip")
+ ("belowskip")
+ ("font" ("scriptsize" "footnotesize" "small" "normalsize" "large"
+ "Large" "normalfont" "up" "it" "sl" "sc" "md" "bf" "rm"
+ "sf" "tt" "singlespacing" "onehalfspacing" "doublespacing"
+ "stretch" "normalcolor" "color" "normal"))
+ ("font+" ("scriptsize" "footnotesize" "small" "normalsize" "large"
+ "Large" "normalfont" "up" "it" "sl" "sc" "md" "bf" "rm"
+ "sf" "tt" "singlespacing" "onehalfspacing" "doublespacing"
+ "stretch" "normalcolor" "color" "normal"))
+ ("format" ("plain" "hang"))
+ ("hangindent")
+ ("hypcap" ("false" "no" "off" "0" "true" "yes" "on" "1"))
+ ("hypcapspace")
+ ("indention")
+ ("justification" ("justified" "centering" "centerlast" "centerfirst"
+ "raggedright" "RaggedRight" "raggedleft"))
+ ("labelfont" ("scriptsize" "footnotesize" "small" "normalsize" "large"
+ "Large" "normalfont" "up" "it" "sl" "sc" "md" "bf" "rm"
+ "sf" "tt" "singlespacing" "onehalfspacing" "doublespacing"
+ "stretch" "normalcolor" "color" "normal"))
+ ("labelfont+" ("scriptsize" "footnotesize" "small" "normalsize" "large"
+ "Large" "normalfont" "up" "it" "sl" "sc" "md" "bf" "rm"
+ "sf" "tt" "singlespacing" "onehalfspacing" "doublespacing"
+ "stretch" "normalcolor" "color" "normal"))
+ ("labelformat" ("default" "empty" "simple" "brace" "parens"))
+ ("labelsep" ("none" "colon" "period" "space" "quad" "newline" "endash"))
+ ("list" ("false" "no" "off" "0" "true" "yes" "on" "1"))
+ ("listformat" ("empty" "simple" "paren" "subsimple" "subparens"))
+ ("margin")
+ ("margin*")
+ ("maxmargin")
+ ("minmargin")
+ ("name")
+ ("oneside")
+ ("parindent")
+ ("parskip")
+ ("position" ("top" "above" "bottom" "below" "auto"))
+ ("singlelinecheck" ("false" "no" "off" "0" "true" "yes" "on" "1"))
+ ("slc" ("false" "no" "off" "0" "true" "yes" "on" "1"))
+ ("skip")
+ ("strut" ("false" "no" "off" "0" "true" "yes" "on" "1"))
+ ("style" ("base" "default"))
+ ("textfont" ("scriptsize" "footnotesize" "small" "normalsize" "large"
+ "Large" "normalfont" "up" "it" "sl" "sc" "md" "bf" "rm"
+ "sf" "tt" "singlespacing" "onehalfspacing" "doublespacing"
+ "stretch" "normalcolor" "color" "normal"))
+ ("textfont+" ("scriptsize" "footnotesize" "small" "normalsize" "large"
+ "Large" "normalfont" "up" "it" "sl" "sc" "md" "bf" "rm"
+ "sf" "tt" "singlespacing" "onehalfspacing" "doublespacing"
+ "stretch" "normalcolor" "color" "normal"))
+ ("textformat" ("empty" "simple" "period"))
+ ("twoside")
+ ("type" ("figure" "table" "ContinuedFloat"))
+ ("type*" ("figure" "table" "ContinuedFloat"))
+ ("width"))
+ "Key=value options for caption macros.")
+
+(defvar LaTeX-caption-key-val-options-local nil
+ "Buffer-local key=value options for caption macros.")
+(make-variable-buffer-local 'LaTeX-caption-key-val-options-local)
+
+(defvar LaTeX-caption-supported-float-types
+ '("figure" "table" "ContinuedFloat" ; Standard caption.sty
+ "sub" "subtable" "subfigure" ; subcaption.sty
+ "bi" "bi-first" "bi-second" ; bicaption.sty
+ "ruled" "boxed" ; float.sty
+ "floatingfigure" "floatingtable" ; floatflt.sty
+ "lstlisting" ; listings.sty
+ "longtable" ; longtable.sty
+ "figwindow" "tabwindow" ; picinpar.sty
+ "parpic" ; picins.sty
+ "SCfigure" "SCtable" ; sidecap.sty
+ "supertabular" "xtabular" ; supertabular.sty & xtab.sty
+ "threeparttable" "measuredfigure" ; threeparttable.sty
+ "wrapfigure" "wraptable") ; wrapfigure
+ "List of float types provided by other LaTeX packages and
+supported by `caption.sty'.")
+
+;; Setup for various \DeclareCaption's:
+(TeX-auto-add-type "caption-DeclareCaption" "LaTeX")
+
+;; The 2. argument to `DeclareCaption[A-Za-z]' contains (La)TeX code.
+;; We deliberately ignore that argument in our regex since it is not
+;; needed for this style and would pollute the auto generated
+;; `docname.el' file.
+(defvar LaTeX-caption-DeclareCaption-regexp
+ `(,(concat "\\\\DeclareCaption\\(Font\\|Format\\|Justification"
+ "\\|LabelFormat\\|LabelSeparator\\|ListFormat"
+ "\\|Option\\|Style\\|TextFormat\\)"
+ "\\*?"
+ "[ \t\n\r%]*"
+ "{\\([^}]+\\)}")
+ (0 1 2) LaTeX-auto-caption-DeclareCaption)
+ "Matches the arguments of different `\\DeclareCaption*' from
+`caption.sty'.")
+
+(defun LaTeX-caption-auto-prepare ()
+ "Clear `LaTeX-auto-caption-DeclareCaption' before parsing."
+ (setq LaTeX-auto-caption-DeclareCaption nil))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-caption-auto-prepare t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun LaTeX-caption-update-key-val-options ()
+ "Update the buffer-local key-val options before offering them
+in `caption'-completions."
+ (dolist (keyvals (LaTeX-caption-DeclareCaption-list))
+ (let* ((key (cond ((string-equal (nth 1 keyvals) "LabelSeparator")
+ (downcase (substring (nth 1 keyvals) 0 8)))
+ (t (downcase (nth 1 keyvals)))))
+ (val (nth 2 keyvals))
+ (val-match (cdr (assoc key LaTeX-caption-key-val-options-local)))
+ (temp (copy-alist LaTeX-caption-key-val-options-local))
+ ;; If `subcaption.el' is loaded, delete and update also the
+ ;; entry for `subrefformat' when processing the `labelformat'.
+ (opts (progn
+ (when (and (string-equal key "labelformat")
+ (boundp 'LaTeX-subcaption-key-val-options))
+ (setq temp
+ (assq-delete-all
+ (car (assoc (caar LaTeX-subcaption-key-val-options) temp))
+ temp)))
+ (assq-delete-all (car (assoc key temp)) temp))))
+ ;; For `\DeclareCaptionOption', only add the value
+ ;; (remember: key=^^^^^^, val="defined key")
+ (if (string-equal key "option")
+ (pushnew (list val) opts :test #'equal)
+ ;; For anything but `\DeclareCaptionOption', do the standard
+ ;; procedure. Again, take care of `subrefformat' for `subcaption.el'.
+ (if val-match
+ (progn
+ (when (and (string-equal key "labelformat")
+ (boundp 'LaTeX-subcaption-key-val-options))
+ (pushnew (list "subrefformat"
+ (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
+ opts :test #'equal))
+ (pushnew (list key (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
+ opts :test #'equal))
+ (pushnew (list key (list val)) opts :test #'equal)))
+ (setq LaTeX-caption-key-val-options-local (copy-alist opts))))
+ ;; Support for environments defined with newfloat.sty: These
+ ;; environments are added to "type" and "type*" key:
+ (when (and (member "newfloat" (TeX-style-list))
+ (fboundp 'LaTeX-newfloat-DeclareFloatingEnvironment-list)
+ (LaTeX-newfloat-DeclareFloatingEnvironment-list))
+ (dolist (key '("type" "type*"))
+ (let* ((val (mapcar #'car (LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+ (val-match (cdr (assoc key LaTeX-caption-key-val-options-local)))
+ (temp (copy-alist LaTeX-caption-key-val-options-local))
+ (opts (assq-delete-all (car (assoc key temp)) temp)))
+ (pushnew (list key (TeX-delete-duplicate-strings (apply #'append val val-match)))
+ opts :test #'equal)
+ (setq LaTeX-caption-key-val-options-local (copy-alist opts))))))
+
+(defun LaTeX-arg-caption-command (optional &optional prompt)
+ "Insert caption-commands from `caption.sty'. If OPTIONAL,
+indicate `(Optional)' while reading key=val and insert it in
+square brackets. PROMPT replaces the standard one."
+ (LaTeX-caption-update-key-val-options)
+ (let ((opts (TeX-read-key-val optional
+ LaTeX-caption-key-val-options-local
+ prompt)))
+ (TeX-argument-insert opts optional)))
+
+;; In `LaTeX-caption-DeclareCaption-regexp', we match (0 1 2). When
+;; adding a new `Name', we need something unique for `0'-match until
+;; the next `C-c C-n'. We mimic that regex-match bei concat'ing the
+;; elements. It will vanish upon next `C-c C-n'.
+(defun LaTeX-arg-caption-DeclareCaption (optional format)
+ "Insert various `\\DeclareCaptionFORMAT' commands. If
+OPTIONAL, insert argument in square brackets. FORMAT is the
+suffix of the command."
+ (let ((name (TeX-read-string "Name: ")))
+ (LaTeX-add-caption-DeclareCaptions
+ (list (concat "\\DeclareCaption" format "{" name "}")
+ format name))
+ (TeX-argument-insert name optional)))
+
+;; Support for an undocumented feature of caption.sty:
+;; `\captionbox' sets the width of the caption equal to the width of
+;; the contents (a feature provided e.g. by `threeparttable.sty').
+;; The starred version typesets the caption without label and without
+;; entry to the list of figures or tables.
+
+;; The first mandatory argument {<heading>} contains the caption text
+;; and the label. We used to use `TeX-insert-macro' to do the job
+;; (Thanks to M. Giordano for his valuable comments on this!), but now
+;; moved to `LaTeX-label'.
+
+;; Syntax:
+;; \captionbox[<list entry>]{<heading>}[<width>][<inner-pos>]{<contents>}
+;; \captionbox*{<heading>}[<width>][<inner-pos>]{<contents>}
+
+(defun LaTeX-arg-caption-captionbox (optional &optional star)
+ "Query for the arguments of \"\\captionbox\" incl. a label and insert them.
+If STAR is non-nil, then do not query for a \\label and a short
+caption, insert only a caption."
+ (let* ((currenv (LaTeX-current-environment))
+ (caption (TeX-read-string
+ (TeX-argument-prompt optional nil "Caption")))
+ (short-caption
+ (when (and (not star)
+ (>= (length caption) LaTeX-short-caption-prompt-length))
+ (TeX-read-string
+ (TeX-argument-prompt t nil "Short caption")))))
+ (indent-according-to-mode)
+ (when (and short-caption (not (string= short-caption "")))
+ (insert LaTeX-optop short-caption LaTeX-optcl))
+ (insert TeX-grop caption)
+ (unless star (LaTeX-label currenv 'environment))
+ (insert TeX-grcl))
+ (let* ((TeX-arg-opening-brace "[")
+ (TeX-arg-closing-brace "]")
+ (width (completing-read (TeX-argument-prompt t nil "Width")
+ (mapcar (lambda (elt) (concat TeX-esc (car elt)))
+ (LaTeX-length-list))))
+ (inpos (if (and width (not (string-equal width "")))
+ (completing-read (TeX-argument-prompt t nil "Inner position")
+ '("c" "l" "r" "s"))
+ "")))
+ (TeX-argument-insert width t)
+ (TeX-argument-insert inpos t))
+ ;; Fill the paragraph before inserting {}. We can use
+ ;; `LaTeX-fill-paragraph' without messing up the code since
+ ;; \caption starts a new paragraph with AUCTeX
+ ;; (cf. `paragraph-start').
+ (LaTeX-fill-paragraph))
+
+(defun LaTeX-arg-caption-captionof (optional &optional star)
+ "Query for the arguments of \"\\captionof\" macro and insert them.
+If OPTIONAL is non-nil, insert the arguments in brackets. If
+STAR is non-nil, do not query for a short-caption and a label."
+ (let* ((envtype (completing-read (TeX-argument-prompt optional nil "Float type")
+ LaTeX-caption-supported-float-types))
+ (figtypes '("figure" "subfigure" "floatingfigure"
+ "figwindow" "SCfigure" "measuredfigure" "wrapfigure"))
+ (tabtypes '("table" "subtable" "floatingtable" "tabwindow" "SCtable"
+ "supertabular" "xtabular" "threeparttable" "wraptable"))
+ (caption (TeX-read-string
+ (TeX-argument-prompt optional nil "Caption")))
+ (short-caption
+ (when (and (not star)
+ (>= (length caption) LaTeX-short-caption-prompt-length))
+ (TeX-read-string
+ (TeX-argument-prompt t nil "Short caption")))))
+ (indent-according-to-mode)
+ (TeX-argument-insert envtype optional)
+ (when (and short-caption (not (string= short-caption "")))
+ (insert LaTeX-optop short-caption LaTeX-optcl))
+ (TeX-argument-insert caption optional)
+ (LaTeX-fill-paragraph)
+ (when (and (not star)
+ ;; Check if `envtype' is a figure or a table, also
+ ;; consult `LaTeX-label-alist' for additions from user
+ ;; or newfloat.el, then run `LaTeX-label' w/
+ ;; 'environment arg, otherwise w/o.
+ (save-excursion
+ (if (or (member envtype figtypes)
+ (member envtype tabtypes)
+ (assoc envtype LaTeX-label-alist))
+ (LaTeX-label (cond ((member envtype figtypes)
+ "figure")
+ ((member envtype tabtypes)
+ "table")
+ (t envtype))
+ 'environment)
+ (LaTeX-label envtype))))
+ (LaTeX-newline)
+ (indent-according-to-mode)
+ (end-of-line))))
+
+(TeX-add-style-hook
+ "caption"
+ (lambda ()
+
+ ;; Add caption to the parser.
+ (TeX-auto-add-regexp LaTeX-caption-DeclareCaption-regexp)
+
+ ;; Activate the buffer-local version of key-vals.
+ (setq LaTeX-caption-key-val-options-local
+ (copy-alist LaTeX-caption-key-val-options))
+
+ ;; Append key=vals from bicaption.sty if loaded: "language" key
+ ;; depends on the active languages, it is appended extra where main
+ ;; language is removed from the list:
+ (when (and (member "bicaption" (TeX-style-list))
+ ;; Make sure that one of these packages is loaded:
+ (or (fboundp 'LaTeX-babel-active-languages)
+ (fboundp 'LaTeX-polyglossia-active-languages)))
+ (setq LaTeX-caption-key-val-options-local
+ (append
+ `(,(list "language"
+ (or (butlast (LaTeX-babel-active-languages))
+ (butlast (LaTeX-polyglossia-active-languages)))))
+ LaTeX-bicaption-key-val-options
+ LaTeX-caption-key-val-options-local)))
+
+ ;; Caption commands:
+ (TeX-add-symbols
+ '("caption*" t)
+
+ '("captionlistentry"
+ [TeX-arg-eval completing-read (TeX-argument-prompt t nil "Float type")
+ LaTeX-caption-supported-float-types]
+ t)
+
+ '("captionof" LaTeX-arg-caption-captionof)
+
+ '("captionof*" (LaTeX-arg-caption-captionof t))
+
+ '("captionsetup"
+ (TeX-arg-conditional (member "bicaption" (TeX-style-list))
+ ([LaTeX-arg-bicaption-captionsetup])
+ ([TeX-arg-eval completing-read
+ (TeX-argument-prompt t nil "Float type")
+ LaTeX-caption-supported-float-types]))
+ (LaTeX-arg-caption-command))
+
+ '("captionsetup*"
+ (TeX-arg-conditional (member "bicaption" (TeX-style-list))
+ ([LaTeX-arg-bicaption-captionsetup])
+ ([TeX-arg-eval completing-read
+ (TeX-argument-prompt t nil "Float type")
+ LaTeX-caption-supported-float-types]))
+ (LaTeX-arg-caption-command))
+
+ '("clearcaptionsetup"
+ [LaTeX-arg-caption-command "Single key"]
+ (TeX-arg-eval completing-read (TeX-argument-prompt nil nil "Float type")
+ LaTeX-caption-supported-float-types))
+
+ '("clearcaptionsetup*"
+ [LaTeX-arg-caption-command "Single key"]
+ (TeX-arg-eval completing-read (TeX-argument-prompt nil nil "Float type")
+ LaTeX-caption-supported-float-types))
+
+ '("captionbox" (LaTeX-arg-caption-captionbox) t)
+
+ '("captionbox*" (LaTeX-arg-caption-captionbox t) t)
+
+ '("ContinuedFloat" 0)
+ '("ContinuedFloat*" 0)
+
+ '("continuedfloat" 0)
+ '("continuedfloat*" 0)
+
+ '("DeclareCaptionFont"
+ (LaTeX-arg-caption-DeclareCaption "Font") t)
+
+ '("DeclareCaptionFormat"
+ (LaTeX-arg-caption-DeclareCaption "Format") t)
+
+ '("DeclareCaptionFormat*"
+ (LaTeX-arg-caption-DeclareCaption "Format") t)
+
+ '("DeclareCaptionJustification"
+ (LaTeX-arg-caption-DeclareCaption "Justification") t)
+
+ '("DeclareCaptionLabelFormat"
+ (LaTeX-arg-caption-DeclareCaption "LabelFormat") t)
+
+ '("DeclareCaptionLabelSeparator"
+ (LaTeX-arg-caption-DeclareCaption "LabelSeparator") t)
+
+ '("DeclareCaptionLabelSeparator*"
+ (LaTeX-arg-caption-DeclareCaption "LabelSeparator") t)
+
+ '("DeclareCaptionListFormat"
+ (LaTeX-arg-caption-DeclareCaption "ListFormat") t)
+
+ '("DeclareCaptionOption"
+ (LaTeX-arg-caption-DeclareCaption "Option") t)
+
+ '("DeclareCaptionStyle"
+ (LaTeX-arg-caption-DeclareCaption "Style")
+ [LaTeX-arg-caption-command "Additional options"]
+ (LaTeX-arg-caption-command "Options"))
+
+ '("DeclareCaptionTextFormat"
+ (LaTeX-arg-caption-DeclareCaption "TextFormat") t)
+
+ '("bothIfFirst" 2)
+
+ '("bothIfSecond" 2))
+
+ ;; \caption(box|of) macros should get their own lines
+ (LaTeX-paragraph-commands-add-locally '("captionbox" "captionof"))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("caption" "*[{")
+ ("captionlistentry" "[{")
+ ("captionof" "*{[{")
+ ("captionbox" "*[{[["))
+ 'textual)
+ (font-latex-add-keywords '(("captionsetup" "*[[{")
+ ("clearcaptionsetup" "*[{")
+ ("DeclareCaptionFont" "{{")
+ ("DeclareCaptionFormat" "*{{")
+ ("DeclareCaptionJustification" "{{")
+ ("DeclareCaptionLabelFormat" "{{")
+ ("DeclareCaptionLabelSeparator" "*{{")
+ ("DeclareCaptionListFormat" "{{")
+ ("DeclareCaptionOption" "{{")
+ ("DeclareCaptionStyle" "{[{")
+ ("DeclareCaptionTextFormat" "{{"))
+ 'function)) )
+ LaTeX-dialect)
+
+(defun LaTeX-caption-package-options ()
+ "Prompt for package options for the caption package."
+ (TeX-read-key-val t
+ (append '(("compatibility" ("true" "false")))
+ '(("figureposition" ("top" "above" "bottom" "below")))
+ '(("tableposition" ("top" "above" "bottom" "below")))
+ LaTeX-caption-key-val-options)))
+
+;;; caption.el ends here
--- /dev/null
+;;; color.el --- AUCTeX style for `color.sty' (v1.1a)
+
+;; Copyright (C) 2015--2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-01-16
+;; 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 `color.sty' (v1.1a) from 2014/10/28.
+;; `color.sty' is part of TeXLive.
+
+;; Many thanks to Tassilo Horn for his percetive comments on
+;; implementation of this style and testing.
+
+;;; Code:
+
+(defvar LaTeX-color-colour-models
+ '("cmyk" "gray" "named" "rgb")
+ "List of color models provided by `color.sty'.")
+
+(defvar LaTeX-color-dvipsnames-colors
+ '("Apricot" "Aquamarine" "Bittersweet" "Black"
+ "Blue" "BlueGreen" "BlueViolet" "BrickRed"
+ "Brown" "BurntOrange" "CadetBlue" "CarnationPink"
+ "Cerulean" "CornflowerBlue" "Cyan" "Dandelion"
+ "DarkOrchid" "Emerald" "ForestGreen" "Fuchsia"
+ "Goldenrod" "Gray" "Green" "GreenYellow"
+ "JungleGreen" "Lavender" "LimeGreen" "Magenta"
+ "Mahogany" "Maroon" "Melon" "MidnightBlue"
+ "Mulberry" "NavyBlue" "OliveGreen" "Orange"
+ "OrangeRed" "Orchid" "Peach" "Periwinkle"
+ "PineGreen" "Plum" "ProcessBlue" "Purple"
+ "RawSienna" "Red" "RedOrange" "RedViolet"
+ "Rhodamine" "RoyalBlue" "RoyalPurple" "RubineRed"
+ "Salmon" "SeaGreen" "Sepia" "SkyBlue"
+ "SpringGreen" "Tan" "TealBlue" "Thistle"
+ "Turquoise" "Violet" "VioletRed" "White"
+ "WildStrawberry" "Yellow" "YellowGreen" "YellowOrange")
+ "List of colors defined by package option `dvipsnames' from `color.sty'.")
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+;; Plug \definecolor into the parser
+(TeX-auto-add-type "color-definecolor" "LaTeX")
+
+(defvar LaTeX-color-definecolor-regexp
+ '("\\\\definecolor{\\([^}]+\\)}" 1 LaTeX-auto-color-definecolor)
+ "Matches the argument of \\definecolor from color package.")
+
+(defun LaTeX-color-auto-prepare ()
+ "Clear `LaTeX-auto-color-definecolor' before parsing."
+ (setq LaTeX-auto-color-definecolor nil))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-color-auto-prepare t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun TeX-arg-color-definecolor (optional &optional prompt)
+ "Insert arguments of `\\definecolor' from `color.sty'."
+ ;; \definecolor{<name>}{<model>}{<color spec>}
+ ;; Ask for <name>, add to our list and insert it
+ (let ((colorname (TeX-read-string "Color name: ")))
+ (LaTeX-add-color-definecolors colorname)
+ (TeX-argument-insert colorname optional))
+ ;; Ask and insert <model>
+ (let ((model (completing-read
+ (TeX-argument-prompt optional prompt "Color model")
+ (if (not (or (LaTeX-provided-package-options-member "color" "dvips")
+ (LaTeX-provided-package-options-member "color" "dvipsnames")))
+ (remove "named" LaTeX-color-colour-models)
+ LaTeX-color-colour-models))))
+ (TeX-argument-insert model optional)
+ ;; Depending on <model>, ask for <color spec> and insert it
+ (cond (;; <cmyk> model
+ (string-equal model "cmyk")
+ (let ((cyan (TeX-read-string "Value Cyan (between 0,1): "))
+ (magenta (TeX-read-string "Value Magenta (between 0,1): "))
+ (yellow (TeX-read-string "Value Yellow (between 0,1): "))
+ (black (TeX-read-string "Value Black (between 0,1): ")))
+ (TeX-argument-insert
+ (concat cyan "," magenta "," yellow "," black) optional)))
+ ;; <rgb> model
+ ((string-equal model "rgb")
+ (let ((red (TeX-read-string "Value Red (between 0,1): "))
+ (green (TeX-read-string "Value Green (between 0,1): "))
+ (blue (TeX-read-string "Value Blue (between 0,1): ")))
+ (TeX-argument-insert
+ (concat red "," green "," blue) optional)))
+ ;; <gray> model
+ ((string-equal model "gray")
+ (let ((grayness (TeX-read-string "Value Gray (between 0,1): ")))
+ (TeX-argument-insert grayness optional)))
+ ;; <named> model takes the dvipsnames
+ ((string-equal model "named")
+ (let ((color (completing-read "Named Color: "
+ LaTeX-color-dvipsnames-colors)))
+ (TeX-argument-insert color optional))))))
+
+(defun TeX-arg-color (optional &optional prompt)
+ "Insert arguments of various color commands from `color.sty'."
+ ;; \color{<name>} or \color[<model>]{<color spec>}
+ ;; First, ask for <model>. `named' is removed here from completion
+ ;; if package option is not given
+ (let ((model (completing-read
+ (TeX-argument-prompt t prompt "Color model")
+ (if (not (or (LaTeX-provided-package-options-member "color" "dvips")
+ (LaTeX-provided-package-options-member "color" "dvipsnames")))
+ (remove "named" LaTeX-color-colour-models)
+ LaTeX-color-colour-models))))
+ (if (string-equal model "")
+ ;; if empty, ask for <name> with completion
+ (let ((color (completing-read
+ (TeX-argument-prompt optional prompt "Color name")
+ (LaTeX-color-definecolor-list))))
+ (TeX-argument-insert color optional))
+ ;; if not empty, insert [<model>] and proceed
+ (insert (concat LaTeX-optop model LaTeX-optcl))
+ (cond (;; <cmyk> model
+ (string-equal model "cmyk")
+ (let ((cyan (TeX-read-string "Value Cyan (between 0,1): "))
+ (magenta (TeX-read-string "Value Magenta (between 0,1): "))
+ (yellow (TeX-read-string "Value Yellow (between 0,1): "))
+ (black (TeX-read-string "Value Black (between 0,1): ")))
+ (TeX-argument-insert
+ (concat cyan "," magenta "," yellow "," black) optional)))
+ ;; <rgb> model
+ ((string-equal model "rgb")
+ (let ((red (TeX-read-string "Value Red (between 0,1): "))
+ (green (TeX-read-string "Value Green (between 0,1): "))
+ (blue (TeX-read-string "Value Blue (between 0,1): ")))
+ (TeX-argument-insert
+ (concat red "," green "," blue) optional)))
+ ;; <gray> model
+ ((string-equal model "gray")
+ (let ((grayness (TeX-read-string "Value Gray (between 0,1): ")))
+ (TeX-argument-insert grayness optional)))
+ ;; <named> model; allowed are dvipsnames.
+ ((string-equal model "named")
+ (let ((color (completing-read "Named Color: "
+ LaTeX-color-dvipsnames-colors)))
+ (TeX-argument-insert color optional)))))))
+
+(defun TeX-arg-color-fcolorbox (optional &optional prompt)
+ "Insert arguments of `\\fcolorbox' from `color.sty'. "
+ ;; \fcolorbox{<frame color name>}{<box color name>}{<text>} or
+ ;; \fcolorbox[<model>]{<frame color spec>}{<box color spec>}{<text>}
+ ;; First, ask for <model>; remove `named' again
+ (let ((model (completing-read
+ (TeX-argument-prompt t prompt "Color model")
+ (if (not (or (LaTeX-provided-package-options-member "color" "dvips")
+ (LaTeX-provided-package-options-member "color" "dvipsnames")))
+ (remove "named" LaTeX-color-colour-models)
+ LaTeX-color-colour-models))))
+ (if (string-equal model "")
+ ;; if empty, ask for <frame color spce> with completion
+ (let ((frame-color (completing-read
+ (TeX-argument-prompt optional prompt "Frame color name")
+ (LaTeX-color-definecolor-list)))
+ (box-color (completing-read
+ (TeX-argument-prompt optional prompt "Box color name")
+ (LaTeX-color-definecolor-list))))
+ (TeX-argument-insert frame-color optional)
+ (TeX-argument-insert box-color optional))
+ ;; if not empty, insert [<model>] and cater for 2 mandatory args.
+ (insert (concat LaTeX-optop model LaTeX-optcl))
+ (cond (;; <cmyk> model
+ (string-equal model "cmyk")
+ (let ((cyan (TeX-read-string "Frame value Cyan (between 0,1): "))
+ (magenta (TeX-read-string "Frame value Magenta (between 0,1): "))
+ (yellow (TeX-read-string "Frame value Yellow (between 0,1): "))
+ (black (TeX-read-string "Frame value Black (between 0,1): ")))
+ (TeX-argument-insert
+ (concat cyan "," magenta "," yellow "," black) optional))
+ (let ((cyan (TeX-read-string "Box value Cyan (between 0,1): "))
+ (magenta (TeX-read-string "Box value Magenta (between 0,1): "))
+ (yellow (TeX-read-string "Box value Yellow (between 0,1): "))
+ (black (TeX-read-string "Box value Black (between 0,1): ")))
+ (TeX-argument-insert
+ (concat cyan "," magenta "," yellow "," black) optional)))
+ ;; <rgb> model
+ ((string-equal model "rgb")
+ (let ((red (TeX-read-string "Frame value Red (between 0,1): "))
+ (green (TeX-read-string "Frame value Green (between 0,1): "))
+ (blue (TeX-read-string "Frame value Blue (between 0,1): ")))
+ (TeX-argument-insert
+ (concat red "," green "," blue) optional))
+ (let ((red (TeX-read-string "Box value Red (between 0,1): "))
+ (green (TeX-read-string "Box value Green (between 0,1): "))
+ (blue (TeX-read-string "box value Blue (between 0,1): ")))
+ (TeX-argument-insert
+ (concat red "," green "," blue) optional)))
+ ;; <gray> model
+ ((string-equal model "gray")
+ (let ((grayness (TeX-read-string "Frame value Gray (between 0,1): ")))
+ (TeX-argument-insert grayness optional))
+ (let ((grayness (TeX-read-string "Box value Gray (between 0,1): ")))
+ (TeX-argument-insert grayness optional)))
+ ;; <named> model; allowed are dvipsnames.
+ ((string-equal model "named")
+ (let ((color (completing-read "Frame named Color: "
+ LaTeX-color-dvipsnames-colors)))
+ (TeX-argument-insert color optional))
+ (let ((color (completing-read "Box named Color: "
+ LaTeX-color-dvipsnames-colors)))
+ (TeX-argument-insert color optional)))))))
+
+(TeX-add-style-hook
+ "color"
+ (lambda ()
+ ;; Add color to the parser.
+ (TeX-auto-add-regexp LaTeX-color-definecolor-regexp)
+
+ ;; Add list of colors which are always available.
+ (LaTeX-add-color-definecolors
+ "black" "blue" "cyan" "green" "magenta" "red" "white" "yellow")
+
+ ;; Add dvips colors in conjunction with `usenames'.
+ (when (and (LaTeX-provided-package-options-member "color" "usenames")
+ (or (LaTeX-provided-package-options-member "color" "dvips")
+ (LaTeX-provided-package-options-member "color" "dvipsnames")))
+ (apply #'LaTeX-add-color-definecolors LaTeX-color-dvipsnames-colors))
+
+ (unless (member "xcolor" (TeX-style-list))
+ (TeX-add-symbols
+ ;; \definecolor{<name>}{<model>}{<color spec>}
+ '("definecolor" TeX-arg-color-definecolor)
+
+ ;; \color{<name>} or \color[<model>]{<color spec>}
+ '("color" TeX-arg-color)
+
+ ;; \textcolor{<name>}{<text>} or
+ ;; \textcolor[<model>]{<color spec>}{<text>}
+ '("textcolor" TeX-arg-color "Text")
+
+ ;; \pagecolor{<name>} or
+ ;; \pagecolor[<model>]{<color spec>}
+ '("pagecolor" TeX-arg-color)
+
+ ;; \nopagecolor
+ '("nopagecolor" 0)
+
+ ;; \colorbox{<name>}{<text>} or
+ ;; \colorbox[<model>]{<color spec>}{<text>}
+ '("colorbox" TeX-arg-color "Text")
+
+ ;; \fcolorbox{<frame color name>}{<box color name>}{<text>} or
+ ;; \fcolorbox[<model>]{<frame color spec>}{<box color spec>}{<text>}
+ '("fcolorbox" TeX-arg-color-fcolorbox "Text"))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("color" "[{")
+ ("pagecolor" "[{"))
+ 'type-declaration)
+ (font-latex-add-keywords '(("textcolor" "[{{")
+ ("colorbox" "[{{" )
+ ("fcolorbox" "[{{{"))
+ 'type-command)
+ (font-latex-add-keywords '(("definecolor" "{{{"))
+ 'function))))
+ LaTeX-dialect)
+
+(defvar LaTeX-color-package-options
+ '("debugshow" "dvipdf" "dvipdfm" "dvipdfmx" "dvips" "dvipsnames"
+ "dvipsone" "dviwin" "dviwindo" "emtex" "monochrome" "nodvipsnames"
+ "oztex" "pctex32" "pctexhp" "pctexps" "pctexwin" "pdftex" "tcidvi"
+ "textures" "truetex" "usenames" "vtex" "xdvi" "xetex")
+ "Package options for the color package.")
+
+;;; color.el ends here
--- /dev/null
+;;; colortbl.el --- AUCTeX style for `colortbl.sty' (v1.0a)
+
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-03-22
+;; 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 `colortbl.sty' (v1.0a) from 2012/02/13.
+;; `colortbl.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "colortbl"
+ (lambda ()
+
+ ;; array.el is always loaded:
+ (TeX-run-style-hooks "array")
+
+ ;; Load color.el only if xcolor.el is not already loaded. This is
+ ;; mainly for the option `table' from xcolor.sty which loads
+ ;; colortbl.sty, but we don't want to load color.el.
+ (unless (member "xcolor" (TeX-style-list))
+ (TeX-run-style-hooks "color"))
+
+ (TeX-add-symbols
+ ;; `TeX-arg-color' is provided by color.el,
+ ;; `TeX-arg-xcolor' is provided by xcolor.el.
+ '("columncolor" (TeX-arg-conditional (member "xcolor" (TeX-style-list))
+ (TeX-arg-xcolor)
+ (TeX-arg-color))
+ [ TeX-arg-length "Left overhang" ] [ TeX-arg-length "Right overhang" ] )
+
+ '("rowcolor" (TeX-arg-conditional (member "xcolor" (TeX-style-list))
+ (TeX-arg-xcolor)
+ (TeX-arg-color))
+ [ TeX-arg-length "Left overhang" ] [ TeX-arg-length "Right overhang" ] )
+
+ '("cellcolor" (TeX-arg-conditional (member "xcolor" (TeX-style-list))
+ (TeX-arg-xcolor)
+ (TeX-arg-color))
+ [ TeX-arg-length "Left overhang" ] [ TeX-arg-length "Right overhang" ] )
+
+ '("arrayrulecolor" (TeX-arg-conditional (member "xcolor" (TeX-style-list))
+ (TeX-arg-xcolor)
+ (TeX-arg-color)))
+
+ '("doublerulesepcolor" (TeX-arg-conditional (member "xcolor" (TeX-style-list))
+ (TeX-arg-xcolor)
+ (TeX-arg-color))))
+
+ (LaTeX-add-lengths "minrowclearance")
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("columncolor" "[{[[")
+ ("rowcolor" "[{[[")
+ ("cellcolor" "[{[[")
+ ("arrayrulecolor" "[{")
+ ("doublerulesepcolor" "[{"))
+ 'function)))
+ LaTeX-dialect)
+
+;; colortbl.sty has one option `debugshow'. I ignore that since it
+;; would only take more time during insertation in a buffer and I
+;; presume that not many users use it anyway.
+(defvar LaTeX-colortbl-package-options nil
+ "Package option for the colortbl package.")
+
+;;; colortbl.el ends here
--- /dev/null
+;;; commath.el --- AUCTeX style for `commath.sty' (v0.3)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-07-31
+;; 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 `commath.sty' (v0.3) from 2006/07/18.
+;; `commath.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "commath"
+ (lambda ()
+
+ ;; Only load amsmath.el, ifthen.el is not necessary
+ (TeX-run-style-hooks "amsmath")
+
+ (TeX-add-symbols
+ '("dif" 0)
+ '("Dif" 0)
+ '("od" [ "Order of differentiation" ] "Function" "Variable")
+ '("tod" [ "Order of differentiation" ] "Function" "Variable")
+ '("dod" [ "Order of differentiation" ] "Function" "Variable")
+ '("pd" [ "Order of differentiation" ] "Function" "Variable")
+ '("tpd" [ "Order of differentiation" ] "Function" "Variable")
+ '("dpd" [ "Order of differentiation" ] "Function" "Variable")
+ '("md" 6)
+ '("tmd" 6)
+ '("dmd" 6)
+ '("del" [ "Size argument (0..4)" ] "Argument")
+ '("cbr" [ "Size argument (0..4)" ] "Argument")
+ '("set" [ "Size argument (0..4)" ] "Argument")
+ '("sbr" [ "Size argument (0..4)" ] "Argument")
+ '("intoo" [ "Size argument (0..4)" ] "Argument")
+ '("intcc" [ "Size argument (0..4)" ] "Argument")
+ '("intoc" [ "Size argument (0..4)" ] "Argument")
+ '("intco" [ "Size argument (0..4)" ] "Argument")
+ '("eval" [ "Size argument (0..4)" ] t)
+ '("sVert" [ "Size argument (0..4)" ])
+ '("envert" [ "Size argument (0..4)" ] "Argument")
+ '("abs" [ "Size argument (0..4)" ] "Argument")
+ '("enVert" [ "Size argument (0..4)" ] "Argument")
+ '("norm" [ "Size argument (0..4)" ] "Argument")
+ '("fullfunction" 5)
+
+ ;; Referencing macros
+ '("thmref" TeX-arg-ref)
+ '("exref" TeX-arg-ref)
+ '("defnref" TeX-arg-ref)
+ '("secref" TeX-arg-ref)
+ '("lemref" TeX-arg-ref)
+ '("propref" TeX-arg-ref)
+ '("remref" TeX-arg-ref)
+ '("figref" TeX-arg-ref)
+ '("colref" TeX-arg-ref)
+ '("appref" TeX-arg-ref)
+ '("assref" TeX-arg-ref))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("thmref" "{")
+ ("exref" "{")
+ ("defnref" "{")
+ ("secref" "{")
+ ("lemref" "{")
+ ("propref" "{")
+ ("remref" "{")
+ ("figref" "{")
+ ("colref" "{")
+ ("appref" "{")
+ ("assref" "{"))
+ 'reference)))
+ LaTeX-dialect)
+
+(defvar LaTeX-commath-package-options nil
+ "Package options for the commath package.")
+
+;;; commath.el ends here
--- /dev/null
+;;; currvita.el --- AUCTeX style for `currvita.sty' (v0.9i)
+
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-01-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 `currvita.sty' (v0.9i) from 1999/09/13.
+;; `currvita.sty' is part of TeXLive.
+
+;;; Code:
+
+;; This is a modified version of `LaTeX-env-item'.
+(defun LaTeX-currvita-env-with-label (env)
+ "Insert ENV, a mandatory label and the first item."
+ (LaTeX-insert-environment
+ env
+ (let ((heading (TeX-read-string "Heading of list: ")))
+ (format "{%s}" heading)))
+ (if (TeX-active-mark)
+ (progn
+ (LaTeX-find-matching-begin)
+ (end-of-line 1))
+ (end-of-line 0))
+ (delete-char 1)
+ (when (looking-at (concat "^[ \t]+$\\|"
+ "^[ \t]*" TeX-comment-start-regexp "+[ \t]*$"))
+ (delete-region (point) (line-end-position)))
+ (delete-horizontal-space)
+ ;; Deactivate the mark here in order to prevent `TeX-parse-macro'
+ ;; from swapping point and mark and the \item ending up right after
+ ;; \begin{...}.
+ (TeX-deactivate-mark)
+ (LaTeX-insert-item)
+ ;; The inserted \item may have outdented the first line to the
+ ;; right. Fill it, if appropriate.
+ (when (and (not (looking-at "$"))
+ (not (assoc env LaTeX-indent-environment-list))
+ (> (- (line-end-position) (line-beginning-position))
+ (current-fill-column)))
+ (LaTeX-fill-paragraph nil)))
+
+
+(TeX-add-style-hook
+ "currvita"
+ (lambda ()
+
+ ;; env's defined by currvita.sty
+ (LaTeX-add-environments
+ '("cv" "Heading of CV")
+ '("cvlist" LaTeX-currvita-env-with-label))
+
+ ;; Add "cvlist" to the list of environments which have an optional
+ ;; argument for each item
+ (add-to-list 'LaTeX-item-list '("cvlist" . LaTeX-item-argument))
+
+ ;; General commands: "\date" is already provided by AUCTeX
+ (TeX-add-symbols
+ '("cvplace" t)
+ '("cvheadingfont" 0)
+ '("cvlistheadingfont" 0)
+ '("cvlabelfont" 0)
+ '("cvbibname" 0))
+
+ ;; Add new lengths defined by currvita.sty
+ (LaTeX-add-lengths "cvlabelwidth" "cvlabelskip" "cvlabelsep"))
+ LaTeX-dialect)
+
+(defvar LaTeX-currvita-package-options
+ '("LabelsAligned" "TextAligned" "openbib" "ManyBibs" "NoDate")
+ "Package options for the currvita package.")
+
+;;; currvita.el ends here
--- /dev/null
+;;; dcolumn.el --- AUCTeX style for `dcolumn.sty' (v1.06)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-12-18
+;; 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 `dcolumn.sty' (v1.06) from 2014/10/28.
+;; `dcolumn.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "dcolumn"
+ (lambda ()
+
+ ;; `dcolumn.sty' adds one new column specification letter:
+ (set (make-local-variable 'LaTeX-array-column-letters)
+ (concat LaTeX-array-column-letters "D"))
+
+ ;; Also run style hook for `array':
+ (TeX-run-style-hooks "array"))
+ LaTeX-dialect)
+
+(defvar LaTeX-dcolumn-package-options nil
+ "Package options for the dcolumn package.")
+
+;;; dcolumn.el ends here
--- /dev/null
+;;; empheq.el --- AUCTeX style for `empheq.sty' (v2.14)
+
+;; Copyright (C) 2016, 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-08-07
+;; 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 `empheq.sty' (v2.14) from 2014/08/04.
+;; `empheq.sty' is part of TeXLive.
+
+;;; Code:
+
+;; Needed for compiling `pushnew':
+(eval-when-compile (require 'cl))
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+(defvar LaTeX-empheq-key-val-options
+ `(("box")
+ ("innerbox")
+ ("left" ,(mapcar
+ (lambda (x)
+ (concat TeX-esc x))
+ '("empheqlbrace"
+ "empheqlbrack"
+ "empheqlangle"
+ "empheqlparen"
+ "empheqlvert"
+ "empheqlVert"
+ "empheqlfloor"
+ "empheqlceil"
+ "empheqbiglbrace"
+ "empheqbiglbrack"
+ "empheqbiglangle"
+ "empheqbiglparen"
+ "empheqbiglvert"
+ "empheqbiglVert"
+ "empheqbiglfloor"
+ "empheqbiglceil")))
+ ("right" ,(mapcar
+ (lambda (x)
+ (concat TeX-esc x))
+ '("empheqrbrace"
+ "empheqrbrack"
+ "empheqrangle"
+ "empheqrparen"
+ "empheqrvert"
+ "empheqrVert"
+ "empheqrfloor"
+ "empheqrceil"
+ "empheqbigrbrace"
+ "empheqbigrbrack"
+ "empheqbigrangle"
+ "empheqbigrparen"
+ "empheqbigrvert"
+ "empheqbigrVert"
+ "empheqbigrfloor"
+ "empheqbigrceil")))
+ ("outerbox")
+ ("marginbox"))
+ "Key=value options for environments from empheq.sty.")
+
+(defvar LaTeX-empheq-key-val-options-local nil
+ "Buffer-local key=value options for environments from empheq.sty.")
+(make-local-variable 'LaTeX-empheq-key-val-options-local)
+
+(defvar LaTeX-empheq-supported-amsmath-envs
+ '("equation" "equation*"
+ "align" "align*"
+ "gather" "gather*"
+ "flalign" "flalign*"
+ "alignat" "alignat*"
+ "multline" "multline*")
+ "List of amsmath environments supported by empheq package.")
+
+(defvar LaTeX-empheq-package-options
+ '("overload" "overload2" "ntheorem" "newmultline" "oldmultline")
+ "Package options for the empheq package.")
+
+;; Setup for \Declare(Left|Right)Delimiter:
+
+(TeX-auto-add-type "empheq-declaredelimiter" "LaTeX")
+
+(defvar LaTeX-empheq-declaredelimiter-regexp
+ `(,(concat "\\\\Declare\\(Left\\|Right\\)Delimiter"
+ "[ \t\n\r%]*"
+ "\\(?:\\[[^]]*\\]\\)?"
+ "[ \t\n\r%]*"
+ "{"
+ (regexp-quote TeX-esc)
+ "\\([^}]+\\)}")
+ (2 1) LaTeX-auto-empheq-declaredelimiter)
+ "Matches the argument of \\Declare(Left|Right)Delimiter from empheq package.")
+
+(defun LaTeX-empheq-auto-prepare ()
+ "Clear `LaTeX-auto-empheq-declaredelimiter' before parsing."
+ (setq LaTeX-auto-empheq-declaredelimiter nil))
+
+(defun LaTeX-empheq-auto-cleanup ()
+ "Process parsed delimiters."
+ (dolist (delim (mapcar #'car (LaTeX-empheq-declaredelimiter-list)))
+ (TeX-add-symbols (concat "empheq" delim)
+ (concat "empheqbig" delim)))
+ (LaTeX-empheq-update-key-val-options))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-empheq-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-empheq-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun LaTeX-empheq-update-key-val-options ()
+ "Update `LaTeX-empheq-key-val-options-local' if the function
+`LaTeX-empheq-declaredelimiter-list' returns non-nil."
+ (when (LaTeX-empheq-declaredelimiter-list)
+ (let ((lvals (cadr (assoc "left" LaTeX-empheq-key-val-options)))
+ (rvals (cadr (assoc "right" LaTeX-empheq-key-val-options)))
+ (tmp (copy-alist LaTeX-empheq-key-val-options))
+ lval rval)
+ (dolist (delims (LaTeX-empheq-declaredelimiter-list))
+ (let ((delim (car delims))
+ (where (cadr delims)))
+ (if (string= where "Left")
+ (progn
+ (pushnew (concat TeX-esc "empheq" delim) lval :test #'equal)
+ (pushnew (concat TeX-esc "empheqbig" delim) lval :test #'equal))
+ (progn
+ (pushnew (concat TeX-esc "empheq" delim) rval :test #'equal)
+ (pushnew (concat TeX-esc "empheqbig" delim) rval :test #'equal)))))
+ (when lval
+ (setq tmp (assq-delete-all (car (assoc "left" tmp)) tmp))
+ (setq lvals (append lval lvals))
+ (push (list "left" lvals) tmp))
+ (when rval
+ (setq tmp (assq-delete-all (car (assoc "right" tmp)) tmp))
+ (setq rvals (append rval rvals))
+ (push (list "right" rvals) tmp))
+ (setq LaTeX-empheq-key-val-options-local
+ (copy-alist tmp)))))
+
+(defun LaTeX-empheq-env (env)
+ "Query for a supported amsmath environment and insert it accordingly."
+ (let* ((keyvals (TeX-read-key-val t LaTeX-empheq-key-val-options-local))
+ (amsenv (completing-read
+ (TeX-argument-prompt nil nil "amsmath environment")
+ LaTeX-empheq-supported-amsmath-envs))
+ (ncols (when (or (string= amsenv "alignat")
+ (string= amsenv "alignat*"))
+ (TeX-read-string
+ (TeX-argument-prompt nil nil "Number of columns"))))
+ num)
+ (LaTeX-insert-environment
+ env
+ (concat
+ (when (and keyvals (not (string= keyvals "")))
+ (concat LaTeX-optop keyvals LaTeX-optcl))
+ TeX-grop
+ (if (and ncols (not (string= ncols "")))
+ (concat amsenv "=" ncols)
+ (symbol-value 'amsenv))
+ TeX-grcl))
+ (when (and (assoc amsenv LaTeX-label-alist)
+ (LaTeX-label amsenv 'environment))
+ (LaTeX-newline)
+ (indent-according-to-mode))
+ (when (and ncols (not (string= ncols "")))
+ (setq num (string-to-number ncols))
+ (save-excursion
+ (insert (make-string (+ num num -1) ?&))))))
+
+(defun LaTeX-empheq-env-overload (env &optional _ignore)
+ "Insert amsmath ENV's when option overload is given to empheq package.
+This function combines the capabilities of `LaTeX-env-label' and
+`LaTeX-amsmath-env-alignat'. It overwrites the definitions of
+`amsmath.el'."
+ (if (or (string= env "alignat")
+ (string= env "alignat*"))
+ (let ((ncols (TeX-read-string
+ (TeX-argument-prompt nil nil "Number of columns")))
+ (keyvals (TeX-read-key-val t
+ LaTeX-empheq-key-val-options-local
+ "empheq options (k=v)")))
+ (LaTeX-insert-environment env (concat TeX-grop ncols TeX-grcl
+ (when (and keyvals (not (string= keyvals "")))
+ (concat LaTeX-optop keyvals LaTeX-optcl))))
+ (LaTeX-item-equation-alignat t))
+ (let ((keyvals
+ (TeX-read-key-val t LaTeX-empheq-key-val-options-local "empheq options (k=v)")))
+ (LaTeX-insert-environment env (when (and keyvals (not (string= keyvals "")))
+ (concat LaTeX-optop keyvals LaTeX-optcl)))
+ (when (and (assoc env LaTeX-label-alist)
+ (LaTeX-label env 'environment))
+ (LaTeX-newline)
+ (indent-according-to-mode)))))
+
+(defun LaTeX-empheq-item-equation ()
+ "Insert contents to terminate a line in multi-line equations environment.
+Put line break macro on the last line. Next, if the current
+environment wants \\label, insert it also. And insert suitable
+number of ampersands if possible."
+ (let ((env (LaTeX-current-environment))
+ amsenv ncols match)
+ (save-excursion
+ (LaTeX-find-matching-begin)
+ (re-search-forward (concat (regexp-quote TeX-esc)
+ "begin" TeX-grop env TeX-grcl))
+ (when (looking-at "[ \t\n\r%]*\\[")
+ (forward-sexp))
+ (re-search-forward "[ \t\n\r%]*{\\([^}]+\\)}")
+ (setq match (TeX-replace-regexp-in-string "[ \t\n\r%]" ""
+ (match-string-no-properties 1)))
+ (if (string-match "=" match)
+ (progn
+ (setq amsenv (car (split-string match "=")))
+ (setq ncols (string-to-number (cadr (split-string match "=")))))
+ (setq amsenv match)))
+ ;; Do not ask for "\\" if in "equation" or "equation*" since these
+ ;; are single line equations only
+ (if (or (string= amsenv "equation")
+ (string= amsenv "equation*"))
+ ;; Nullify the effect of `M-RET'
+ (progn
+ (message "This environment does not support multi-line equations")
+ (end-of-line 0)
+ (kill-line 1))
+ (progn
+ (end-of-line 0)
+ (just-one-space)
+ (TeX-insert-macro "\\")
+ (forward-line 1)
+ (indent-according-to-mode)))
+ ;; Add a new label only if not in "equation"
+ (when (and (not (string= amsenv "equation"))
+ (assoc amsenv LaTeX-label-alist)
+ (LaTeX-label amsenv 'environment))
+ (LaTeX-newline)
+ (indent-according-to-mode))
+ (when ncols
+ (save-excursion
+ (insert (make-string (+ ncols ncols -1) ?&))))))
+
+(TeX-add-style-hook
+ "empheq"
+ (lambda ()
+
+ ;; Add empheq to parser
+ (TeX-auto-add-regexp LaTeX-empheq-declaredelimiter-regexp)
+
+ ;; Load amsmath.el and mathtools.el
+ (TeX-run-style-hooks "amsmath" "mathtools")
+
+ ;; Add elements from `LaTeX-mathtools-package-options' only once
+ ;; and not every time the style hook runs
+ (dolist (elt LaTeX-mathtools-package-options)
+ (add-to-list 'LaTeX-empheq-package-options elt))
+
+ ;; Local version of key-val options
+ (setq LaTeX-empheq-key-val-options-local
+ (copy-alist LaTeX-empheq-key-val-options))
+
+ ;; Initial update of key-vals
+ (LaTeX-empheq-update-key-val-options)
+
+ (LaTeX-add-environments
+ '("empheq" LaTeX-empheq-env))
+
+ ;; Add "empheq" to `LaTeX-item-list' and run
+ ;; `LaTeX-empheq-item-equation' when `M-RET' is invoked
+ (add-to-list 'LaTeX-item-list '("empheq" . LaTeX-empheq-item-equation) t)
+
+ ;; Reftex support: Use `reftex-add-label-environments'
+ (when (fboundp 'reftex-add-label-environments)
+ (reftex-add-label-environments '(("empheq" ?e nil nil t))))
+
+ (TeX-add-symbols
+ '("empheqset" (TeX-arg-key-val LaTeX-empheq-key-val-options-local))
+
+ ;; 1.4 Special delimiters
+ ;; Normal
+ '("empheqlbrace" TeX-arg-insert-right-brace-maybe)
+ '("empheqrbrace")
+ '("empheqlbrack" TeX-arg-insert-right-brace-maybe)
+ '("empheqrbrack")
+ '("empheqlangle" TeX-arg-insert-right-brace-maybe)
+ '("empheqrangle")
+ '("empheqlparen" TeX-arg-insert-right-brace-maybe)
+ '("empheqrparen")
+ '("empheqlvert" TeX-arg-insert-right-brace-maybe)
+ '("empheqrvert")
+ '("empheqlVert" TeX-arg-insert-right-brace-maybe)
+ '("empheqrVert")
+ '("empheqlfloor" TeX-arg-insert-right-brace-maybe)
+ '("empheqrfloor")
+ '("empheqlceil" TeX-arg-insert-right-brace-maybe)
+ '("empheqrceil")
+ ;; Bigger
+ '("empheqbiglbrace" TeX-arg-insert-right-brace-maybe)
+ '("empheqbigrbrace")
+ '("empheqbiglbrack" TeX-arg-insert-right-brace-maybe)
+ '("empheqbigrbrack")
+ '("empheqbiglangle" TeX-arg-insert-right-brace-maybe)
+ '("empheqbigrangle")
+ '("empheqbiglparen" TeX-arg-insert-right-brace-maybe)
+ '("empheqbigrparen")
+ '("empheqbiglvert" TeX-arg-insert-right-brace-maybe)
+ '("empheqbigrvert")
+ '("empheqbiglVert" TeX-arg-insert-right-brace-maybe)
+ '("empheqbigrVert")
+ '("empheqbiglfloor" TeX-arg-insert-right-brace-maybe)
+ '("empheqbigrfloor")
+ '("empheqbiglceil" TeX-arg-insert-right-brace-maybe)
+ '("empheqbigrceil"))
+
+ ;; Append delimiters to `TeX-braces-association'
+ (make-local-variable 'TeX-braces-association)
+ (let ((delimiters '(("\\empheqlbrace" . "\\empheqrbrace")
+ ("\\empheqlbrack" . "\\empheqrbrack")
+ ("\\empheqlangle" . "\\empheqrangle")
+ ("\\empheqlparen" . "\\empheqrparen")
+ ("\\empheqlvert" . "\\empheqrvert")
+ ("\\empheqlVert" . "\\empheqrVert")
+ ("\\empheqlfloor" . "\\empheqrfloor")
+ ("\\empheqlceil" . "\\empheqrceil")
+ ("\\empheqbiglbrace" . "\\empheqbigrbrace")
+ ("\\empheqbiglbrack" . "\\empheqbigrbrack")
+ ("\\empheqbiglangle" . "\\empheqbigrangle")
+ ("\\empheqbiglparen" . "\\empheqbigrparen")
+ ("\\empheqbiglvert" . "\\empheqbigrvert")
+ ("\\empheqbiglVert" . "\\empheqbigrVert")
+ ("\\empheqbiglfloor" . "\\empheqbigrfloor")
+ ("\\empheqbiglceil" . "\\empheqbigrceil"))))
+ (dolist (elt delimiters)
+ (add-to-list 'TeX-braces-association elt t)))
+
+ ;; 2.2.1 Using multline
+ (when (LaTeX-provided-package-options-member "empheq" "oldmultline")
+ (LaTeX-add-environments
+ '("MTmultlined" LaTeX-mathtools-env-multlined)))
+
+ ;; 2.2.2 The overload option
+ ;; I simplify it and ignore the additional feature overload2:
+ (when (or (LaTeX-provided-package-options-member "empheq" "overload")
+ (LaTeX-provided-package-options-member "empheq" "overload2"))
+ (LaTeX-add-environments
+ '("align" LaTeX-empheq-env-overload)
+ '("alignat" LaTeX-empheq-env-overload)
+ '("equation" LaTeX-empheq-env-overload)
+ '("flalign" LaTeX-empheq-env-overload)
+ '("gather" LaTeX-empheq-env-overload)
+ '("multline" LaTeX-empheq-env-overload)
+ '("align*" LaTeX-env-args [TeX-arg-key-val LaTeX-empheq-key-val-options-local])
+ '("alignat*" LaTeX-empheq-env-overload)
+ '("equation*" LaTeX-env-args [TeX-arg-key-val LaTeX-empheq-key-val-options-local])
+ '("flalign*" LaTeX-env-args [TeX-arg-key-val LaTeX-empheq-key-val-options-local])
+ '("gather*" LaTeX-env-args [TeX-arg-key-val LaTeX-empheq-key-val-options-local])
+ '("multline*" LaTeX-env-args [TeX-arg-key-val LaTeX-empheq-key-val-options-local])
+
+ ;; Original definitions are stored prefixed with "AmS"
+ '("AmSalign" LaTeX-env-label)
+ '("AmSalignat" LaTeX-amsmath-env-alignat)
+ '("AmSequation" LaTeX-env-label)
+ '("AmSflalign" LaTeX-env-label)
+ '("AmSgather" LaTeX-env-label)
+ '("AmSmultline" LaTeX-env-label)
+ '("AmSalign*")
+ '("AmSalignat*" LaTeX-amsmath-env-alignat)
+ '("AmSequation*")
+ '("AmSflalign*")
+ '("AmSgather*")
+ '("AmSmultline*"))
+
+ ;; Append original definitions to `LaTeX-label-alist'
+ (let ((envs '("AmSalign"
+ "AmSalignat"
+ "AmSequation"
+ "AmSflalign"
+ "AmSgather"
+ "AmSmultline")))
+ (dolist (env envs)
+ (add-to-list 'LaTeX-label-alist `(,env . LaTeX-amsmath-label) t)))
+
+ ;; RefTeX support: Add original definitions with `reftex-add-label-environments'
+ (when (fboundp 'reftex-add-label-environments)
+ (let ((envs '(("AmSalign" ?e nil nil eqnarray-like)
+ ("AmSequation" ?e nil nil t)
+ ("AmSgather" ?e nil nil eqnarray-like)
+ ("AmSmultline" ?e nil nil t)
+ ("AmSflalign" ?e nil nil eqnarray-like)
+ ("AmSalignat" ?e nil nil alignat-like))))
+ (dolist (env envs)
+ (reftex-add-label-environments `(,env)))))
+
+ ;; Append original definitions to `LaTeX-item-list'; functions
+ ;; are provided by amsmath.el
+ (let ((envs '(("AmSalign" . LaTeX-item-equation)
+ ("AmSalign*" . LaTeX-item-equation)
+ ("AmSflalign" . LaTeX-item-equation)
+ ("AmSalignat" . LaTeX-item-equation-alignat)
+ ("AmSalignat*" . LaTeX-item-equation-alignat)
+ ("AmSflalign*" . LaTeX-item-equation)
+ ("AmSgather" . LaTeX-item-equation)
+ ("AmSgather*" . LaTeX-item-equation)
+ ("AmSmultline" . LaTeX-item-equation)
+ ("AmSmultline*" . LaTeX-item-equation))))
+ (dolist (env envs)
+ (add-to-list 'LaTeX-item-list env t)))
+
+ ;; Ispell skip lists:
+ (TeX-ispell-skip-setcdr
+ `(,(cons (concat "\\(AmS\\(?:align\\(?:\\*\\|at\\*?\\)?\\|"
+ "equation\\*?\\|flalign\\*?\\|gather\\*?\\|multline\\*?\\)\\)")
+ (concat "\\\\end{"
+ "\\(AmS\\(?:align\\(?:\\*\\|at\\*?\\)?\\|"
+ "equation\\*?\\|flalign\\*?\\|gather\\*?\\|multline\\*?\\)\\)}")))))
+
+ ;; 3.2 Support for ntheorem
+ (LaTeX-add-lengths "mintagvsep")
+
+ ;; 4.1 Creating your own delimiters
+ (TeX-add-symbols
+ '("DeclareLeftDelimiter"
+ [ "Space adjustment" ]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((delim (TeX-read-string (concat "Delimiter: " TeX-esc))))
+ (TeX-add-symbols (concat "empheq" delim)
+ (concat "empheqbig" delim))
+ (LaTeX-add-empheq-declaredelimiters `(,delim "Left"))
+ (LaTeX-empheq-update-key-val-options)
+ (concat TeX-esc delim)))))
+
+ '("DeclareRightDelimiter"
+ [ "Space adjustment" ]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((delim (TeX-read-string (concat "Delimiter: " TeX-esc))))
+ (TeX-add-symbols (concat "empheq" delim)
+ (concat "empheqbig" delim))
+ (LaTeX-add-empheq-declaredelimiters `(,delim "Right"))
+ (LaTeX-empheq-update-key-val-options)
+ (concat TeX-esc delim))))))
+
+ ;; 4.2 Fine-tuning of delimiters
+ (LaTeX-add-lengths "EmphEqdelimitershortfall")
+ (LaTeX-add-counters "EmphEqdelimiterfactor")
+
+ (TeX-add-symbols
+ ;; 4.3 Scaling material yourself
+ '("EmphEqdisplayheight" 0)
+ '("EmphEqdisplaydepth" 0)
+ ;; 6.1 New empheq-like environments
+ '("EmphEqMainEnv" 0)
+ '("endEmphEqMainEnv" 0))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("empheqset" "{")
+ ("DeclareLeftDelimiter" "[{")
+ ("DeclareRightDelimiter" "[{"))
+ 'function)
+ ;; Append our addition so that we don't interfere with user customizations
+ (make-local-variable 'font-latex-math-environments)
+ (add-to-list 'font-latex-math-environments "empheq" t)
+ (when (or (LaTeX-provided-package-options-member "empheq" "overload")
+ (LaTeX-provided-package-options-member "empheq" "overload2"))
+ (let ((envs '(;; Do not insert the starred versions here;
+ ;; function `font-latex-match-math-envII' takes
+ ;; care of it
+ "AmSalign"
+ "AmSalignat"
+ "AmSequation"
+ "AmSflalign"
+ "AmSgather"
+ "AmSmultline")))
+ (dolist (env envs)
+ (add-to-list 'font-latex-math-environments env t))))))
+ LaTeX-dialect)
+
+;;; empheq.el ends here
--- /dev/null
+;;; enumitem.el --- AUCTeX style for `enumitem.sty' (v3.5.2)
+
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-10-20
+;; 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 `enumitem.sty' (v3.5.2) from 2011/09/28.
+;; `enumitem.sty' is part of TeXLive.
+
+;; Tassilo Horn's `minted.el' was a major source of inspiration for
+;; this style, many thanks to him (also for patiently answering my
+;; many other questions, incl. the stupid ones.)
+
+;; If things do not work or when in doubt, press `C-c C-n'. Comments
+;; for improvement are welcome.
+
+;;; Code:
+
+;; Needed for compiling `pushnew':
+(eval-when-compile (require 'cl))
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+(defvar LaTeX-enumitem-key-val-options
+ '(;; Vertical Spacing
+ ("topsep")
+ ("partopsep")
+ ("parsep")
+ ("itemsep")
+ ;; Horizontal Spacing
+ ("leftmargin" ("*" "!"))
+ ("itemindent" ("*" "!"))
+ ("labelsep" ("*" "!"))
+ ("labelwidth" ("*" "!"))
+ ("labelindent" ("*" "!"))
+ ("labelsep*")
+ ("labelindent*")
+ ("widest")
+ ("widest*")
+ ("rightmargin")
+ ;; Labels and cross reference format
+ ("label")
+ ("label*")
+ ("ref")
+ ("font")
+ ("format")
+ ("align" ("left" "right" "parleft"))
+ ;; Numbering, stopping, resuming
+ ("start")
+ ("resume")
+ ("resume*")
+ ;; Series
+ ("series")
+ ;; Penalties
+ ("beginpenalty")
+ ("midpenalty")
+ ("endpenalty")
+ ("before")
+ ("before*")
+ ("after")
+ ("after*")
+ ;; Description styles
+ ("style" ("standard" "multiline" "nextline" "sameline" "unboxed"))
+ ;; Compact lists
+ ("noitemsep")
+ ("nosep")
+ ;; Wide lists
+ ("wide")
+ ;; Inline lists
+ ("itemjoin")
+ ("itemjoin*")
+ ("afterlabel")
+ ("mode" ("boxed" "unboxed")))
+ "Key=value options for enumitem macros and environments.")
+
+(defvar LaTeX-enumitem-key-val-options-local nil
+ "Buffer-local key=value options for enumitem macros and environments.")
+(make-variable-buffer-local 'LaTeX-enumitem-key-val-options-local)
+
+(defvar LaTeX-enumitem-newlist-list-local nil
+ "Local list of all environments definded with `\\newlist' plus
+the ones initially available through `enumitem' package.")
+(make-variable-buffer-local 'LaTeX-enumitem-newlist-list-local)
+
+;; Setup for \newlist:
+
+(TeX-auto-add-type "enumitem-newlist" "LaTeX")
+
+(defvar LaTeX-enumitem-newlist-regexp
+ '("\\\\newlist{\\([^}]+\\)}{\\([^}]+\\)}"
+ (1 2) LaTeX-auto-enumitem-newlist)
+ "Matches the arguments of `\\newlist' from `enumitem'
+package.")
+
+;; Setup for \SetLabelAlign:
+
+(TeX-auto-add-type "enumitem-SetLabelAlign" "LaTeX")
+
+(defvar LaTeX-enumitem-SetLabelAlign-regexp
+ '("\\\\SetLabelAlign{\\([^}]+\\)}"
+ 1 LaTeX-auto-enumitem-SetLabelAlign)
+ "Matches the argument of `\\SetLabelAlign' from `enumitem'
+package.")
+
+;; Setup for \SetEnumitemKey:
+
+(TeX-auto-add-type "enumitem-SetEnumitemKey" "LaTeX")
+
+(defvar LaTeX-enumitem-SetEnumitemKey-regexp
+ '("\\\\SetEnumitemKey{\\([^}]+\\)}"
+ 1 LaTeX-auto-enumitem-SetEnumitemKey)
+ "Matches the arguments of `\\SetEnumitemKey' from `enumitem'
+package.")
+
+;; Setup for \SetEnumitemValue:
+
+(TeX-auto-add-type "enumitem-SetEnumitemValue" "LaTeX")
+
+;; Upon Tassilo's recommendation, we include also `0' so that we can
+;; use the function `LaTeX-enumitem-SetEnumitemValue-list' while we
+;; make sure that `TeX-auto-list-information' doesn't remove multiple
+;; defined values to a specific key. For this reason, we also ignore
+;; the 3. argument to the `\SetEnumitemValue' macro (i.e., a third
+;; {\\([^}]+\\)} in regex) so that we don't pollute the generated
+;; `docname.el' with unnecessary (La)TeX code.
+(defvar LaTeX-enumitem-SetEnumitemValue-regexp
+ '("\\\\SetEnumitemValue{\\([^}]+\\)}{\\([^}]+\\)}"
+ (0 1 2) LaTeX-auto-enumitem-SetEnumitemValue)
+ "Matches the arguments of `\\SetEnumitemValue' from `enumitem'
+package.")
+
+;; Plug them into the machinery.
+(defun LaTeX-enumitem-auto-prepare ()
+ "Clear various `LaTeX-enumitem-*' before parsing."
+ (setq LaTeX-auto-enumitem-newlist nil
+ LaTeX-auto-enumitem-SetLabelAlign nil
+ LaTeX-auto-enumitem-SetEnumitemKey nil
+ LaTeX-auto-enumitem-SetEnumitemValue nil))
+
+(defun LaTeX-enumitem-auto-cleanup ()
+ "Move parsing results into right places for further usage."
+ ;; \newlist{<name>}{<type>}{<max-depth>}
+ ;; env=<name>, type=<type>, ignored=<max-depth>
+ (dolist (env-type (LaTeX-enumitem-newlist-list))
+ (let* ((env (car env-type))
+ (type (cadr env-type)))
+ (LaTeX-add-environments (list env 'LaTeX-enumitem-env-with-opts))
+ ;; Tell AUCTeX about parsed description like environments.
+ (when (or (string-equal type "description")
+ (string-equal type "description*"))
+ (add-to-list 'LaTeX-item-list `(,env . LaTeX-item-argument)))
+ ;; Add new env's to `ispell-tex-skip-alist': skip the optional argument
+ (TeX-ispell-skip-setcdr `((,env ispell-tex-arg-end 0)))))
+ ;; Now add the parsed env's to the local list.
+ (when (LaTeX-enumitem-newlist-list)
+ (setq LaTeX-enumitem-newlist-list-local
+ (append (mapcar 'list (mapcar 'car (LaTeX-enumitem-newlist-list)))
+ LaTeX-enumitem-newlist-list-local))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-enumitem-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-enumitem-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun LaTeX-enumitem-env-with-opts (env)
+ "Update available key-val options, then insert ENV and optional
+key-val and the first item."
+ (LaTeX-enumitem-update-key-val-options)
+ (LaTeX-insert-environment
+ env
+ (let ((opts (TeX-read-key-val t LaTeX-enumitem-key-val-options-local)))
+ (when (and opts (not (string-equal opts "")))
+ (format "[%s]" opts))))
+ (if (TeX-active-mark)
+ (progn
+ (LaTeX-find-matching-begin)
+ (end-of-line 1))
+ (end-of-line 0))
+ (delete-char 1)
+ (when (looking-at (concat "^[ \t]+$\\|"
+ "^[ \t]*" TeX-comment-start-regexp "+[ \t]*$"))
+ (delete-region (point) (line-end-position)))
+ (delete-horizontal-space)
+ ;; Deactivate the mark here in order to prevent `TeX-parse-macro'
+ ;; from swapping point and mark and the \item ending up right after
+ ;; \begin{...}.
+ (TeX-deactivate-mark)
+ (LaTeX-insert-item)
+ ;; The inserted \item may have outdented the first line to the
+ ;; right. Fill it, if appropriate.
+ (when (and (not (looking-at "$"))
+ (not (assoc env LaTeX-indent-environment-list))
+ (> (- (line-end-position) (line-beginning-position))
+ (current-fill-column)))
+ (LaTeX-fill-paragraph nil)))
+
+(defun LaTeX-arg-SetLabelAlign (optional)
+ "Ask for new type (value) for the \"align\" key and add it to
+`LaTeX-enumitem-key-val-options-local'."
+ (LaTeX-enumitem-update-key-val-options)
+ (let ((val (TeX-read-string "Alignment: ")))
+ (TeX-argument-insert val optional)
+ (LaTeX-add-enumitem-SetLabelAligns val)))
+
+(defun LaTeX-arg-SetEnumitemKey (optional)
+ "Ask for a new key to be defined and add it to
+`LaTeX-enumitem-key-val-options-local'."
+ (LaTeX-enumitem-update-key-val-options)
+ (let ((key (TeX-read-string "New Key: "))
+ (replace (TeX-read-key-val optional
+ LaTeX-enumitem-key-val-options-local "Replacement")))
+ (TeX-argument-insert key optional)
+ (TeX-argument-insert replace optional)
+ (LaTeX-add-enumitem-SetEnumitemKeys key)))
+
+;; In `LaTeX-enumitem-SetEnumitemValue-regexp', we match (0 1 2).
+;; When adding a new `key=val', we need something unique for `0'-match
+;; until the next `C-c C-n'. We mimic that regex-match bei concat'ing
+;; the elements and pass the result to
+;; `LaTeX-add-enumitem-SetEnumitemValues'. It will vanish upon next
+;; invocation of `C-c C-n'.
+(defun LaTeX-arg-SetEnumitemValue (optional)
+ "Ask for a new value added to an existing key incl. the final
+replacement of the value."
+ (LaTeX-enumitem-update-key-val-options)
+ (let ((key (completing-read "Key: " LaTeX-enumitem-key-val-options-local))
+ (val (TeX-read-string "String value: ")))
+ (TeX-argument-insert key optional)
+ (TeX-argument-insert val optional)
+ (LaTeX-add-enumitem-SetEnumitemValues
+ (list (concat "\\SetEnumitemValue{" key "}{" val "}")
+ key val))))
+
+(defun LaTeX-enumitem-update-key-val-options ()
+ "Update the buffer-local key-val options before offering them
+in `enumitem'-completions."
+ (dolist (key (LaTeX-enumitem-SetEnumitemKey-list))
+ (add-to-list 'LaTeX-enumitem-key-val-options-local key))
+ (dolist (keyvals (LaTeX-enumitem-SetEnumitemValue-list))
+ (let* ((key (nth 1 keyvals))
+ (val (nth 2 keyvals))
+ ;; (key-match (car (assoc key LaTeX-enumitem-key-val-options-local)))
+ (val-match (cdr (assoc key LaTeX-enumitem-key-val-options-local)))
+ (temp (copy-alist LaTeX-enumitem-key-val-options-local))
+ (opts (assq-delete-all (car (assoc key temp)) temp)))
+ (if val-match
+ (pushnew (list key (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
+ opts :test #'equal)
+ (pushnew (list key (list val)) opts :test #'equal))
+ (setq LaTeX-enumitem-key-val-options-local (copy-alist opts))))
+ (dolist (newalign (LaTeX-enumitem-SetLabelAlign-list))
+ (let* ((key "align")
+ (val (car newalign))
+ (val-match (cdr (assoc key LaTeX-enumitem-key-val-options-local)))
+ (temp (copy-alist LaTeX-enumitem-key-val-options-local))
+ (opts (assq-delete-all (car (assoc key temp)) temp)))
+ (pushnew (list key (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
+ opts :test #'equal)
+ (setq LaTeX-enumitem-key-val-options-local (copy-alist opts)))))
+
+(TeX-add-style-hook
+ "enumitem"
+ (lambda ()
+
+ ;; Add enumitem to the parser.
+ (TeX-auto-add-regexp LaTeX-enumitem-newlist-regexp)
+ (TeX-auto-add-regexp LaTeX-enumitem-SetEnumitemKey-regexp)
+ (TeX-auto-add-regexp LaTeX-enumitem-SetEnumitemValue-regexp)
+ (TeX-auto-add-regexp LaTeX-enumitem-SetLabelAlign-regexp)
+
+ ;; Activate the buffer-local version of key-vals.
+ (setq LaTeX-enumitem-key-val-options-local
+ (copy-alist LaTeX-enumitem-key-val-options))
+
+ ;; Set the standard env's to the local list.
+ (setq LaTeX-enumitem-newlist-list-local
+ '(("itemize") ("enumerate") ("description")))
+
+ ;; Add the starred versions to the local list.
+ (when (LaTeX-provided-package-options-member "enumitem" "inline")
+ (setq LaTeX-enumitem-newlist-list-local
+ (append '(("itemize*") ("enumerate*") ("description*"))
+ LaTeX-enumitem-newlist-list-local)))
+
+ ;; Standard env's take key-val as optional argument.
+ (LaTeX-add-environments
+ '("itemize" LaTeX-enumitem-env-with-opts)
+ '("enumerate" LaTeX-enumitem-env-with-opts)
+ '("description" LaTeX-enumitem-env-with-opts))
+
+ ;; Make inline env's available with package option "inline"
+ (when (LaTeX-provided-package-options-member "enumitem" "inline")
+ (LaTeX-add-environments
+ '("itemize*" LaTeX-enumitem-env-with-opts)
+ '("enumerate*" LaTeX-enumitem-env-with-opts)
+ '("description*" LaTeX-enumitem-env-with-opts))
+ (add-to-list 'LaTeX-item-list '("description*" . LaTeX-item-argument)))
+
+ ;; Cloning lists
+ (TeX-add-symbols
+ ;; The easy way would be:
+ ;; '("newlist"
+ ;; "Name" (TeX-arg-eval
+ ;; completing-read "Type: "
+ ;; '(("itemize") ("enumerate") ("description")
+ ;; ("itemize*") ("enumerate*") ("description*")))
+ ;; "Max-depth")
+ ;; But we go the extra mile to improve the user experience and add
+ ;; the arguments directly to appropriate lists.
+ ;; \newlist{<name>}{<type>}{<max-depth>}
+ '("newlist"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((name (TeX-read-string "Name: "))
+ (type (completing-read
+ "Type: "
+ '(("itemize") ("enumerate") ("description")
+ ("itemize*") ("enumerate*") ("description*"))))
+ (depth (TeX-read-string "Max-depth: ")))
+ (setq LaTeX-enumitem-newlist-list-local
+ (append `(,(list name)) LaTeX-enumitem-newlist-list-local))
+ (when (or (string-equal type "description")
+ (string-equal type "description*"))
+ (add-to-list 'LaTeX-item-list `(,name . LaTeX-item-argument)))
+ (LaTeX-add-environments `(,name LaTeX-enumitem-env-with-opts))
+ (LaTeX-add-enumitem-newlists (list name type))
+ (TeX-ispell-skip-setcdr `((,name ispell-tex-arg-end 0)))
+ (TeX-argument-insert name optional)
+ (TeX-argument-insert type optional)
+ (format "%s" depth)))))
+
+ ;; \renewlist{<name>}{<type>}{<max-depth>}
+ '("renewlist"
+ (TeX-arg-eval completing-read "Name: "
+ LaTeX-enumitem-newlist-list-local)
+ (TeX-arg-eval completing-read "Type: "
+ '(("itemize") ("enumerate") ("description")
+ ("itemize*") ("enumerate*") ("description*")))
+ "Max-depth")
+
+ ;; \setlist[<names,levels>]{<key-vals>}
+ '("setlist"
+ [TeX-arg-eval mapconcat #'identity
+ (TeX-completing-read-multiple
+ "Environment(s), level(s): "
+ `(,@LaTeX-enumitem-newlist-list-local
+ ("1") ("2") ("3") ("4"))) ","]
+ (TeX-arg-eval
+ (lambda ()
+ (LaTeX-enumitem-update-key-val-options)
+ (let ((opts (TeX-read-key-val nil LaTeX-enumitem-key-val-options-local)))
+ (format "%s" opts)))))
+
+ ;; \setlist*[<names,levels>]{<key-vals>}
+ '("setlist*"
+ [TeX-arg-eval mapconcat #'identity
+ (TeX-completing-read-multiple
+ "Environment, level: "
+ `(,@LaTeX-enumitem-newlist-list-local
+ ("1") ("2") ("3") ("4"))) ","]
+ (TeX-arg-eval
+ (lambda ()
+ (LaTeX-enumitem-update-key-val-options)
+ (let ((opts (TeX-read-key-val nil LaTeX-enumitem-key-val-options-local)))
+ (format "%s" opts))))) )
+
+ ;; General commands:
+ (TeX-add-symbols
+
+ ;; Ask for an Integer and insert it.
+ '("setlistdepth" "Integer")
+
+ ;; Just add the braces and let the user do the rest.
+ '("AddEnumerateCounter" 3)
+ '("AddEnumerateCounter*" 3)
+
+ ;; "\restartlist" only works for lists defined with "resume" key.
+ ;; We will not extract that information and leave that to users.
+ ;; For completion, extract enumerated environments from
+ ;; `LaTeX-enumitem-newlist-list' and add "enumerate" to them.
+ '("restartlist"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((enums '("enumerate")))
+ (when (LaTeX-provided-package-options-member "enumitem" "inline")
+ (pushnew "enumerate*" enums :test #'equal))
+ (dolist (env-type (LaTeX-enumitem-newlist-list))
+ (let ((env (car env-type))
+ (type (cadr env-type)))
+ (when (or (string-equal type "enumerate")
+ (string-equal type "enumerate*"))
+ (pushnew env enums :test #'equal))))
+ (completing-read "List name: " enums)))))
+
+ ;; "Align" is added as new value to "align" key in key-val list.
+ '("SetLabelAlign" LaTeX-arg-SetLabelAlign t)
+
+ ;; "Key" will be parsed and added to key-val list.
+ '("SetEnumitemKey" LaTeX-arg-SetEnumitemKey)
+
+ ;; "Key" and "Value" are added to our key-val list
+ '("SetEnumitemValue" LaTeX-arg-SetEnumitemValue "Replacement"))
+
+ ;; Setting enumerate short label
+ (when (LaTeX-provided-package-options-member "enumitem" "shortlabels")
+ (TeX-add-symbols
+ '("SetEnumerateShortLabel"
+ (TeX-arg-eval completing-read "Key: "
+ '(("A") ("a") ("I") ("i") ("1")))
+ "Replacement")))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("newlist" "{{{")
+ ("renewlist" "{{{")
+ ("setlist" "*[{")
+ ("AddEnumerateCounter" "*{{{")
+ ("SetLabelAlign" "{{")
+ ("SetEnumitemKey" "{{" )
+ ("SetEnumitemValue" "{{{"))
+ 'function)
+ (font-latex-add-keywords '(("restartlist" "{" )
+ ("setlistdepth" "{" )
+ ("SetEnumerateShortLabel" "{{"))
+ 'variable)))
+ LaTeX-dialect)
+
+(defvar LaTeX-enumitem-package-options
+ '("inline" "ignoredisplayed" "shortlabels" "loadonly")
+ "Package options for the enumitem package.")
+
+;;; enumitem.el ends here
--- /dev/null
+;;; environ.el --- AUCTeX style for `environ.sty' version v0.3
+
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-07-04
+;; 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 `environ.sty' version v0.3 from
+;; 2014/05/04. `environ.sty' is part of TeXLive.
+
+;; Name of new env's defined with `\NewEnviron' are automatically
+;; added to list of known env's, e.g.:
+;;
+;; \NewEnviron{test}{<macro code>}
+;;
+;; `test' will be in completion list upon `C-c C-e'.
+
+;; More sophisticated definions must go through AUCTeX's parser, e.g.:
+;;
+;; \NewEnviron{test}[2][]{<macro code>}
+;;
+;; After a definition like this, you have to invoke `C-c C-n' to get
+;; the correct completion.
+
+;;; Code:
+
+(defvar LaTeX-auto-environ-NewEnviron nil
+ "Temporary for parsing the arguments of `\\NewEnviron'
+from `environ' package.")
+
+(defvar LaTeX-environ-NewEnviron-regexp
+ `(,(concat "\\\\\\(?:Ren\\|N\\)ewEnviron"
+ "[ \t\n\r]*{\\([A-Za-z0-9]+\\)}%?"
+ "[ \t\n\r]*\\[?\\([0-9]?\\)\\]?%?"
+ "[ \t\n\r]*\\(\\[\\)?")
+ (1 2 3) LaTeX-auto-environ-NewEnviron)
+ "Matches the argument of `\\NewEnviron' and `\\RenewEnviron'
+from `environ.sty'.")
+
+(defun LaTeX-environ-auto-prepare ()
+ "Clear temporary variable from `environ.sty' before parsing."
+ (setq LaTeX-auto-environ-NewEnviron nil))
+
+(defun LaTeX-environ-auto-cleanup ()
+ "Process the parsed results of `\\NewEnviron'."
+ (dolist (env-args LaTeX-auto-environ-NewEnviron)
+ (let ((env (car env-args))
+ (args (cadr env-args))
+ (opt (nth 2 env-args)))
+ (cond (;; opt. 1st argument and mandatory argument(s)
+ (and args (not (string-equal args ""))
+ opt (not (string-equal opt "")))
+ (add-to-list 'LaTeX-auto-environment
+ (list env 'LaTeX-env-args (vector "argument")
+ (1- (string-to-number args)))))
+ (;; mandatory argument(s) only
+ (and args (not (string-equal args ""))
+ (string-equal opt ""))
+ (add-to-list 'LaTeX-auto-environment
+ (list env (string-to-number args))))
+ (t ; No args
+ (add-to-list 'LaTeX-auto-environment (list env)))))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-environ-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-environ-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun TeX-arg-environ-final-code (_optional)
+ "Query for the presence of optional `final code' as argument to
+`\\NewEnviron' and insert the appropriate brackets."
+ (let ((fincode (y-or-n-p "With optional final code? ")))
+ (when fincode
+ (insert "[]"))))
+
+(TeX-add-style-hook
+ "environ"
+ (lambda ()
+
+ ;; Add it to the parser
+ (TeX-auto-add-regexp LaTeX-environ-NewEnviron-regexp)
+
+ (TeX-add-symbols
+
+ ;; \NewEnviron{<name>}[<No.args>][<Opt.arg.>]{<Macro code>}[<Final code>]
+ '("NewEnviron"
+ (TeX-arg-define-environment "Environment")
+ [ "Number of arguments" ] [ "argument" ] t TeX-arg-environ-final-code)
+
+ '("RenewEnviron"
+ (TeX-arg-environment "Environment")
+ [ "Number of arguments" ] [ "argument" ] t TeX-arg-environ-final-code)
+
+ ;; Insert a pair of braces and we're done
+ '("environfinalcode" t)
+
+ ;; Pre-defined
+ '("BODY")
+
+ ;; Define another macro instead of \BODY
+ '("environbodyname" TeX-arg-define-macro))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("NewEnviron" "{[[{[")
+ ("RenewEnviron" "{[[{[")
+ ("environbodyname" "|{\\"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-environ-package-options nil
+ "Package options for the environ package.")
+
+;;; environ.el ends here
--- /dev/null
+;;; erewhon.el --- AUCTeX style for `erewhon.sty' (v1.04)
+
+;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-11-18
+;; 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 `erewhon.sty' (v1.04) from 2015/04/07.
+;; `erewhon.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "erewhon"
+ (lambda ()
+
+ ;; Run style hook for various packages loaded by erewhon
+ (TeX-run-style-hooks "textcomp" "fontaxes")
+
+ ;; New symbols
+ (TeX-add-symbols
+
+ ;; Only preamble commands
+ '("useosf" 0)
+ '("useproportional" 0)
+
+ ;; Text commands
+ '("lfstyle" -1) ; lf declaration
+ '("tlfstyle" -1) ; tlf declaration
+ '("osfstyle" -1) ; osf declaration
+ '("tosfstyle" -1) ; tosf declaration
+ '("sufigures" -1) ; superior figures declaration
+ '("textlf" t) ; proportional lining figures
+ '("texttlf" t) ; tabular lining figures
+ '("textosf" t) ; proportional oldstyle figures
+ '("texttosf" t) ; tabular oldstyle figures
+ '("textsu" t) ; superior figures
+ '("textin" t) ; inferior figures
+ '("textnu" t) ; numerator figures
+ '("textde" t) ; denominator figures
+ '("textfrac" "Numerator" "Denominator"))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("textlf" "{")
+ ("texttlf" "{")
+ ("textosf" "{")
+ ("texttosf" "{")
+ ("textsu" "{")
+ ("textin" "{")
+ ("textnu" "{")
+ ("textde" "{"))
+ 'type-command)
+ (font-latex-add-keywords '(("lfstyle" "")
+ ("tlfstyle" "")
+ ("osfstyle" "")
+ ("tosfstyle" "")
+ ("sufigures" ""))
+ 'type-declaration)
+ (font-latex-add-keywords '(("textfrac" "{{"))
+ 'textual)))
+ LaTeX-dialect)
+
+(defvar LaTeX-erewhon-package-options
+ '("lining" "lf" "oldstyle" "osf" "tabular" "p" "proportional"
+ "scale" "scaled" "scosf" "space" "sups")
+ "Package options for the erewhon package.")
+
+;;; erewhon.el ends here
--- /dev/null
+;;; eso-pic.el --- AUCTeX style for `eso-pic.sty' (v2.0d)
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-10-29
+;; 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 `eso-pic.sty' (v2.0d) from 2013/10/06.
+;; `eso-pic.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "eso-pic"
+ (lambda ()
+
+ ;; Run style hook for eso-pic
+ (TeX-run-style-hooks "atbegshi")
+
+ ;; New symbols
+ (TeX-add-symbols
+
+ ;; Basic commands
+ '("AddToShipoutPictureBG" t)
+ '("AddToShipoutPictureBG*" t)
+ '("AddToShipoutPictureFG" t)
+ '("AddToShipoutPictureFG*" t)
+ '("ClearShipoutPictureBG" 0)
+ '("ClearShipoutPictureFG" 0)
+
+ ;; Helper macros
+ '("AtPageUpperLeft" t)
+ '("AtPageLowerLeft" t)
+ '("AtPageCenter" t)
+ '("AtTextUpperLeft" t)
+ '("AtTextLowerLeft" t)
+ '("AtTextCenter" t)
+ '("AtStockUpperLeft" t)
+ '("AtStockLowerLeft" t)
+ '("AtStockCenter" t)
+
+ ;; Aux. commands
+ '("LenToUnit" t)
+ '("gridSetup"
+ [ "Grid unit name" ] "Grid unit" "Label factor"
+ "Grid delta" "Grid Delta" "Gap"))
+
+ ;; Declare expert macro
+ (TeX-declare-expert-macros
+ "eso-pic"
+ "gridSetup" "LenToUnit"))
+ LaTeX-dialect)
+
+(defvar LaTeX-eso-pic-package-options-list
+ '(("pscoord" ("true" "false"))
+ ("texcoord" ("true" "false"))
+ ("grid" ("true" "false"))
+ ("gridunit" ("mm" "in" "bp" "pt"))
+ ("gridcolor")
+ ("subgridcolor")
+ ("subgridstyle" ("solid" "dotted"))
+ ("dvips" ("true" "false")))
+ "Package options for the eso-pic package.")
+
+(defun LaTeX-eso-pic-package-options nil
+ "Prompt for package options for the eso-pic package."
+ (TeX-read-key-val t LaTeX-eso-pic-package-options-list))
+
+;;; eso-pic.el ends here
--- /dev/null
+;;; exam.el --- AUCTeX style for the (LaTeX) exam class
+
+;; Copyright (C) 2016, 2017 Free Software Foundation, Inc.
+
+;; Author: Uwe Brauer <oub@mat.ucm.es>
+;; Created: 2016-03-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 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 exam class.
+
+;; Acknowledgements
+;; Arash Esbati <arash@gnu.org> for a almost complete rewrite.
+
+;;; Code:
+
+(defvar LaTeX-exam-class-options
+ '("answers" "noanswers" "cancelspace" "nocancelspace" "addpoints")
+ "Class options for the exam class.")
+
+(defun LaTeX-exam-insert-item ()
+ "Insert a new item in an environment from exam class.
+Item inserted depends on the environment."
+ (TeX-insert-macro
+ (cond ((string= environment "questions")
+ "question")
+ ((string= environment "parts")
+ "part")
+ ((string= environment "subparts")
+ "subpart")
+ ((string= environment "subsubparts")
+ "subsubpart")
+ ;; Fallback
+ (t "item"))))
+
+(defun LaTeX-exam-insert-label (_optional &optional name type)
+ "Indent the line and query/insert a label incl. the \"\\label\" macro.
+Arguments NAME and TYPE are the same as for the function
+`LaTeX-label'. OPTIONAL is ignored."
+ (indent-according-to-mode)
+ (let ((currenv (LaTeX-current-environment)))
+ (LaTeX-label (or name currenv) (or type 'environment))))
+
+(TeX-add-style-hook
+ "exam"
+ (lambda ()
+ (TeX-run-style-hooks "article")
+ ;; Add options from `LaTeX-article-class-options' only once:
+ (dolist (opt LaTeX-article-class-options)
+ (add-to-list 'LaTeX-exam-class-options opt))
+ ;; Make our label prefix available ...
+ (let ((envs '("questions")))
+ (dolist (env envs)
+ ;; to AUCTeX
+ (add-to-list 'LaTeX-label-alist
+ (cons env 'LaTeX-exam-label))
+ ;; to RefTeX with `reftex-add-label-environments'
+ (when (fboundp 'reftex-add-label-environments)
+ (reftex-add-label-environments
+ `((,env ,LaTeX-exam-reftex-quick-id-key ,LaTeX-exam-label
+ "~\\ref{%s}" nil
+ (regexp "[Qq]uestions?" "[Nn]umbers?")))))))
+ (when (or (member "xcolor" (TeX-style-list))
+ (member "color" (TeX-style-list)))
+ (TeX-add-symbols '("shadedsolutions" 0)))
+
+ (LaTeX-add-environments
+ '("solution" [ "Height" ])
+ '("select")
+ '("solutionorbox" [ "Height" ])
+ '("solutionorlines" [ "Height" ])
+ '("solutionordottedlines" [ "Height" ])
+ '("solutionorgrid" [ "Height" ])
+ '("questions" LaTeX-env-item)
+ '("parts" LaTeX-env-item)
+ '("subparts" LaTeX-env-item)
+ '("subsubparts" LaTeX-env-item))
+
+ ;; Tell AUCTeX about special environments:
+ (let ((envs '("questions" "parts" "subparts" "subsubparts")))
+ (dolist (env envs)
+ (add-to-list 'LaTeX-item-list
+ (cons env 'LaTeX-exam-insert-item))))
+
+ ;; Append us only once:
+ (unless (and (string-match "question" LaTeX-item-regexp)
+ (string-match "subsub" LaTeX-item-regexp))
+ (set (make-local-variable 'LaTeX-item-regexp)
+ (concat
+ LaTeX-item-regexp
+ "\\|"
+ "\\(titled\\)?question\\b"
+ "\\|"
+ "\\(sub\\|subsub\\)?part\\b"))
+ (LaTeX-set-paragraph-start))
+
+ (TeX-add-symbols
+ '("part" [ "Points" ] (TeX-arg-literal " "))
+ '("subpart" [ "Points" ] (TeX-arg-literal " "))
+ '("gradetable"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Orientation")
+ '("v" "h") ]
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Table index")
+ '("questions" "pages") ] )
+ '("bonusgradetable"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Orientation")
+ '("v" "h") ]
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Table index")
+ '("questions" "pages") ] )
+ '("bonuspointtable"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Orientation")
+ '("v" "h") ]
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Table index")
+ '("questions" "pages") ] )
+ '("partialgradetable"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Orientation")
+ '("v" "h") ]
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Table index")
+ '("questions" "pages") ] )
+ '("partialbonusgradetable"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Orientation")
+ '("v" "h") ]
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Table index")
+ '("questions" "pages") ] )
+ '("partialbonuspointtable"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Orientation")
+ '("v" "h") ]
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Table index")
+ '("questions" "pages") ] )
+ '("pointtable"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Orientation")
+ '("v" "h") ]
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Table index")
+ '("questions" "pages") ] )
+ '("partialpointtable"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Orientation")
+ '("v" "h") ]
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Table index")
+ '("questions" "pages") ] )
+
+ '("subsubpart" [ "Points" ] (TeX-arg-literal " "))
+ '("question" ["Points"] (TeX-arg-literal " "))
+ '("bonusquestion" ["Points"] (TeX-arg-literal " "))
+ '("extrafootheight" [ TeX-arg-length "Extra height 1. page footer" ]
+ (TeX-arg-length "Extra height footers"))
+ '("titledquestion" "Title" ["Points"] LaTeX-exam-insert-label (TeX-arg-literal " "))
+ '("ContinuedQuestion" 0)
+ '("CorrectChoice" 0)
+ '("CorrectChoiceEmphasis" 1)
+ '("IncompleteQuestion" 0)
+ '("SolutionEmphasis" 1)
+ '("addpoints" 0)
+ '("addquestionobject" 0)
+ '("answerclearance" 1)
+ '("answerline" ["Points"] (TeX-arg-literal " "))
+ '("begingradingrange" 1)
+ '("bhpgword" 1)
+ '("bhpword" 1)
+ '("bhqword" 1)
+ '("bhsword" 1)
+ '("bhtword" 1)
+ '("bonuspart" 0)
+ '("bonuspointformat" 0)
+ '("bonuspointname" 1)
+ '("bonuspointpoints" 2)
+ '("bonuspointsinrange" 0)
+ '("bonuspointsofquestion" 1)
+ '("bonuspointsonpage" 0)
+ '("bonusqformat" 1)
+ '("bonussubpart" 0)
+ '("bonussubsubpart" 0)
+ '("bonustitledquestion" "Title" ["Points"] LaTeX-exam-insert-label (TeX-arg-literal " "))
+ '("bonustotalformat" 0)
+ '("boxedpoints" 0)
+ '("bracketedpoints" 0)
+ '("bvpgword" 1)
+ '("bvpword" 1)
+ '("bvqword" 1)
+ '("bvsword" 1)
+ '("bvtword" 1)
+ '("cancelspace" 0)
+ '("cellwidth" 1)
+ '("cfoot" 1)
+ '("chbpword" 1)
+ '("chead" 1)
+ '("checkboxchar" 1)
+ '("checkboxeshook" 0)
+ '("checkedchar" 1)
+ '("choice" 0)
+ '("choicelabel" 0)
+ '("choiceshook" 0)
+ '("chpgword" 1)
+ '("chpword" 1)
+ '("chqword" 1)
+ '("chsword" 1)
+ '("chsword" 1)
+ '("correctchoice" 0)
+ '("correctchoiceemphasis" 1)
+ '("covercfoot" 3)
+ '("coverchead" 3)
+ '("coverextrafootheight" 3)
+ '("coverextraheadheight" 3)
+ '("coverfirstpagefooter" 3)
+ '("coverfirstpageheader" 3)
+ '("coverfooter" 3)
+ '("coverheader" 3)
+ '("coverlfoot" 3)
+ '("coverlhead" 3)
+ '("coverrfoot" 3)
+ '("coverrhead" 3)
+ '("coverrunningfooter" 3)
+ '("coverrunningheader" 3)
+ '("cvbpword" 1)
+ '("cvpgword" 1)
+ '("cvpword" 1)
+ '("cvqword" 1)
+ '("cvsword" 1)
+ '("cvtword" 1)
+ '("dottedlinefillheight" 1)
+ '("droppoints" 0)
+ '("droptotalbonuspoints" 0)
+ '("droptotalpoints" 0)
+ '("endgradingrange" 1)
+ '("extraheadheight" 1)
+ '("extrawidth" 1)
+ '("fillwithdottedlines" 1)
+ '("fillwithlines" 1)
+ '("firstpagefooter" 1)
+ '("firstpagefootrule" 0)
+ '("firstpageheader" 3)
+ '("firstpageheadrule" 0)
+ '("footer" 3)
+ '("footrule" 0)
+ '("framedsolutions" 0)
+ '("fullwidth" 1)
+ '("gradetablestretch" 0)
+ '("greeknum" 0)
+ '("half" 0)
+ '("hpgword" 1)
+ '("hpword" 1)
+ '("hqword" 1)
+ '("hsword" 1)
+ '("htword" 1)
+ '("ifcontinuation" 0)
+ '("ifincomplete" 0)
+ '("iflastpage" 0)
+ '("ifprintanswers" 0)
+ '("lfoot" 1)
+ '("lhead" 1)
+ '("linefillheight" 1)
+ '("linefillthickness" 1)
+ '("makeemptybox" 1)
+ '("marginbonuspointname" 1)
+ '("marginpointname" 1)
+ '("marginpointsep" 1)
+ '("marksnotpoints" 0)
+ '("noaddpoints" 0)
+ '("nobonusqformat" 1)
+ '("noboxedpoints" 0)
+ '("nobracketedpoints" 0)
+ '("nocancelspace" 0)
+ '("nomorequestions" 0)
+ '("nopointsinmargin" 0)
+ '("nopointsinrightmargin" 0)
+ '("noprintanswers" 0)
+ '("noqformat" 1)
+ '("numbonuspoints" 0)
+ '("numcoverpages" 0)
+ '("numpages" 0)
+ '("numparts" 0)
+ '("numpoints" 0)
+ '("numquestions" 0)
+ '("numsubparts" 0)
+ '("numsubsubparts" 0)
+ '("oddeven" 2)
+ '("partlabel" 0)
+ '("partopsep" 0)
+ '("partshook" 0)
+ '("pointname" 1)
+ '("pointpoints" 2)
+ '("pointsdroppedatright" 0)
+ '("pointsinmargin" 0)
+ '("pointsinrightmargin" 0)
+ '("pointsofquestion" 1)
+ '("pointsonpage" 1)
+ '("printanswers" 0)
+ '("printselectedfalse" 0)
+ '("printselectedtrue" 0)
+ '("qformat" 1)
+ '("questionlabel" 0)
+ '("questionshook" 0)
+ '("rfoot" 1)
+ '("rhead" 1)
+ '("rightpointsmargin" 0)
+ '("roman" 0)
+ '("romannumeral" 0)
+ '("runningfooter" 3)
+ '("runningfootrule" 0)
+ '("runningheader" 3)
+ '("runningheadrule" 0)
+ '("settabletotalbonuspoints" 1)
+ '("settabletotalpoints" 1)
+ '("shadedsolutions" 0)
+ '("solutiontitle" 0)
+ '("subpartlabel" 0)
+ '("subpartshook" 0)
+ '("subsubpartlabel" 0)
+ '("subsubpartshook" 0)
+ '("thechoice" 0)
+ '("themarginpoints" 0)
+ '("thepartno" 0)
+ '("thequestion" 0)
+ '("thequestiontitle" 0)
+ '("thesubpart" 0)
+ '("thesubsubpart" 0)
+ '("totalbonuspoints" 0)
+ '("totalformat" 0)
+ '("totalnumpages" 0)
+ '("totalpoints" 0)
+ '("unframedsolutions" 0)
+ '("uplevel" 1)
+ '("usehorizontalhalf" 0)
+ '("useslantedhalf" 0)
+ '("vpgword" 1)
+ '("vpword" 1)
+ '("vqword" 1)
+ '("vsword" 1)
+ '("vtword" 1)
+ '("thepoints" 0)
+ ;; ... more stuff here
+ )
+ (LaTeX-add-lengths "answerlinelength" "answerskip")
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("question" "[")
+ ("titledquestion" "{[")
+ ("subpart" "[")
+ ("subsubpart" "["))
+ 'textual)))
+ LaTeX-dialect)
+
+;;; exam.el ends here
--- /dev/null
+;;; expl3.el --- AUCTeX style for `expl3.sty'
+
+;; Copyright (C) 2015, 2017 Free Software Foundation, Inc.
+
+;; Author: Tassilo Horn <tsdh@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-02-22
+;; 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 `expl3.sty'.
+
+;;; Code:
+
+(defvar LaTeX-expl3-syntax-table
+ (let ((st (copy-syntax-table LaTeX-mode-syntax-table)))
+ ;; Make _ and : symbol chars
+ (modify-syntax-entry ?\_ "_" st)
+ (modify-syntax-entry ?\: "_" st)
+ st))
+
+(TeX-add-style-hook
+ "expl3"
+ (lambda ()
+ (set-syntax-table LaTeX-expl3-syntax-table)
+ (when (and (fboundp 'font-latex-update-font-lock)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ ;; Tell font-lock about the update.
+ (font-latex-update-font-lock t)))
+ LaTeX-dialect)
+
+(defun LaTeX-expl3-package-options ()
+ "Read the expl3 package options from the user."
+ (TeX-read-key-val t '(("check-declarations" ("true" "false"))
+ ("log-functions" ("true" "false"))
+ ("driver" ("auto" "latex2e"
+ "dvips" "dvipdfmx"
+ "pdfmode" "xdvipdfmx")))))
+
+;;; expl3.el ends here
--- /dev/null
+;;; fbb.el --- AUCTeX style for `fbb.sty' (v1.07)
+
+;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-11-19
+;; 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 `fbb.sty' (v1.07) from 2015/04/06.
+;; `fbb.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "fbb"
+ (lambda ()
+
+ ;; Run style hook for various packages loaded by fbb
+ (TeX-run-style-hooks "textcomp" "fontaxes")
+
+ ;; New symbols
+ (TeX-add-symbols
+
+ ;; Only preamble command
+ '("useosf" 0)
+
+ ;; Text commands
+ '("lfstyle" -1) ; lf declaration
+ '("tlfstyle" -1) ; tlf declaration
+ '("osfstyle" -1) ; osf declaration
+ '("tosfstyle" -1) ; tosf declaration
+ '("sufigures" -1) ; superior figures declaration
+ '("textlf" t) ; proportional lining figures
+ '("texttlf" t) ; tabular lining figures
+ '("textosf" t) ; proportional oldstyle figures
+ '("texttosf" t) ; tabular oldstyle figures
+ '("textsu" t)) ; superior figures
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("textlf" "{")
+ ("texttlf" "{")
+ ("textosf" "{")
+ ("texttosf" "{")
+ ("textsu" "{"))
+ 'type-command)
+ (font-latex-add-keywords '(("lfstyle" "")
+ ("tlfstyle" "")
+ ("osfstyle" "")
+ ("tosfstyle" "")
+ ("sufigures" ""))
+ 'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-fbb-package-options
+ '("lining" "osf" "oldstyle" "tabular" "p" "proportional"
+ "scale" "scaled" "scosf" "sups")
+ "Package options for the fbb package.")
+
+;;; fbb.el ends here
--- /dev/null
+;;; floatrow.el --- AUCTeX style for `floatrow.sty' (v0.3b)
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-11-11
+;; 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 `floatrow.sty' (v0.3b) from 2009/08/02.
+;; `floatrow.sty' is part of TeXLive.
+;;
+;; `floatrow.sty' is a powerful package and the documentation long.
+;; It is expected that this style is not feature complete. One
+;; deliberate decision is that this style does not offer any package
+;; options: Please use the command `\floatsetup' to set the options
+;; you want.
+;;
+;; This style also alters the way AUCTeX inserts the environments
+;; "table" and "figure" (cf. function `LaTeX-floatrow-env-init'). If
+;; you want the original behavior, try `C-c C-e rawfigure' or `C-c C-e
+;; rawtable' which include the environments incl. the macro \RawFloats
+;; at the beginning of the environment (cf. function
+;; `LaTeX-floatrow-env-figure-raw').
+;;
+;; Another deliberate decision is the implementation of commands like
+;; `\ffigbox' and `\ttabbox': When invoked with `C-c C-m ffigbox RET',
+;; the final result will look like this with cursor being at *:
+;;
+;; \ffigbox{*}{%
+;; \caption{query for a caption}%
+;; \label{prefix:is-chosen-acc-to-current-environment}%
+;; }
+;;
+;; This gives users the freedom to insert any command where point is.
+;; The mandatory arguments are not part of the fontification as
+;; commands like `\includegraphics' or `tabular' environments have their
+;; own fontification.
+
+;;; Code:
+
+;; Needed for compiling `pushnew':
+(eval-when-compile (require 'cl))
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+(defvar LaTeX-floatrow-key-val-options
+ '(;; 3.1.1 Float Style
+ ("style" ("plain" "plaintop" "Plaintop"
+ "ruled" "Ruled"
+ "boxed" "Boxed" "BOXED"
+ "shadowbox" "Shadowbox" "SHADOWBOX"
+ "doublebox" "Doublebox" "DOUBLEBOX"
+ "wshadowbox" "Wshadowbox" "WSHADOWBOX"))
+ ;; 3.1.2 Font Settings
+ ("font" ("scriptsize" "footnotesize" "small" "normalsize" "large"
+ "Large" "normalfont" "up" "it" "sl" "sc" "md" "bf"
+ "rm" "sf" "tt"))
+ ("footfont" ("scriptsize" "footnotesize" "small" "normalsize" "large"
+ "Large" "normalfont" "up" "it" "sl" "sc" "md" "bf"
+ "rm" "sf" "tt"))
+ ;; 3.1.3 Position of Caption
+ ("capposition" ("top" "TOP" "bottom" "beside"))
+ ;; 3.1.4 Position of Beside Caption
+ ("capbesideposition" ("left" "right" "inside" "outside"
+ "top" "bottom" "center"))
+ ;; 3.1.5 Defining The Width of Beside Caption
+ ("capbesidewidth" ("none" "sidefil"))
+ ;; 3.1.6 Defining Width of Object
+ ("floatwidth" ("\\hsize" "\\textwidth" "\\columnwidth" "\\linewidth"))
+ ;; 3.1.7 Other Settings for Beside Captions
+ ("capbesideframe" ("yes" "no"))
+ ;; 3.1.8 Defining Float Foot Position (Legends and Footnotes)
+ ("footposition" ("default" "caption" "bottom"))
+ ;; 3.1.9 Vertical Alignment of Float Elements
+ ("heightadjust" ("all" "caption" "object" "none" "nocaption" "noobject"))
+ ("valign" ("t" "c" "b" "s"))
+ ;; 3.1.10 Facing Layout
+ ("facing" ("yes" "no"))
+ ;; 3.1.11 Object Settings
+ ("objectset" ("justified" "centering" "raggedright" "RaggedRight" "raggedleft"))
+ ;; 3.1.12 Defining Float Margins
+ ("margins" ("centering" "raggedright" "raggedleft"
+ "hangright" "hanginside" "hangoutside"))
+ ;; 3.1.13 Defining Float Separators
+ ("floatrowsep" ("columnsep" "quad" "qquad" "hfil" "hfill" "none"))
+ ("capbesidesep" ("columnsep" "quad" "qquad" "hfil" "hfill" "none"))
+ ;; 3.1.14 Defining Float Rules/Skips
+ ("precode" ("none" "thickrule" "rule" "lowrule" "captionskip"))
+ ("rowprecode" ("none" "thickrule" "rule" "lowrule" "captionskip"))
+ ("midcode" ("none" "thickrule" "rule" "lowrule" "captionskip"))
+ ("postcode" ("none" "thickrule" "rule" "lowrule" "captionskip"))
+ ("rowpostcode" ("none" "thickrule" "rule" "lowrule" "captionskip"))
+ ;; 3.1.15 Defining Float Frames
+ ("framestyle" ("fbox" "colorbox" "FRcolorbox" "corners"
+ "doublebox" "shadowbox" "wshadowbox"))
+ ("frameset")
+ ("framearound" ("none" "object" "all" "row" "none"))
+ ("framefit" ("yes" "no"))
+ ("rowfill" ("yes" "no"))
+ ;; 3.1.16 Settings for Colored Frames
+ ("colorframeset")
+ ("colorframecorners")
+ ;; 3.1.17 Defining Float Skips
+ ("captionskip")
+ ("footskip")
+ ;; 3.1.18 Defining Float Footnote Rule's Style
+ ("footnoterule" ("normal" "limited" "fullsize" "none"))
+ ;; 3.1.19 Managing Floats with [H] Placement Option
+ ("doublefloataswide" ("yes" "no"))
+ ("floatHaslist" ("yes" "no"))
+ ;; 7.2.1 Additions in The floatrow Package to longtable package
+ ("LTcapwidth" ("table" "contents")))
+ "Key=value options for floatrow macros and environments.")
+
+(defvar LaTeX-floatrow-key-val-options-local nil
+ "Buffer-local key=value options for floatrow macros and environments.")
+(make-variable-buffer-local 'LaTeX-floatrow-key-val-options-local)
+
+(defvar LaTeX-floatrow-supported-float-types
+ '("figure" "table" ; Standard LaTeX
+ "widefigure" "widetable" "widefloat" ; Standard figure* & table*
+ "wrapfigure" "wraptable" "wrapfloat" ; wrapfig.sty
+ "rotfigure" "rottable" "rotfloat" ; rotating.sty
+ "widerotfigure" "widerottable" "widerotfloat" ; for 2-col & wide
+ "figurerow" "tablerow" "floatrow" ; inside floatrow env's
+ "capbesidefigure" "capbesidetable" ; floats with beside captions
+ "capbesidefloat"
+ "longtable" ; longtable.sty
+ "subfigure" "subtable" "sub") ; subcaption.sty
+ "List of float types supported by floatrow.sty.")
+
+;; Setup for \newfloatcommand
+(TeX-auto-add-type "floatrow-newfloatcommand" "LaTeX")
+
+(defvar LaTeX-floatrow-newfloatcommand-regexp
+ '("\\\\newfloatcommand{\\([^}]+\\)}" 1 LaTeX-auto-floatrow-newfloatcommand)
+ "Matches the arguments of \"\\newfloatcommand\" from floatrow.sty.")
+
+;; Setup for various \Declare* macros:
+(TeX-auto-add-type "floatrow-DeclareNewOption" "LaTeX")
+
+(defvar LaTeX-floatrow-DeclareNewOption-regexp
+ `(,(concat
+ "\\\\Declare"
+ "\\("
+ (mapconcat #'identity
+ '("FloatStyle" ; 3.6.1 Float Style Option (style=)
+ "FloatFont" ; 3.6.2 Float Font Option (font=)
+ "FloatVCode" ; 3.6.3 Option for Float Rules/Skips (precode= etc.)
+ "ColorBox" ; 3.6.4 Settings for Colored Frame (colorframeset=)
+ "CBoxCorners" ; colorframecorners=
+ "ObjectSet" ; 3.6.5 Object Justification Option (objectset=)
+ "MarginSet" ; 3.6.6 Option for Float Box Alignment/Settings (margins=)
+ "FloatSeparators" ; 3.6.7 Float Separators Options (floatrowsep=, capbesidesep=)
+ "FloatFootnoterule") ; 3.6.8 Option for Footnote Rule's Style (footnoterule=)
+ "\\|")
+ "\\)"
+ "{\\([^}]+\\)}")
+ (0 1 2) LaTeX-auto-floatrow-DeclareNewOption)
+ "Matches the arguments of \"\\Declare*\" from floatrow.sty.")
+
+;; Setup for \newseparated(label|ref):
+(TeX-auto-add-type "floatrow-newseparatedlabel-ref" "LaTeX")
+
+(defvar LaTeX-floatrow-newseparatedlabel-ref-regexp
+ `(,(concat
+ "\\\\newseparated"
+ "\\(label\\|ref\\)"
+ "{?"
+ "\\\\"
+ "\\([a-zA-Z]+\\)"
+ "}?")
+ (2 1) LaTeX-auto-floatrow-newseparatedlabel-ref)
+ "Matches the arguments \"\\newseparated(label|ref)\" command from floatrow.sty.")
+
+;; Setup for \DeclareNewFloatType:
+(TeX-auto-add-type "floatrow-DeclareNewFloatType" "LaTeX")
+
+(defvar LaTeX-floatrow-DeclareNewFloatType-regexp
+ '("\\\\DeclareNewFloatType{\\([^}]+\\)}"
+ 1 LaTeX-auto-floatrow-DeclareNewFloatType)
+ "Matches the argument of \"\\DeclareNewFloatType\" command from floatrow.sty.")
+
+;; Plug them into the machinery.
+(defun LaTeX-floatrow-auto-prepare ()
+ "Clear various \"LaTeX-floatrow\" variables before parsing."
+ (setq LaTeX-auto-floatrow-newfloatcommand nil
+ LaTeX-auto-floatrow-DeclareNewOption nil
+ LaTeX-auto-floatrow-newseparatedlabel-ref nil
+ LaTeX-auto-floatrow-DeclareNewFloatType nil))
+
+(defun LaTeX-floatrow-auto-cleanup ()
+ "Process parsed results from floatrow package."
+ ;; Replace initially the way fig & tab env's are inserted:
+ (LaTeX-floatrow-env-init)
+ ;;
+ ;; Process new key=val options:
+ (when (LaTeX-floatrow-DeclareNewOption-list)
+ (LaTeX-floatrow-update-key-val-options))
+ ;;
+ ;; Process new float commands like \ffigbox:
+ (when (LaTeX-floatrow-newfloatcommand-list)
+ (dolist (cmd (mapcar #'car (LaTeX-floatrow-newfloatcommand-list)))
+ (TeX-add-symbols `(,cmd LaTeX-floatrow-arg-floatbox))
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords `((,cmd "[[["))
+ 'textual))))
+ ;;
+ ;; Process new label/ref commands:
+ (when (LaTeX-floatrow-newseparatedlabel-ref-list)
+ (let (floatrow-run-reftex-compile-vars)
+ (dolist (elt (LaTeX-floatrow-newseparatedlabel-ref-list))
+ (let ((cmd (car elt))
+ (type (cadr elt)))
+ (if (string= type "ref")
+ ;; More fun w/ referencing macros:
+ (TeX-add-symbols `(,cmd TeX-arg-ref))
+ ;; Less fun w/ label defining macros. Add cmd to
+ ;; TeX-symbol-list:
+ (TeX-add-symbols `(,cmd TeX-arg-define-label))
+ ;; For AUCTeX, parse the argument of the new macro and add
+ ;; it to `LaTeX-auto-label':
+ (TeX-auto-add-regexp
+ `(,(concat "\\\\" cmd "{\\([^\n\r%\\{}]+\\)}") 1 LaTeX-auto-label))
+ ;; For RefTeX, append cmd to `reftex-label-regexps and set
+ ;; floatrow-run-reftex-compile-vars to t:
+ (when (and (boundp 'reftex-label-regexps)
+ (fboundp 'reftex-compile-variables)
+ (not (string-match
+ cmd
+ (mapconcat #'identity reftex-label-regexps "|"))))
+ (add-to-list (make-local-variable 'reftex-label-regexps)
+ (concat "\\\\" cmd "{\\(?1:[^}]*\\)}") t)
+ (setq floatrow-run-reftex-compile-vars t)))
+ ;; Fontify macros as reference:
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords `((,cmd "{"))
+ 'reference))))
+ ;; Run `reftex-compile-variables' if needed only once:
+ (when floatrow-run-reftex-compile-vars
+ (reftex-compile-variables))))
+ ;;
+ ;; Process new floattypes:
+ (when (LaTeX-floatrow-DeclareNewFloatType-list)
+ (LaTeX-floatrow-arg-declare-new-floattype nil t))
+ ;;
+ ;; Add elements from `LaTeX-floatrow-supported-float-types' to
+ ;; `LaTeX-caption-supported-float-types':
+ (when (boundp 'LaTeX-caption-supported-float-types)
+ (make-local-variable 'LaTeX-caption-supported-float-types)
+ (dolist (float LaTeX-floatrow-supported-float-types)
+ (add-to-list 'LaTeX-caption-supported-float-types float t))) )
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-floatrow-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-floatrow-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun LaTeX-floatrow-update-key-val-options ()
+ "Update buffer-local key-val options before offering for completion."
+ (let ((vcode-keys '("precode" "rowprecode" "midcode" "postcode" "rowpostcode"))
+ (sep-keys '("floatrowsep" "capbesidesep")))
+ (dolist (keyvals (LaTeX-floatrow-DeclareNewOption-list))
+ (let* ((key (cond ((string= (nth 1 keyvals) "FloatStyle")
+ "style")
+ ((string= (nth 1 keyvals) "FloatFont")
+ "font")
+ ((string= (nth 1 keyvals) "FloatVCode")
+ "precode")
+ ((string= (nth 1 keyvals) "ColorBox")
+ "colorframeset")
+ ((string= (nth 1 keyvals) "CBoxCorners")
+ "colorframecorners")
+ ((string= (nth 1 keyvals) "ObjectSet")
+ "objectset")
+ ((string= (nth 1 keyvals) "MarginSet")
+ "margins")
+ ((string= (nth 1 keyvals) "FloatSeparators")
+ "floatrowsep")
+ ((string= (nth 1 keyvals) "FloatFootnoterule")
+ "footnoterule")
+ (t nil)))
+ (val (nth 2 keyvals))
+ (val-match (cadr (assoc key LaTeX-floatrow-key-val-options-local)))
+ (temp (copy-alist LaTeX-floatrow-key-val-options-local))
+ (opts (cond ((string= key "precode")
+ (dolist (x vcode-keys)
+ (setq temp (assq-delete-all (car (assoc x temp)) temp)))
+ temp)
+ ((string= key "floatrowsep")
+ (setq temp (dolist (x sep-keys)
+ (assq-delete-all (car (assoc x temp)) temp)))
+ temp)
+ (t
+ (assq-delete-all (car (assoc key temp)) temp)))))
+ (cond ((string= key "precode")
+ (dolist (x vcode-keys)
+ (pushnew (list x (TeX-delete-duplicate-strings (append (list val) val-match)))
+ opts :test #'equal)))
+ ((string= key "floatrowsep")
+ (dolist (x sep-keys)
+ (pushnew (list x (TeX-delete-duplicate-strings (append (list val) val-match)))
+ opts :test #'equal)))
+ (t
+ (pushnew (list key (TeX-delete-duplicate-strings (append (list val) val-match)))
+ opts :test #'equal)))
+ (setq LaTeX-floatrow-key-val-options-local (copy-alist opts))))))
+
+(defun LaTeX-floatrow-arg-floatbox (optional)
+ "Query and insert arguments of float box commands from floatrow.sty.
+If OPTIONAL is non-nil, indicate optional argument during query."
+ ;; Query for the optional arguments; ask for "vertpos" only if
+ ;; "height" is given. let-bind `TeX-arg-*-brace' for
+ ;; `TeX-argument-insert':
+ (let* ((TeX-arg-opening-brace "[")
+ (TeX-arg-closing-brace "]")
+ (width (completing-read
+ (TeX-argument-prompt t nil "Width")
+ (mapcar (lambda (x) (concat TeX-esc (car x)))
+ (LaTeX-length-list))))
+ (height (completing-read
+ (TeX-argument-prompt t nil "Height")
+ (mapcar (lambda (x) (concat TeX-esc (car x)))
+ (LaTeX-length-list))))
+ (vertpos (if (string= height "")
+ ""
+ (completing-read
+ (TeX-argument-prompt t nil "Vertical alignment")
+ '("t" "c" "b" "s")))))
+ (TeX-argument-insert width t)
+ ;; Insert an extra pair of brackets if only `height' is given,
+ ;; otherwise it will become `width'
+ (when (and (string= width "")
+ height (not (string= height "")))
+ (insert "[]"))
+ (TeX-argument-insert height t)
+ (TeX-argument-insert vertpos t))
+ ;; Now query for the (short-)caption. Also check for the
+ ;; float-type; if we're inside (sub)?floatrow*?, then check for the
+ ;; next outer environment:
+ (let* ((currenv (if (string-match "floatrow\\*?\\_>" (LaTeX-current-environment))
+ (LaTeX-current-environment 2)
+ (LaTeX-current-environment)))
+ (caption (TeX-read-string
+ (TeX-argument-prompt optional nil "Caption")))
+ (short-caption
+ (when (>= (length caption) LaTeX-short-caption-prompt-length)
+ (TeX-read-string
+ (TeX-argument-prompt t nil "Short caption")))))
+ (indent-according-to-mode)
+ ;; The final result will look like this with * being point:
+ ;; \ffigbox{*}{%
+ ;; \caption{text}%
+ ;; \label{fig:foo}%
+ ;; }
+ (insert TeX-grop)
+ (save-excursion
+ ;; We are inside the 1. mandatory arg: Save the pos & insert `}{':
+ (insert TeX-grcl TeX-grop)
+ (if (and caption (not (string= caption "")))
+ (progn
+ ;; If caption, move to EOL, delete any spaces and hide the line end
+ (end-of-line)
+ (delete-horizontal-space)
+ (insert "%")
+ ;; Add a newline and the caption
+ (newline-and-indent)
+ (insert (LaTeX-compose-caption-macro caption short-caption))
+ ;; If we have a caption, then we probably also want a
+ ;; label. Hide EOL end and proceed to enter a label
+ (insert "%")
+ (newline-and-indent)
+ (when (LaTeX-label currenv 'environment)
+ ;; Move point to end of line and hide EOL
+ (end-of-line)
+ (delete-horizontal-space)
+ (insert "%")
+ (newline-and-indent))
+ ;; Now close the group
+ (insert TeX-grcl)
+ (indent-according-to-mode)
+ (end-of-line))
+ ;; Otherwise, only insert a }
+ (insert TeX-grcl)))))
+
+(defun LaTeX-floatrow-env-init ()
+ "Replace AUCTeX entries in the variable `LaTeX-environment-list'.
+After loading the style hook floatrow.el, delete the entries for
+figure*? and table*? from variable `LaTeX-environment-list' and
+replace them with the ones offered by the style. Original
+entries are available under \"rawfigure*?\" and \"rawtable*?\"."
+ (LaTeX-environment-list)
+ (dolist (env '("figure" "figure*" "table" "table*"))
+ (setq LaTeX-environment-list
+ (assq-delete-all (car (assoc env LaTeX-environment-list))
+ LaTeX-environment-list))
+ (LaTeX-add-environments `(,env LaTeX-floatrow-env-figure)
+ `(,(concat "raw" env) LaTeX-floatrow-env-figure-raw))))
+
+(defun LaTeX-floatrow-env-figure (environment)
+ "Create floating ENVIRONMENT suitable for floatrow macros."
+ (let ((float (and LaTeX-float
+ (TeX-read-string
+ (TeX-argument-prompt t nil "Float position")
+ LaTeX-float))))
+ (LaTeX-insert-environment environment
+ (unless (zerop (length float))
+ (concat LaTeX-optop float LaTeX-optcl)))))
+
+(defun LaTeX-floatrow-env-figure-raw (env)
+ "Create raw floating ENV with floatrow.sty.
+Also insert the macro \"\\RawFloats\" when finished with user
+queries."
+ (let ((environment (TeX-replace-regexp-in-string "raw" "" env)))
+ (LaTeX-env-figure environment)
+ (save-excursion
+ ;; `LaTeX-find-matching-begin' will not work for us as we don't
+ ;; know how user answers queries from AUCTeX, hence we search
+ ;; back for `environment':
+ (re-search-backward (concat "\\\\begin{" environment "}") nil t)
+ (end-of-line)
+ (LaTeX-newline)
+ (indent-according-to-mode)
+ (insert TeX-esc "RawFloats"))))
+
+(defun LaTeX-floatrow-arg-declare-new-options (optional prompt key)
+ "Query and insert user-defined values to keys provided by floatrow.sty.
+If OPTIONAL is non-nil, ask for an optional argument and insert
+it in square brackets. PROMPT replaces the standard one. KEY is
+a string and corresponds to first parsed element in
+`LaTeX-floatrow-DeclareNewOption-regexp'."
+ (let ((val (TeX-read-string
+ (TeX-argument-prompt optional prompt "New value option"))))
+ (LaTeX-add-floatrow-DeclareNewOptions
+ (list (concat TeX-esc "Declare" key TeX-grop val TeX-grcl)
+ key val))
+ (LaTeX-floatrow-update-key-val-options)
+ (TeX-argument-insert val optional)
+ (TeX-argument-insert
+ (TeX-read-key-val optional LaTeX-floatrow-key-val-options-local) optional)))
+
+(defun LaTeX-floatrow-arg-newseparatedlabel/ref (optional type)
+ "Query and insert user defined label and reference macros from floatrow.sty.
+If OPTIONAL is non-nil, insert the argument in brackets. TYPE is
+the string \"label\" or \"ref\"."
+ (let ((cmd (TeX-read-string
+ (if (string= type "label")
+ (TeX-argument-prompt optional nil "Label command: \\" t)
+ (TeX-argument-prompt optional nil "Reference command: \\" t)))))
+ (LaTeX-add-floatrow-newseparatedlabel-refs (list cmd type))
+ (if (string= type "label")
+ (TeX-add-symbols `(,cmd TeX-arg-define-label))
+ (TeX-add-symbols `(,cmd TeX-arg-ref)))
+ (TeX-argument-insert cmd optional TeX-esc)))
+
+(defun LaTeX-floatrow-arg-declare-new-floattype (optional &optional cleanup)
+ "Query and insert the first argument of \"DeclareNewFloatType\" macro from floatrow.sty.
+If OPTIONAL is non-nil, insert the argument in brackets. If
+CLEANUP in non-nil, skip the query and insert process as we are
+inside the function `LaTeX-floatrow-auto-cleanup' and process
+only the parsed items."
+ (let ((type (if cleanup
+ (mapcar #'car (LaTeX-floatrow-DeclareNewFloatType-list))
+ (list (TeX-read-string
+ (TeX-argument-prompt optional nil "Environment type"))))))
+ ;; If not inside `LaTeX-floatrow-auto-cleanup', add user input to
+ ;; list of new floats and insert it
+ (unless cleanup
+ (LaTeX-add-floatrow-DeclareNewFloatTypes (car type))
+ (TeX-argument-insert (car type) optional))
+ ;; Make the next variables buffer local
+ (make-local-variable 'LaTeX-floatrow-supported-float-types)
+ (when (boundp 'LaTeX-caption-supported-float-types)
+ (make-local-variable 'LaTeX-caption-supported-float-types))
+ ;; Process new float type(s): a) add type to list of known
+ ;; environments incl. "raw" version b) add different flavors of
+ ;; type to `LaTeX-floatrow-supported-float-types' c) check if
+ ;; `LaTeX-caption-supported-float-types' is bound and add
+ ;; different flavors of type to it as well
+ (dolist (elt type)
+ (LaTeX-add-environments `(,elt LaTeX-floatrow-env-figure)
+ `(,(concat "raw" elt) LaTeX-floatrow-env-figure-raw))
+ (add-to-list 'LaTeX-floatrow-supported-float-types elt t)
+ (add-to-list 'LaTeX-floatrow-supported-float-types (concat "wide" elt) t)
+ (add-to-list 'LaTeX-floatrow-supported-float-types (concat elt "row") t)
+ (add-to-list 'LaTeX-floatrow-supported-float-types (concat "capbeside" elt) t)
+ (when (boundp 'LaTeX-caption-supported-float-types)
+ (add-to-list 'LaTeX-caption-supported-float-types elt t)
+ (add-to-list 'LaTeX-caption-supported-float-types (concat "wide" elt) t)
+ (add-to-list 'LaTeX-caption-supported-float-types (concat elt "row") t)
+ (add-to-list 'LaTeX-caption-supported-float-types (concat "capbeside" elt) t)))))
+
+(TeX-add-style-hook
+ "floatrow"
+ (lambda ()
+
+ ;; Add floatrow to the parser
+ (TeX-auto-add-regexp LaTeX-floatrow-DeclareNewOption-regexp)
+ (TeX-auto-add-regexp LaTeX-floatrow-newfloatcommand-regexp)
+ (TeX-auto-add-regexp LaTeX-floatrow-newseparatedlabel-ref-regexp)
+ (TeX-auto-add-regexp LaTeX-floatrow-DeclareNewFloatType-regexp)
+
+ ;; Activate the buffer-local version of key-vals
+ (setq LaTeX-floatrow-key-val-options-local
+ (copy-alist LaTeX-floatrow-key-val-options))
+
+ ;; Add pre-defined float commands:
+ (LaTeX-add-floatrow-newfloatcommands
+ "ffigbox" "fcapside" "ttabbox")
+
+ ;; Macros
+ (TeX-add-symbols
+ ;; 2.1 The \floatbox Macro
+ ;; \floatbox[<preamble>]{<captype>}[<width>][<height>][<vert pos>]{<caption>}{<object>}
+ '("floatbox"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Preamble")
+ '("\\capbeside" "\\nocapbeside" "\\captop") ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Float type")
+ LaTeX-floatrow-supported-float-types)
+ LaTeX-floatrow-arg-floatbox)
+
+ ;; 2.2 Creation of Personal Commands for Float Boxes
+ '("newfloatcommand"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((cmd (TeX-read-string
+ (TeX-argument-prompt optional nil "Command"))))
+ (LaTeX-add-floatrow-newfloatcommands cmd)
+ (TeX-add-symbols
+ `(,cmd LaTeX-floatrow-arg-floatbox))
+ (format "%s" cmd))))
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Float type")
+ '("figure" "table"))
+ [ 2 ])
+
+ '("renewfloatcommand"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Command")
+ (LaTeX-floatrow-newfloatcommand-list))
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Float type")
+ '("figure" "table"))
+ [ 2 ])
+
+
+ ;; 2.2.2 Predefined Float Box Commands
+ '("ffigbox"
+ LaTeX-floatrow-arg-floatbox)
+
+ '("ttabbox"
+ LaTeX-floatrow-arg-floatbox)
+
+ '("fcapside"
+ LaTeX-floatrow-arg-floatbox)
+
+ ;; 2.3.1 Mixed Row
+ '("CenterFloatBoxes" 0)
+ '("TopFloatBoxes" 0)
+ '("BottomFloatBoxes" 0)
+ '("PlainFloatBoxes" 0)
+ '("buildFBBOX" 2)
+
+ ;; 3 Float Layout Settings
+ '("floatsetup"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Float type")
+ LaTeX-floatrow-supported-float-types ]
+ (TeX-arg-key-val LaTeX-floatrow-key-val-options-local))
+
+ ;; 3.2 Settings for Current Float Environment
+ '("thisfloatsetup"
+ (TeX-arg-key-val LaTeX-floatrow-key-val-options-local))
+
+ ;; 3.3 Clearing of Settings for Current Float Type
+ '("clearfloatsetup"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Float type")
+ LaTeX-floatrow-supported-float-types))
+
+ ;; 3.4 Temporary Clearing of All Float Settings
+ '("killfloatstyle" 0)
+
+ ;; 3.6.1 Float Style Option (style=)
+ '("DeclareFloatStyle"
+ (LaTeX-floatrow-arg-declare-new-options "New style option"
+ "FloatStyle"))
+
+ ;; 3.6.2 Float Font Option (font=)
+ '("DeclareFloatFont"
+ (LaTeX-floatrow-arg-declare-new-options "New font option"
+ "FloatFont"))
+
+ ;; 3.6.3 Option for Float Rules/Skips (precode= etc.)
+ '("DeclareFloatVCode"
+ (LaTeX-floatrow-arg-declare-new-options "New rules/skip option"
+ "FloatVCode"))
+
+ ;; 3.6.4 Settings for Colored Frame (colorframeset=)
+ '("DeclareColorBox"
+ (LaTeX-floatrow-arg-declare-new-options "New colored frame option"
+ "ColorBox"))
+
+ ;; (colorframecorners=)
+ '("DeclareCBoxCorners"
+ (LaTeX-floatrow-arg-declare-new-options "New colored corner option"
+ "CBoxCorners"))
+
+ ;; 3.6.5 Object Justification Option (objectset=)
+ '("DeclareObjectSet"
+ (LaTeX-floatrow-arg-declare-new-options "New object justification"
+ "ObjectSet"))
+
+ ;; 3.6.6 Option for Float Box Alignment/Settings (margins=)
+ '("DeclareMarginSet"
+ (LaTeX-floatrow-arg-declare-new-options "New alignment option"
+ "MarginSet"))
+
+ '("setfloatmargins" 2)
+ '("setfloatmargins*" 2)
+ '("floatfacing" 2)
+ '("floatfacing*" 2)
+ '("floatboxmargins" 2)
+ '("floatrowmargins" 2)
+ '("floatcapbesidemargins" 2)
+
+ ;; 3.6.7 Float Separators Options (floatrowsep=, capbesidesep=)
+ '("DeclareFloatSeparators"
+ (LaTeX-floatrow-arg-declare-new-options "New separator option"
+ "FloatSeparators"))
+
+ ;; 3.6.8 Option for Footnote Rule's Style (footnoterule=)
+ '("DeclareFloatFootnoterule"
+ (LaTeX-floatrow-arg-declare-new-options "New footnote rule option"
+ "FloatFootnoterule"))
+
+ ;; 4 Creation of New Float Types
+ '("DeclareNewFloatType"
+ (LaTeX-floatrow-arg-declare-new-floattype)
+ (TeX-arg-key-val (("placement" ("tbp" "t" "b" "p"))
+ ("name")
+ ("fileext")
+ ("within" ("chapter" "section" "subsection"))
+ ("relatedcapstyle" ("yes" "no")))))
+
+ ;; 6.2 Support of The Label-Sublabel References
+ '("newseparatedlabel"
+ (LaTeX-floatrow-arg-newseparatedlabel/ref "label") 2)
+
+ '("newseparatedref"
+ (LaTeX-floatrow-arg-newseparatedlabel/ref "ref") t)
+
+ '("makelabelseparator" t) ) ;; terminate TeX-add-symbols
+
+ ;; Environments
+ (LaTeX-add-environments
+ ;; 2.3 Building Float Row
+ '("floatrow" [ "Number of beside floats" ])
+
+ ;; 6.1 Managing of Float Parts With the subfloatrow Environment
+ '("subfloatrow" [ "Number of beside floats" ])
+ '("subfloatrow*" [ "Number of beside floats" ]))
+
+ ;; 2.1.1 Float Box Width Equals to The Width of Object Contents
+ (LaTeX-add-lengths "FBwidth" "FBheight" "Xhsize")
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("floatbox" "[{[[[")
+ ("ffigbox" "[[[")
+ ("ttabbox" "[[[")
+ ("fcapside" "[[["))
+ 'textual)
+ (font-latex-add-keywords '(("newfloatcommand" "{{[[")
+ ("renewfloatcommand" "{{[[")
+ ("buildFBBOX" "{{")
+ ("floatsetup" "[{")
+ ("thisfloatsetup" "{")
+ ("clearfloatsetup" "{")
+ ("killfloatstyle" "")
+ ("DeclareFloatStyle" "{{")
+ ("DeclareFloatFont" "{{")
+ ("DeclareFloatVCode" "{{")
+ ("DeclareColorBox" "{{")
+ ("DeclareCBoxCorners" "{{")
+ ("DeclareObjectSet" "{{")
+ ("DeclareMarginSet" "{{")
+ ("DeclareFloatSeparators" "{{")
+ ("DeclareFloatFootnoterule" "{{")
+ ("newseparatedlabel" "{{{")
+ ("newseparatedref" "{{")
+ ("makelabelseparator" "{")
+ ("DeclareNewFloatType" "{{")
+ ("RawFloats" ""))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-floatrow-package-options nil
+ "Prompt for package options for the floatrow package.")
+
+;;; floatrow.el ends here
--- /dev/null
+;;; fontaxes.el --- AUCTeX style for `fontaxes.sty' version v1.0d
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-10-12
+;; 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 `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".
+
+;;; Code:
+
+(TeX-add-style-hook
+ "fontaxes"
+ (lambda ()
+ (TeX-add-symbols
+ ;; Various font shapes
+ '("swshape" -1) ; swash shape
+ '("sscshape" -1) ; spaced small caps
+ '("fontprimaryshape" t)
+ '("fontsecondaryshape" t)
+ '("swdefault" t)
+ '("sscdefault" t)
+ '("ulcdefault" t)
+
+ ;; Figure versions
+ '("figureversion"
+ (TeX-arg-eval mapconcat 'identity
+ (TeX-completing-read-multiple
+ "Style, alignment: "
+ '(("text") ("osf")
+ ("lining") ("lf")
+ ("tabular") ("tab")
+ ("proportional") ("prop"))) ","))
+ '("txfigures" -1) ; style: text figures (osf)
+ '("lnfigures" -1) ; style: lining figures
+ '("tbfigures" -1) ; alignment: tabular figures
+ '("prfigures" -1) ; alignment: proportional figures
+ '("fontfigurestyle"
+ (TeX-arg-eval completing-read "Style: "
+ '(("text") ("lining"))))
+ '("fontfigurealignment"
+ (TeX-arg-eval completing-read "Alignment: "
+ '(("tabular") ("proportional"))))
+ '("fontbasefamily" t)
+
+ ;; Math versions
+ '("boldmath" -1) ; math weight
+ '("unboldmath" -1) ;
+ '("tabularmath" -1) ; math figure alignment
+ '("proportionalmath" -1) ;
+ '("mathweight"
+ (TeX-arg-eval completing-read "Math weight: "
+ '(("bold") ("normal"))))
+ '("mathfigurealignment"
+ (TeX-arg-eval completing-read "Math figure alignment: "
+ '(("tabular") ("proportional"))))
+
+ ;; Additional commands
+ '("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 '(("textsw" "{")
+ ("textssc" "{")
+ ("textulc" "{"))
+ 'bold-command)
+ (font-latex-add-keywords '(("swshape" "")
+ ("sscshape" ""))
+ 'bold-declaration)
+ (font-latex-add-keywords '(("figureversion" "{"))
+ 'variable)))
+ LaTeX-dialect)
+
+(defvar LaTeX-fontaxes-package-options nil
+ "Package options for the fontaxes package.")
+
+;;; fontaxes.el ends here
--- /dev/null
+;;; fontenc.el --- AUCTeX style for `fontenc.sty' (v1.99g)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-09-12
+;; 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 `fontenc.sty' (v1.99g) from 2005/09/27.
+;; `fontenc.sty' is a standard LaTeX package and part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-fontenc-package-options-list
+ '(;; 128+ glyph encodings (text)
+ "OT1" "OT2" "OT3" "OT4" "OT6"
+ ;; 256 glyph encodings (text)
+ "T1" "T2A" "T2B" "T2C" "T3" "T4" "T5"
+ ;; 256 glyph encodings (text extended)
+ "X2"
+ ;; Other encodings
+ "LY1" "LV1" "LGR")
+ "Package options for the fontenc package.")
+
+(defun LaTeX-fontenc-package-options ()
+ "Prompt for package options for the fontenc package."
+ (mapconcat 'identity
+ (TeX-completing-read-multiple
+ "Encoding(s): "
+ LaTeX-fontenc-package-options-list) ","))
+
+;;; fontenc.el ends here
--- /dev/null
+;;; framed.el --- AUCTeX style for `framed.sty' (v0.96)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-06-26
+;; 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 `framed.sty' (v0.96) from 2011/10/22.
+;; `framed.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "framed"
+ (lambda ()
+ ;; env's defined by framed.sty
+ (LaTeX-add-environments
+ '("framed")
+ '("oframed")
+ '("shaded")
+ '("shaded*")
+ '("snugshade")
+ '("snugshade*")
+ '("leftbar")
+ '("titled-frame" "Title")))
+ LaTeX-dialect)
+
+(defvar LaTeX-framed-package-options nil
+ "Package options for the framed package.")
+
+;;; framed.el ends here
--- /dev/null
+;;; fvextra.el --- AUCTeX style for `fvextra.sty' (v1.2.1)
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-03-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 `fvextra.sty' (v1.2.1) from 2016/09/02.
+;; `fvextra.sty' is part of TeXLive.
+
+;;; Code:
+
+;; Needed for compiling `pushnew':
+(eval-when-compile (require 'cl))
+
+(defvar LaTeX-fvextra-key-val-options
+ '(;; 3 General options
+ ("curlyquotes" ("true" "false"))
+ ("highlightcolor")
+ ("highlightlines")
+ ("linenos" ("true" "false"))
+ ("mathescape" ("true" "false"))
+ ("numberfirstline" ("true" "false"))
+ ;; ("numbers" ("none" "left" "right" "both"))
+ ("space" ("\\textvisiblespace"))
+ ("spacecolor" ("none"))
+ ("stepnumberfromfirst" ("true" "false"))
+ ("stepnumberoffsetvalues" ("true" "false"))
+ ("tab" ("\\FancyVerbTab"))
+ ("tabcolor" ("none"))
+ ;; 5.1 Line breaking options
+ ("breakafter" ("none"))
+ ("breakaftergroup" ("true" "false"))
+ ("breakaftersymbolpre")
+ ("breakaftersymbolpost")
+ ("breakanywhere" ("true" "false"))
+ ("breakanywheresymbolpre")
+ ("breakanywheresymbolpost")
+ ("breakautoindent" ("true" "false"))
+ ("breakbefore")
+ ("breakbeforegroup" ("true" "false"))
+ ("breakbeforesymbolpre")
+ ("breakbeforesymbolpost")
+ ("breakindent")
+ ("breaklines" ("true" "false"))
+ ("breaksymbol")
+ ("breaksymbolleft")
+ ("breaksymbolright")
+ ("breaksymbolindent")
+ ("breaksymbolindentleft")
+ ("breaksymbolindentright")
+ ("breaksymbolsep")
+ ("breaksymbolsepleft")
+ ("breaksymbolsepright"))
+ "Key=value options for fvextra macros and environments.")
+
+(defun LaTeX-fvextra-update-key-val ()
+ "Update `LaTeX-fancyvrb-key-val-options-local' with key=vals from \"fvextra.sty\"."
+ ;; Delete the key "numbers" from `LaTeX-fancyvrb-key-val-options-local':
+ (setq LaTeX-fancyvrb-key-val-options-local
+ (assq-delete-all (car (assoc "numbers" LaTeX-fancyvrb-key-val-options-local))
+ LaTeX-fancyvrb-key-val-options-local))
+ ;; Add the key with "both" value:
+ (add-to-list 'LaTeX-fancyvrb-key-val-options-local
+ '("numbers" ("none" "left" "right" "both")))
+ ;; Add color values to resp. keys:
+ (when (or (member "xcolor" (TeX-style-list))
+ (member "color" (TeX-style-list)))
+ (let* ((colorcmd (if (member "xcolor" (TeX-style-list))
+ #'LaTeX-xcolor-definecolor-list
+ #'LaTeX-color-definecolor-list))
+ (keys '("highlightcolor"
+ "rulecolor"
+ "fillcolor"
+ "tabcolor"
+ "spacecolor"))
+ (tmp (copy-alist LaTeX-fancyvrb-key-val-options-local)))
+ (dolist (x keys)
+ (setq tmp (assq-delete-all (car (assoc x tmp)) tmp))
+ (if (string= x "highlightcolor")
+ (pushnew (list x (mapcar #'car (funcall colorcmd))) tmp :test #'equal)
+ (pushnew (list x (append '("none") (mapcar #'car (funcall colorcmd)))) tmp :test #'equal)))
+ (setq LaTeX-fancyvrb-key-val-options-local
+ (copy-alist tmp)))))
+
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-fvextra-update-key-val t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "fvextra"
+ (lambda ()
+
+ ;; Run the style hook for "fancyvrb"
+ (TeX-run-style-hooks "fancyvrb")
+
+ ;; Append `LaTeX-fvextra-key-val' to `LaTeX-fancyvrb-key-val-options-local':
+ (setq LaTeX-fancyvrb-key-val-options-local
+ (append LaTeX-fvextra-key-val-options
+ LaTeX-fancyvrb-key-val-options-local))
+
+ (TeX-add-symbols
+ ;; 4.1 Line and text formatting
+ "FancyVerbFormatText"
+
+ ;; 5.3.2 Breaks within macro arguments
+ "FancyVerbBreakStart"
+ "FancyVerbBreakStop"
+
+ ;; 5.3.3 Customizing break behavior
+ "FancyVerbBreakAnywhereBreak"
+ "FancyVerbBreakBeforeBreak"
+ "FancyVerbBreakAfterBreak"))
+ LaTeX-dialect)
+
+(defvar LaTeX-fvextra-package-options nil
+ "Package options for the fvextra package.")
+
+;;; fvextra.el ends here
--- /dev/null
+;;; geometry.el --- AUCTeX style for `geometry.sty' (v5.6)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-02-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 `geometry.sty' (v5.6) from 2010/09/12.
+;; `geometry.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-geometry-always-key-val-options
+ '(("layout") ("layoutwidth") ("layoutheight") ("layoutsize")
+ ("layouthoffset") ("layoutvoffset") ("layoutoffset") ("hscale")
+ ("vscale") ("scale") ("width") ("totalwidth") ("height") ("totalheight")
+ ("total") ("textwidth") ("textheight") ("text") ("body") ("lines")
+ ("includehead") ("includefoot") ("includeheadfoot") ("includemp")
+ ("includeall") ("ignorehead") ("ignorefoot") ("ignoreheadfoot")
+ ("ignoremp") ("ignoreall") ("heightrounded") ("hdivide") ("vdivide")
+ ("divide") ("left") ("lmargin") ("inner") ("right") ("rmargin")
+ ("outer") ("top") ("tmargin") ("bottom") ("bmargin") ("hmargin")
+ ("vmargin") ("margin") ("hmarginratio") ("vmarginratio") ("marginratio")
+ ("ratio") ("hcentering") ("vcentering") ("centering") ("twoside")
+ ("asymmetric") ("bindingoffset") ("hdivide") ("vdivide") ("divide")
+ ("headheight") ("head") ("headsep") ("footskip") ("foot") ("nohead")
+ ("nofoot") ("noheadfoot") ("footnotesep") ("marginparwidth") ("marginpar")
+ ("marginparsep") ("nomarginpar") ("columnsep") ("hoffset") ("voffset")
+ ("offset") ("twocolumn") ("onecolumn") ("twoside") ("textwidth")
+ ("textheight") ("reversemp") ("reversemarginpar"))
+ "Key=value options always available for geometry macros.")
+
+(defvar LaTeX-geometry-preamble-key-val-options
+ '(("paper" ("a0paper" "a1paper" "a2paper" "a3paper" "a4paper"
+ "a5paper" "a6paper" "b0paper" "b1paper" "b2paper"
+ "b3paper" "b4paper" "b5paper" "b6paper" "c0paper"
+ "c1paper" "c2paper" "c3paper" "c4paper" "c5paper"
+ "c6paper" "b0j" "b1j" "b2j" "b3j" "b4j" "b5j" "b6j"
+ "ansiapaper" "ansibpaper" "ansicpaper" "ansidpaper"
+ "ansiepaper" "ansiapaper" "ansibpaper" "ansicpaper"
+ "ansidpaper" "ansiepaper"))
+ ("papername" ("a0paper" "a1paper" "a2paper" "a3paper" "a4paper"
+ "a5paper" "a6paper" "b0paper" "b1paper" "b2paper"
+ "b3paper" "b4paper" "b5paper" "b6paper" "c0paper"
+ "c1paper" "c2paper" "c3paper" "c4paper" "c5paper"
+ "c6paper" "b0j" "b1j" "b2j" "b3j" "b4j" "b5j" "b6j"
+ "ansiapaper" "ansibpaper" "ansicpaper" "ansidpaper"
+ "ansiepaper" "ansiapaper" "ansibpaper" "ansicpaper"
+ "ansidpaper" "ansiepaper"))
+ ("a0paper") ("a1paper") ("a2paper") ("a3paper") ("a4paper") ("a5paper")
+ ("a6paper") ("b0paper") ("b1paper") ("b2paper") ("b3paper") ("b4paper")
+ ("b5paper") ("b6paper") ("c0paper") ("c1paper") ("c2paper") ("c3paper")
+ ("c4paper") ("c5paper") ("c6paper") ("b0j") ("b1j") ("b2j") ("b3j")
+ ("b4j") ("b5j") ("b6j") ("ansiapaper") ("ansibpaper") ("ansicpaper")
+ ("ansidpaper") ("ansiepaper") ("ansiapaper") ("ansibpaper") ("ansicpaper")
+ ("ansidpaper") ("ansiepaper") ("screen") ("paperwidth") ("paperheight")
+ ("papersize") ("landscape") ("portrait")
+ ("driver" ("dvips" "dvipdfm" "pdftex" "vtex" "xetex" "auto" "none"))
+ ("dvips") ("dvipdfm") ("pdftex") ("xetex") ("vtex") ("verbose")
+ ("reset") ("mag") ("truedimen") ("pass") ("showframe") ("showcrop"))
+ "Key=value options allowed only in the preamble for geometry macros.")
+
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+;; Setup for \savegeometry:
+(TeX-auto-add-type "geometry-savegeometry" "LaTeX" "geometry-savegeometries")
+
+(defvar LaTeX-geometry-savegeometry-regexp
+ '("\\\\savegeometry{\\([^}]+\\)}"
+ 1 LaTeX-auto-geometry-savegeometry)
+ "Matches the argument of `\\savegeometry' from `geometry'
+package.")
+
+(defun LaTeX-geometry-auto-prepare ()
+ "Clear `LaTeX-auto-geometry-savegeometry' before parsing."
+ (setq LaTeX-auto-geometry-savegeometry nil))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-geometry-auto-prepare t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "geometry"
+ (lambda ()
+
+ ;; Add geometry to the parser.
+ (TeX-auto-add-regexp LaTeX-geometry-savegeometry-regexp)
+
+ ;; geometry commands:
+ (TeX-add-symbols
+ '("geometry"
+ (TeX-arg-eval TeX-read-key-val nil
+ (append LaTeX-geometry-preamble-key-val-options
+ LaTeX-geometry-always-key-val-options)))
+ '("newgeometry"
+ (TeX-arg-key-val LaTeX-geometry-always-key-val-options))
+
+ '("restoregeometry" 0)
+
+ '("savegeometry"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((name (TeX-read-string "Name: ")))
+ (LaTeX-add-geometry-savegeometries name)
+ (format "%s" name)))))
+
+ '("loadgeometry"
+ (TeX-arg-eval
+ (lambda ()
+ (completing-read "Name: "
+ (LaTeX-geometry-savegeometry-list))))))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("geometry" "{")
+ ("newgeometry" "{")
+ ("savegeometry" "{")
+ ("loadgeometry" "{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defun LaTeX-geometry-package-options ()
+ "Prompt for package options for the geometry package."
+ (TeX-read-key-val t
+ (append LaTeX-geometry-preamble-key-val-options
+ LaTeX-geometry-always-key-val-options)))
+
+;;; geometry.el ends here
--- /dev/null
+;;; gloss-italian.el --- Italian support for polyglossia package.
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Maintainer: auctex-devel@gnu.org
+;; Author: Mosè Giordano <mose@gnu.org>
+;; 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 is based on italian.el style file, adapted to polyglossia package.
+
+;;; Code:
+
+(defvar TeX-language-it-hook nil
+ "Hook run for Italian texts.")
+
+(TeX-add-style-hook
+ "gloss-italian"
+ (lambda ()
+ (TeX-add-symbols
+ '("textitalian" [TeX-arg-key-val LaTeX-polyglossia-italian-options-list] t))
+ (LaTeX-add-environments
+ '("italian"
+ LaTeX-env-args [TeX-arg-key-val LaTeX-polyglossia-italian-options-list]))
+
+ (when (or (LaTeX-polyglossia-lang-option-member "italian" "babelshorthands=true")
+ (LaTeX-polyglossia-lang-option-member "italian" "babelshorthands"))
+ (unless (eq (car TeX-quote-language) 'override)
+ (let ((open-quote (if (and (boundp 'LaTeX-italian-open-quote)
+ LaTeX-italian-open-quote)
+ LaTeX-italian-open-quote
+ "\"<"))
+ (close-quote (if (and (boundp 'LaTeX-italian-close-quote)
+ LaTeX-italian-close-quote)
+ LaTeX-italian-close-quote
+ "\">")))
+ (setq TeX-quote-language
+ `("italian" ,open-quote ,close-quote ,TeX-quote-after-quote))))
+
+ ;; Fontification of quotation marks.
+ (when (fboundp 'font-latex-add-quotes)
+ (font-latex-add-quotes '("\"<" "\">" french))))
+ (run-hooks 'TeX-language-it-hook))
+ LaTeX-dialect)
+
+(defvar LaTeX-polyglossia-italian-options-list
+ '(("babelshorthands" ("true" "false")))
+ "Italian language options for the polyglossia package.")
+
+;;; gloss-italian.el ends here
--- /dev/null
+;;; hologo.el --- AUCTeX style for `hologo.sty' (v1.10)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-10-31
+;; 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 `hologo.sty' (v1.10) from 2012/04/26.
+;; `hologo.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-hologo-logo-names
+ '("(La)TeX"
+ "AmSLaTeX"
+ "AmSTeX"
+ "biber"
+ "BibTeX"
+ "BibTeX8"
+ "ConTeXt"
+ "emTeX"
+ "eTeX"
+ "ExTeX"
+ "HanTheThanh"
+ "iniTeX"
+ "KOMAScript"
+ "La"
+ "LaTeX"
+ "LaTeX2e"
+ "LaTeX3"
+ "LaTeXe"
+ "LaTeXML"
+ "LaTeXTeX"
+ "LuaLaTeX"
+ "LuaTeX"
+ "LyX"
+ "METAFONT"
+ "MetaFun"
+ "METAPOST"
+ "MetaPost"
+ "MiKTeX"
+ "NTS"
+ "OzMF"
+ "OzMP"
+ "OzTeX"
+ "OzTtH"
+ "PCTeX"
+ "pdfTeX"
+ "pdfLaTeX"
+ "PiC"
+ "PiCTeX"
+ "plainTeX"
+ "SageTeX"
+ "SLiTeX"
+ "SliTeX"
+ "teTeX"
+ "TeX"
+ "TeX4ht"
+ "TTH"
+ "virTeX"
+ "VTeX"
+ "Xe"
+ "XeLaTeX"
+ "XeTeX")
+ "List of logos provided by \"hologo.sty\".")
+
+(defvar LaTeX-hologo-key-val-options-global
+ '(("break" ("true" "false"))
+ ("hyphenbreak" ("true" "false"))
+ ("spacebreak" ("true" "false"))
+ ("discretionarybreak" ("true" "false")))
+ "Global key=value options for hologo macros.")
+
+(defvar LaTeX-hologo-key-val-options-local
+ '(("variant" ("sf" "sc" ; BibTeX
+ "lift" ; SliTeX
+ "narrow" "simple" ; SliTeX, ConTeXt
+ "space" "hyphen" "runtogether"))) ; plainTeX
+ "Local key=value options for hologo macros.")
+
+(TeX-add-style-hook
+ "hologo"
+ (lambda ()
+ (TeX-add-symbols
+
+ ;; Insert logo macros
+ '("hologo" (TeX-arg-eval completing-read
+ "Logo name: " LaTeX-hologo-logo-names))
+
+ '("Hologo" (TeX-arg-eval completing-read
+ "Logo name: " LaTeX-hologo-logo-names))
+
+ ;; Setup macros
+ '("hologoSetup" (TeX-arg-key-val LaTeX-hologo-key-val-options-global))
+
+ '("hologoLogoSetup"
+ (TeX-arg-eval
+ (lambda ()
+ (let* ((logo (completing-read "Logo name: " LaTeX-hologo-logo-names))
+ (keyval (TeX-read-key-val
+ nil
+ (cond ((string= logo "BibTeX")
+ (append '(("variant" ("sf" "sc")))
+ LaTeX-hologo-key-val-options-global))
+ ((string= logo "ConTeXt")
+ (append '(("variant" ("narrow" "simple")))
+ LaTeX-hologo-key-val-options-global))
+ ((string= logo "plainTeX")
+ (append '(("variant" ("space" "hyphen" "runtogether")))
+ LaTeX-hologo-key-val-options-global))
+ ((or (string= logo "SLiTeX")
+ (string= logo "SliTeX"))
+ (append '(("variant" ("lift" "narrow" "lift")))
+ LaTeX-hologo-key-val-options-global))
+ (t
+ LaTeX-hologo-key-val-options-global)))))
+ (TeX-argument-insert logo optional)
+ (format "%s" keyval)))))
+
+ '("hologoDriverSetup" (TeX-arg-eval completing-read
+ "Driver: "
+ '("pdftex" "luatex"
+ "dvipdfm" "dvipdfmx"
+ "dvips" "dvipsone" "xdvi"
+ "xetex" "vtex" "driverfallback")))
+
+ '("hologoFontSetup"
+ (TeX-arg-key-val (("general") ("bibsf")
+ ("rm") ("sc") ("sf") ("sy") ("logo"))))
+
+ '("hologoLogoFontSetup"
+ (TeX-arg-eval
+ (lambda ()
+ (let* ((logo (completing-read "Logo name: "
+ '("BibTeX"
+ "ExTeX"
+ "SliTeX"
+ "AmS"
+ "NTS"
+ "KOMAScript"
+ "METAFONT"
+ "METAPOST")))
+ (keyval (TeX-read-key-val
+ nil
+ (cond ((string= logo "BibTeX")
+ '(("bibsf") ("sc")))
+ ((string= logo "ExTeX")
+ '(("rm") ("sy")))
+ ((string= logo "SliTeX")
+ '(("rm") ("sc")))
+ ((or (string= logo "AmS")
+ (string= logo "NTS"))
+ '(("sy")))
+ ((string= logo "KOMAScript")
+ '(("sf")))
+ ((or (string= logo "METAFONT")
+ (string= logo "METAPOST"))
+ '(("logo")))
+ (t
+ nil)))))
+ (TeX-argument-insert logo optional)
+ (format "%s" keyval)))))
+
+ ;; Additional user macros
+ '("hologoVariant"
+ (TeX-arg-eval completing-read
+ "Logo name: " LaTeX-hologo-logo-names)
+ (TeX-arg-eval
+ (lambda ()
+ (let ((setup (TeX-read-key-val
+ nil
+ (append LaTeX-hologo-key-val-options-local
+ LaTeX-hologo-key-val-options-global))))
+ (format "%s" setup)))))
+
+ '("HologoVariant"
+ (TeX-arg-eval completing-read
+ "Logo name: " LaTeX-hologo-logo-names)
+ (TeX-arg-eval
+ (lambda ()
+ (let ((setup (TeX-read-key-val
+ nil
+ (append LaTeX-hologo-key-val-options-local
+ LaTeX-hologo-key-val-options-global))))
+ (format "%s" setup)))))
+
+ '("hologoList" 0)
+
+ '("hologoEntry" "Logo name" "Variant" "Since"))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("hologo" "{")
+ ("Hologo" "{"))
+ 'textual)
+ (font-latex-add-keywords '(("hologoSetup" "{")
+ ("hologoLogoSetup" "{{")
+ ("hologoDriverSetup" "{")
+ ("hologoFontSetup" "{")
+ ("hologoLogoFontSetup" "{{")
+ ("hologoVariant" "{{")
+ ("HologoVariant" "{{")
+ ("hologoList" "")
+ ("hologoEntry" "{{{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-hologo-package-options nil
+ "Package options for the hologo package.")
+
+;;; hologo.el ends here
--- /dev/null
+;;; ifluatex.el --- AUCTeX style for `ifluatex.sty' version 1.3.
+
+;; Copyright (C) 2014, 2016 Free Software Foundation, Inc.
+
+;; Author: Davide G. M. Salvetti <salve@debian.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-11-15
+;; 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, see
+;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file adds support for `ifluatex.sty' 1.3.
+
+;;; Code:
+
+(defun LaTeX-ifluatex-set-exit-mark (optional)
+ "Discard OPTIONAL and set exit-mark to current point."
+ (set-marker exit-mark (point)))
+
+(TeX-add-style-hook
+ "ifluatex"
+ (lambda ()
+ (TeX-add-symbols
+ '("ifluatex"
+ (TeX-arg-literal "%\n")
+ LaTeX-ifluatex-set-exit-mark
+ (TeX-arg-literal "\n\\else%\n\\fi%"))
+ '("luatexversion" 0)
+ '("luatexrevision" 0))
+ (TeX-declare-expert-macros
+ "ifluatex"
+ "ifluatex" "luatexversion" "luatexrevision")
+
+ ;; This package is used to make it possible to compile a document with both
+ ;; LuaTeX and base TeX engines. By setting `TeX-check-engine-list' to nil
+ ;; we ignore engine restrictions posed by other packages.
+ (setq TeX-check-engine-list nil)
+
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("luatexversion")
+ ("luatexrevision"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-ifluatex-package-options nil
+ "Package options for the ifluatex package.")
+
+;;; ifluatex.el ends here
--- /dev/null
+;;; jsreport.el - Special code for jsreport class.
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Ikumi Keita <ikumi@ikumi.que.jp>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-03-23
+;; 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:
+
+;; Please write me.
+
+;;; Code:
+
+(defvar LaTeX-jsreport-class-options
+ '("a3paper" "a4paper" "a5paper" "a6paper" "b4paper" "b5paper" "b6paper"
+ "a4j" "a5j" "b4j" "b5j" "a4var" "b5var" "letterpaper" "legalpaper"
+ "executivepaper" "landscape"
+ "8pt" "9pt" "10pt" "11pt" "12pt" "14pt" "17pt" "20pt" "21pt" "25pt"
+ "30pt" "36pt" "43pt" "12Q" "14Q" "usemag" "nomag" "nomag*"
+ "tombow" "tombo" "mentuke" "oneside" "twoside" "vartwoside"
+ "onecolumn" "twocolumn" "titlepage" "notitlepage"
+ "openright" "openleft" "openany" "leqno" "fleqn"
+ "disablejfam" "draft" "final" "mingoth" "wingoth" "jis"
+ "uplatex" "autodetect-engine" "papersize" "english" "jslogo" "nojslogo")
+ "Class options for the jsreport class.")
+
+(TeX-add-style-hook
+ "jsreport"
+ (lambda ()
+ (LaTeX-largest-level-set "chapter")
+ (LaTeX-add-counters "part" "chapter" "section" "subsection" "subsubsection"
+ "paragraph" "subparagraph" "figure" "table")
+ (LaTeX-add-pagestyles "headings" "myheadings")
+ (LaTeX-add-environments "abstract"))
+ LaTeX-dialect)
+
+;;; jsreport.el ends here
--- /dev/null
+;;; ltablex.el --- AUCTeX style for `ltablex.sty' (v1.1)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-03-14
+;; 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 `ltablex.sty' (v1.1) from 2014/08/13.
+;; `ltablex.sty' is part of TeXLive. `ltablex.sty' modifies the
+;; tabularx environment to combine the features of the tabularx
+;; package with those of the longtable package. All we need is to
+;; call those styles and add two macros.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "ltablex"
+ (lambda ()
+ (TeX-run-style-hooks "tabularx" "longtable")
+ (TeX-add-symbols
+ '("keepXColumns" 0)
+ '("convertXColumns" 0)))
+ LaTeX-dialect)
+
+(defvar LaTeX-ltablex-package-options nil
+ "Package options for the ltablex package.")
+
+;;; ltablex.el ends here
--- /dev/null
+;;; ltxtable.el --- AUCTeX style for `ltxtable.sty' (v0.2)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-03-14
+;; 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 `ltxtable.sty' (v0.2) from 1995/12/11.
+;; `ltxtable.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-ltxtable-file-regexp
+ `(,(concat "\\\\LTXtable"
+ "{\\(?:[^}]+\\)}"
+ "{\\(\\.*[^#}%\\\\\\.\n\r]+\\)\\(\\.[^#}%\\\\\\.\n\r]+\\)?}")
+ 1 TeX-auto-file)
+ "Matches the file argument of \\LTXtable marco from ltxtable package.
+The regexp for the 2. argument is the same as for \"input\" and
+\"include\" entries in `LaTeX-auto-regexp-list'.")
+
+(TeX-add-style-hook
+ "ltxtable"
+ (lambda ()
+ (TeX-run-style-hooks "tabularx" "longtable")
+
+ (TeX-add-symbols
+ '("LTXtable"
+ (TeX-arg-length "Width" "1.0\\linewidth")
+ (TeX-arg-eval
+ (lambda ()
+ (let ((longtable (file-relative-name
+ (read-file-name "File with longtable: "))))
+ (format "%s" longtable))))))
+
+ ;; Make sure that \LTXtable stays in its own line:
+ (LaTeX-paragraph-commands-add-locally "LTXtable")
+
+ ;; Tell AUCTeX about a new file-include command:
+ (TeX-auto-add-regexp LaTeX-ltxtable-file-regexp)
+
+ ;; Tell RefTeX about a new file-include command: Add
+ ;; LTXtable{<width>} as a regexp (without \) to
+ ;; `reftex-include-file-commands' and run
+ ;; `reftex-compile-variables'. Do this all only once.
+ (when (and (boundp 'reftex-include-file-commands)
+ (not (string-match "LTXtable"
+ (mapconcat #'identity reftex-include-file-commands "|"))))
+ (add-to-list 'reftex-include-file-commands "LTXtable{\\(?:[^}]+\\)}" t)
+ (reftex-compile-variables))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("LTXtable" "{{"))
+ 'textual)))
+ LaTeX-dialect)
+
+(defvar LaTeX-ltxtable-package-options nil
+ "Package options for the ltxtable package.")
+
+;;; ltxtable.el ends here
--- /dev/null
+;;; luatextra.el --- AUCTeX style for `luatextra.sty' version 1.0.
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Davide G. M. Salvetti <salve@debian.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-11-15
+;; 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, see
+;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file adds support for `luatextra.sty' 1.0.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "luatextra"
+ (lambda ()
+ (TeX-run-style-hooks "ifluatex" "fontspec"
+ ;; FIXME: yet to be written:
+ ;; "luatexbase"
+ "metalogo" "luacode"))
+ LaTeX-dialect)
+
+(defvar LaTeX-luatextra-package-options nil
+ "Package options for the ifluatex package.")
+
+;;; luatextra.el ends here
--- /dev/null
+;;; mdframed.el --- AUCTeX style for `mdframed.sty' (v1.9b)
+
+;; Copyright (C) 2016, 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-06-26
+;; 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 `mdframed.sty' (v1.9b) from 2013/07/01.
+;; `mdframed.sty' is part of TeXLive.
+
+;; This style offers only a set of mandatory options for completion
+;; while loading the package
+;; (cf. `LaTeX-mdframed-package-options-list'). All other options are
+;; offered for completion as part of `\mdfsetup'. Please use this
+;; command to set options of the package.
+
+;;; Code:
+
+;; Needed for compiling `pushnew':
+(eval-when-compile (require 'cl))
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+(defvar LaTeX-mdframed-key-val-options
+ '(;; 6.2. Restoring the settings
+ ("style" ("defaultoptions"))
+ ("default")
+ ;; 6.3. Options with lengths
+ ("defaultunit" ("pt" "pc" "in" "bp" "cm" "mm" "dd" "cc" "sp" "ex" "em"))
+ ("skipabove")
+ ("skipbelow")
+ ("leftmargin")
+ ("rightmargin")
+ ("innerleftmargin")
+ ("innerrightmargin")
+ ("innertopmargin")
+ ("innerbottommargin")
+ ("linewidth")
+ ("innerlinewidth")
+ ("middlelinewidth")
+ ("outerlinewidth")
+ ("roundcorner")
+ ;; 6.4. Colored Options
+ ("linecolor")
+ ("innerlinecolor")
+ ("middlelinecolor")
+ ("outerlinecolor")
+ ("backgroundcolor")
+ ("fontcolor")
+ ("font")
+ ;; 6.5. Shadows
+ ("shadowsize")
+ ("shadowcolor")
+ ;; 6.6. Hidden Lines
+ ("topline" ("true" "false"))
+ ("rightline" ("true" "false"))
+ ("leftline" ("true" "false"))
+ ("bottomline" ("true" "false"))
+ ("hidealllines" ("true" "false"))
+ ;; 6.7. Working in twoside-mode
+ ("outermargin")
+ ("innermargin")
+ ("usetwoside" ("true" "false"))
+ ;; 6.8. Footnotes
+ ("footnotedistance")
+ ("footnoteinside" ("true" "false"))
+ ;; 6.9. Page breaks
+ ("nobreak" ("true" "false"))
+ ("everyline" ("true" "false"))
+ ("splittopskip")
+ ("splitbottomskip")
+ ;; 6.10. Frametitle
+ ("frametitle")
+ ("frametitlefont")
+ ("frametitlealignment" ("\\raggedleft" "\\raggedright" "\\centering"))
+ ("frametitlerule" ("true" "false"))
+ ("frametitlerulewidth")
+ ("frametitleaboveskip")
+ ("frametitlebelowskip")
+ ("frametitlebackgroundcolor")
+ ("repeatframetitle" ("true" "false"))
+ ;; 6.11. Title commands inside the environment
+ ("subtitleaboveline" ("true" "false"))
+ ("subtitlebelowline" ("true" "false"))
+ ("subtitlefont")
+ ("subtitlebackgroundcolor")
+ ("subtitleabovelinecolor")
+ ("subtitlebelowlinecolor")
+ ("subtitleabovelinewidth")
+ ("subtitlebelowlinewidth")
+ ("subtitleaboveskip")
+ ("subtitlebelowskip")
+ ("subtitleinneraboveskip")
+ ("subtitleinnerbelowskip")
+ ;; 6.12. General options
+ ("ntheorem" ("true" "false"))
+ ("needspace")
+ ("ignorelastdescenders" ("true" "false"))
+ ("userdefinedwidth" ("\\linewidth" "\\columnwidth"))
+ ("align" ("left" "right" "center"))
+ ;; 6.13. TikZ options
+ ("tikzsetting")
+ ("apptotikzsetting")
+ ;; 6.14. PSTricks options
+ ("pstrickssetting")
+ ("pstricksappsetting")
+ ;; 7. Hooks and Bools
+ ("settings")
+ ("extra")
+ ("singleextra")
+ ("firstextra")
+ ("middleextra")
+ ("secondextra")
+ ("mdfsingleframe" ("true" "false"))
+ ("mdffirstframe" ("true" "false"))
+ ("mdfmiddleframe" ("true" "false"))
+ ("mdflastframe" ("true" "false"))
+ ("beforesingleframe")
+ ("aftersingleframe")
+ ("beforebreak")
+ ("afterbreak")
+ ("beforelastframe")
+ ("afterlastframe")
+ ("startcode")
+ ("startinnercode")
+ ("endinnercode")
+ ("endcode")
+ ;; 8. Theorems
+ ("theoremseparator")
+ ("theoremtitlefont")
+ ("theoremspace"))
+ "Key=value options for mdframed macros and environments.")
+
+(defvar LaTeX-mdframed-key-val-options-local nil
+ "Buffer-local key=value options for mdframed macros and environments.")
+(make-variable-buffer-local 'LaTeX-mdframed-key-val-options-local)
+
+;; Setup for \newmdenv
+
+(TeX-auto-add-type "mdframed-newmdenv" "LaTeX")
+
+(defvar LaTeX-mdframed-newmdenv-regexp
+ `(,(concat
+ "\\\\newmdenv"
+ "[ \t\n\r%]*"
+ "\\(?:\\[[^][]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*}[^}{]*\\)*"
+ "}[^}{]*\\)*"
+ "}[^][]*\\)*"
+ "\\]\\)?"
+ "[ \t\n\r%]*"
+ "{\\([^}]+\\)}")
+ 1 LaTeX-auto-mdframed-newmdenv)
+ "Matches the argument of \\newmdenv from mdframed package.")
+
+;; Setup for \mdfdefinestyle
+
+(TeX-auto-add-type "mdframed-mdfdefinestyle" "LaTeX")
+
+(defvar LaTeX-mdframed-mdfdefinestyle-regexp
+ '("\\\\mdfdefinestyle[ \t\n\r%]*{\\([^}]+\\)}"
+ 1 LaTeX-auto-mdframed-mdfdefinestyle)
+ "Matches the argument of \\mdfdefinestyle from mdframed package.")
+
+;; Setup for \newmdtheoremenv & \mdtheorem
+
+(TeX-auto-add-type "mdframed-mdtheorem" "LaTeX")
+
+(defvar LaTeX-mdframed-mdtheorem-regexp
+ `(,(concat
+ "\\\\\\(new\\)?mdtheorem\\(?:env\\)?"
+ "[ \t\n\r%]*"
+ "\\(?:\\[[^][]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*}[^}{]*\\)*"
+ "}[^}{]*\\)*"
+ "}[^][]*\\)*"
+ "\\]\\)?"
+ "[ \t\n\r%]*"
+ "{\\([^}]+\\)}")
+ (2 1) LaTeX-auto-mdframed-mdtheorem)
+ "Matches the argument of \\newmdtheoremenv and \\mdtheorem from mdframed package.")
+
+(defun LaTeX-mdframed-update-style-key ()
+ "Update some key=values in `LaTeX-mdframed-key-val-options-local'."
+ ;; Add new "style"s to key=vals:
+ (when (LaTeX-mdframed-mdfdefinestyle-list)
+ (let* ((key (car (assoc "style" LaTeX-mdframed-key-val-options-local)))
+ (val (cadr (assoc "style" LaTeX-mdframed-key-val-options)))
+ (temp (copy-alist LaTeX-mdframed-key-val-options-local))
+ (opts (assq-delete-all (car (assoc key temp)) temp)))
+ (pushnew (list key (TeX-delete-duplicate-strings
+ (append val (mapcar #'car (LaTeX-mdframed-mdfdefinestyle-list)))))
+ opts :test #'equal)
+ (setq LaTeX-mdframed-key-val-options-local
+ (copy-alist opts))))
+ ;;
+ ;; Check if any color defininig package is loaded and update the
+ ;; key=values for coloring. Prefer xcolor.sty if both packages are
+ ;; loaded.
+ (when (or (member "xcolor" (TeX-style-list))
+ (member "color" (TeX-style-list)))
+ (let* ((colorcmd (if (member "xcolor" (TeX-style-list))
+ #'LaTeX-xcolor-definecolor-list
+ #'LaTeX-color-definecolor-list))
+ (keys '("linecolor"
+ "innerlinecolor"
+ "middlelinecolor"
+ "outerlinecolor"
+ "backgroundcolor"
+ "fontcolor"
+ "shadowcolor"
+ "frametitlebackgroundcolor"
+ "subtitlebackgroundcolor"
+ "subtitleabovelinecolor"
+ "subtitlebelowlinecolor"))
+ (tmp (copy-alist LaTeX-mdframed-key-val-options-local)))
+ (dolist (x keys)
+ (setq tmp (assq-delete-all (car (assoc x tmp)) tmp))
+ (pushnew (list x (mapcar #'car (funcall colorcmd))) tmp :test #'equal))
+ (setq LaTeX-mdframed-key-val-options-local
+ (copy-alist tmp)))))
+
+(defun LaTeX-mdframed-auto-prepare ()
+ "Clear variables before parsing for mdframed package."
+ (setq LaTeX-auto-mdframed-newmdenv nil
+ LaTeX-auto-mdframed-mdfdefinestyle nil
+ LaTeX-auto-mdframed-mdtheorem nil))
+
+(defun LaTeX-mdframed-auto-cleanup ()
+ "Process parsed elements for mdframed package."
+ (dolist (env (mapcar #'car (LaTeX-mdframed-newmdenv-list)))
+ (LaTeX-add-environments
+ `(,env LaTeX-env-args [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ] ))
+ (TeX-ispell-skip-setcdr `((,env ispell-tex-arg-end 0))))
+ (dolist (newenv (LaTeX-mdframed-mdtheorem-list))
+ (let ((env (car newenv))
+ (new (cadr newenv)))
+ (LaTeX-add-environments (list env (vector "Heading")))
+ (unless (and new (not (string= new "")))
+ (LaTeX-add-environments (list (concat env "*") (vector "Heading"))))))
+ (LaTeX-mdframed-update-style-key))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-mdframed-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-mdframed-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "mdframed"
+ (lambda ()
+
+ ;; Add mdframed to the parser
+ (TeX-auto-add-regexp LaTeX-mdframed-newmdenv-regexp)
+ (TeX-auto-add-regexp LaTeX-mdframed-mdfdefinestyle-regexp)
+ (TeX-auto-add-regexp LaTeX-mdframed-mdtheorem-regexp)
+
+ ;; Local version of key-val options
+ (setq LaTeX-mdframed-key-val-options-local
+ (copy-alist LaTeX-mdframed-key-val-options))
+
+ ;; 4. Commands
+ (TeX-add-symbols
+ '("mdfsetup"
+ (TeX-arg-key-val LaTeX-mdframed-key-val-options-local))
+
+ '("newmdenv"
+ [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((env (TeX-read-string
+ (TeX-argument-prompt optional nil "Environment"))))
+ (LaTeX-add-environments
+ `(,env LaTeX-env-args [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]))
+ ;; Add new env's to `ispell-tex-skip-alist': skip the optional argument
+ (TeX-ispell-skip-setcdr `((,env ispell-tex-arg-end 0)))
+ (format "%s" env)))))
+
+ '("renewmdenv"
+ [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Environment")
+ (LaTeX-mdframed-newmdenv-list)))
+
+ '("surroundwithmdframed"
+ [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+ TeX-arg-environment)
+
+ '("mdflength"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Length")
+ '(("skipabove")
+ ("skipbelow")
+ ("leftmargin")
+ ("rightmargin")
+ ("innerleftmargin")
+ ("innerrightmargin")
+ ("innertopmargin")
+ ("innerbottommargin")
+ ("linewidth")
+ ("innerlinewidth")
+ ("middlelinewidth")
+ ("outerlinewidth"))))
+
+ ;; 5. Defining your own style
+ '("mdfdefinestyle"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((style (TeX-read-string
+ (TeX-argument-prompt optional nil "Style name"))))
+ (LaTeX-add-mdframed-mdfdefinestyles style)
+ (LaTeX-mdframed-update-style-key)
+ (format "%s" style))))
+ (TeX-arg-key-val LaTeX-mdframed-key-val-options-local))
+
+ '("mdfapptodefinestyle"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Style name")
+ (LaTeX-mdframed-mdfdefinestyle-list))
+ (TeX-arg-key-val LaTeX-mdframed-key-val-options-local))
+
+ ;; 6.11. Title commands inside the environment
+ '("mdfsubtitle"
+ [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+ "Subtitle")
+
+ ;; 8. Theorems
+ '("newmdtheoremenv"
+ [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((nthm (TeX-read-string
+ (TeX-argument-prompt optional nil "Environment"))))
+ (LaTeX-add-environments (list nthm (vector "Heading")))
+ (format "%s" nthm))))
+ [ TeX-arg-environment "Numbered like" ]
+ t [ (TeX-arg-eval progn (if (eq (save-excursion
+ (backward-char 2)
+ (preceding-char)) ?\])
+ ()
+ (TeX-arg-counter t "Within counter"))
+ "") ])
+
+ '("mdtheorem"
+ [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((nthm (TeX-read-string
+ (TeX-argument-prompt optional nil "Environment"))))
+ (LaTeX-add-environments (list nthm (vector "Heading"))
+ (list (concat nthm "*") (vector "Heading")))
+ (format "%s" nthm))))
+ [ TeX-arg-environment "Numbered like" ]
+ t [ (TeX-arg-eval progn (if (eq (save-excursion
+ (backward-char 2)
+ (preceding-char)) ?\])
+ ()
+ (TeX-arg-counter t "Within counter"))
+ "") ]))
+
+ ;; Main environment defined by mdframed.sty
+ (LaTeX-add-environments
+ '("mdframed" LaTeX-env-args
+ [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ] ))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("newmdenv" "[{")
+ ("renewmdenv" "[{")
+ ("surroundwithmdframed" "[{")
+ ("mdfsetup" "[{")
+ ("mdfdefinestyle" "{{")
+ ("mdfapptodefinestyle" "{{")
+ ("newmdtheoremenv" "[{[{[")
+ ("mdtheorem" "[{[{["))
+ 'function)
+ (font-latex-add-keywords '(("mdfsubtitle" "[{"))
+ 'sectioning-5)
+ (font-latex-add-keywords '(("mdflength" "{"))
+ 'variable)))
+ LaTeX-dialect)
+
+(defvar LaTeX-mdframed-package-options-list
+ '(("xcolor")
+ ("framemethod" ("default" "tex" "latex" "none" "0"
+ "tikz" "pgf" "1"
+ "pstricks" "ps" "postscript" "2"))
+ ("tikz") ("TikZ")
+ ("ps") ("pstricks") ("PSTricks"))
+ "Package options for the framed package.")
+
+(defun LaTeX-mdframed-package-options ()
+ "Prompt for package options for the mdframed package."
+ (TeX-read-key-val t LaTeX-mdframed-package-options-list))
+
+;;; mdframed.el ends here
--- /dev/null
+;;; mdsymbol.el --- AUCTeX style for `mdsymbol.sty' (v0.5)
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-10-25
+;; 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 `mdsymbol.sty' (v0.5) from 2012/11/18.
+;; The latest version of is available from <https://www.github.com/sebschub>.
+;; `mdsymbol.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "mdsymbol"
+ (lambda ()
+
+ ;; Run style hook for various packages loaded by mdsymbol
+ (TeX-run-style-hooks "textcomp" "amsmath")
+
+ ;; New symbols
+ (TeX-add-symbols
+
+ ;; These macros take one argument; we follow latex.el and use the
+ ;; t specifier for the argument; over- and underbrace and sqrt are
+ ;; already available
+ '("overgroup" t)
+ '("undergroup" t)
+ '("overlinesegment" t)
+ '("overleftharpoon" t)
+ '("overrightharpoon" t)
+ '("underlinesegment" t)
+ ;;
+ '("widehat" t)
+ '("widetilde" t)
+ '("wideparen" t)
+ '("vec" t)
+ '("middlebar" t)
+ '("middleslash" t)
+ '("strokethrough" t)
+ ;;
+ '("overlining" t))
+
+ ;; The following macros are usually defined, since retainmissing
+ ;; defaults to false
+ (unless (or (LaTeX-provided-package-options-member "mdsymbol" "retainmissing=true")
+ (LaTeX-provided-package-options-member "mdsymbol" "retainmissing"))
+ (TeX-add-symbols
+ '("dagger")
+ '("ddagger")
+ '("mathparagraph")
+ '("mathsection")
+ '("mathdollar")
+ '("mathsterling")
+ '("yen")
+ '("hbar")
+ '("hslash")
+ '("circledR")
+ '("circledS")
+ '("lambdabar")
+ '("lambdaslash"))))
+ LaTeX-dialect)
+
+(defvar LaTeX-mdsymbol-package-options
+ '(;;
+ ("normalweight" ("Light" "Regular" "autolight" "autoregular"))
+ ("boldweight" ("Semibold" "Bold" "autosemibold"))
+ ("onlysansmath" ("true" "false"))
+ ("retainmissing" ("true" "false"))
+ ("scale")
+ ("largedelims" ("true" "false")))
+ "Package options for the mdsymbol package.")
+
+(defun LaTeX-mdsymbol-package-options nil
+ "Prompt for package options for the mdsymbol package."
+ (TeX-read-key-val t LaTeX-mdsymbol-package-options))
+
+;;; mdsymbol.el ends here
--- /dev/null
+;;; menukeys.el --- AUCTeX style for `menukeys.sty' (v1.4)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-02-07
+;; 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 `menukeys.sty' (v1.4) from 2016/04/18.
+;; `menukeys.sty' is part of TeXLive.
+
+;;; Code:
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+(defvar LaTeX-menukeys-input-separators-list
+ '("/" "=" "*" "+" "," ";" ":" "-" ">" "<" "bslash")
+ "List of input separators for macros of menukeys package.")
+
+(defvar LaTeX-menukeys-predefined-styles-list
+ '("menus" "roundedmenus" "angularmenus" "roundedkeys"
+ "shadowedroundedkeys" "angularkeys" "shadowedangularkeys"
+ "typewriterkeys" "paths" "pathswithfolder"
+ "pathswithblackfolder" "hyphenatepaths"
+ "hyphenatepathswithfolder"
+ "hyphenatepathswithblackfolder")
+ "List of predefined styles for macros from menukeys package.")
+
+;; Setup for \newmenustyle(simple):
+(TeX-auto-add-type "menukeys-newmenustyle" "LaTeX")
+
+(defvar LaTeX-menukeys-newmenustyle-regexp
+ '("\\\\\\(?:new\\|copy\\)menustyle\\(?:simple\\)?*?{\\([^}]+\\)}"
+ 1 LaTeX-auto-menukeys-newmenustyle)
+ "Matches the argument of \\newmenustyle and
+\\newmenustylesimple from menukeys package.")
+
+;; Setup for \newmenucolortheme:
+(TeX-auto-add-type "menukeys-newmenucolortheme" "LaTeX")
+
+(defvar LaTeX-menukeys-newmenucolortheme-regexp
+ '("\\\\\\(?:new\\|copy\\)menucolortheme{\\([^}]+\\)}"
+ 1 LaTeX-auto-menukeys-newmenucolortheme)
+ "Matches the argument of \\newmenucolortheme from menukeys package.")
+
+;; Setup for \newmenumacro:
+(TeX-auto-add-type "menukeys-newmenumacro" "LaTeX")
+
+(defvar LaTeX-menukeys-newmenumacro-regexp
+ `(,(concat
+ "\\\\\\(new\\|renew\\|provide\\)menumacro"
+ "{?"
+ (regexp-quote TeX-esc)
+ "\\([a-zA-Z]+\\)"
+ "}?"
+ "\\(?:\\[\\([^]]*\\)\\]\\)?")
+ (2 3 1) LaTeX-auto-menukeys-newmenumacro)
+ "Matches the arguments of \\newmenumacro from menukeys package.")
+
+(defun LaTeX-menukeys-auto-prepare ()
+ "Clear various `LaTeX-auto-menukeys-*' variables before parsing."
+ (setq LaTeX-auto-menukeys-newmenustyle nil
+ LaTeX-auto-menukeys-newmenucolortheme nil
+ LaTeX-auto-menukeys-newmenumacro nil))
+
+(defun LaTeX-menukeys-auto-cleanup ()
+ "Process the parsed elements for menukeys package.
+This function adds parsed elements from the variable
+`LaTeX-menukeys-newmenumacro-list' to AUCTeX via the function
+`TeX-add-symbols'. The variable
+`LaTeX-menukeys-newmenumacro-list' and not the function with the
+same name is used since this function looks for the order of
+commands which are set by \\renewmenumacro in order to pick the
+current separator. These renew-commands are also removed first
+from the variable `TeX-symbol-list' before being re-added."
+ (dolist (x (apply #'append LaTeX-menukeys-newmenumacro-list))
+ (let ((macro (nth 0 x))
+ (sep (nth 1 x))
+ (renew (when (string= (nth 2 x) "renew")
+ (nth 2 x))))
+ ;; When we are renewmenumacro'ing, delete the entry first from the
+ ;; variable `TeX-symbol-list' and then add the new spec:
+ (when renew
+ (setq TeX-symbol-list
+ (assq-delete-all (car (assoc macro (TeX-symbol-list))) TeX-symbol-list)))
+ (TeX-add-symbols
+ `(,macro [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil
+ ,(concat "Input separator "
+ "(default "
+ (if (and sep (not (string= sep "")))
+ sep
+ ",")
+ ")"))
+ LaTeX-menukeys-input-separators-list ] t ))
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords `((,macro "[{"))
+ 'textual)))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-menukeys-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-menukeys-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun TeX-arg-menukeys-newmenumacro (optional &optional renew)
+ "Query and insert the arguments of \\newmenumacro from menukeys package.
+After inserting, add the name of macro and the optional separator
+to the name of known macros via `TeX-add-symbols'. If
+font-latex.el is loaded, also use `font-latex-add-keywords' on
+macro. If RENEW is non-nil, query for an already defined macro."
+ (let ((macro (if renew
+ (completing-read
+ (concat "Macro: " TeX-esc)
+ (TeX-delete-duplicate-strings (mapcar #'car (LaTeX-menukeys-newmenumacro-list))))
+ (TeX-read-string (concat "Macro: " TeX-esc))))
+ (sep (completing-read
+ (TeX-argument-prompt optional nil "Input separator (default ,)")
+ LaTeX-menukeys-input-separators-list))
+ (style (completing-read
+ (TeX-argument-prompt optional nil "Style")
+ (LaTeX-menukeys-newmenustyle-list))))
+ (TeX-argument-insert (concat TeX-esc macro) optional)
+ (when (and sep (not (string= sep "")))
+ (insert (format "[%s]" sep)))
+ (TeX-argument-insert style optional)
+ ;; When we are renewmenumacro'ing, delete the entry first from the
+ ;; variable `TeX-symbol-list' and then add the new spec:
+ (when renew
+ (setq TeX-symbol-list
+ (assq-delete-all (car (assoc macro (TeX-symbol-list))) TeX-symbol-list)))
+ (TeX-add-symbols
+ `(,macro [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil
+ ,(concat "Input separator "
+ "(default "
+ (if (and sep (not (string= sep "")))
+ sep
+ ",")
+ ")"))
+ LaTeX-menukeys-input-separators-list ] t ))
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords `((,macro "[{"))
+ 'textual))))
+
+(TeX-add-style-hook
+ "menukeys"
+ (lambda ()
+
+ ;; Add menukeys to the parser
+ (TeX-auto-add-regexp LaTeX-menukeys-newmenustyle-regexp)
+ (TeX-auto-add-regexp LaTeX-menukeys-newmenucolortheme-regexp)
+ (TeX-auto-add-regexp LaTeX-menukeys-newmenumacro-regexp)
+
+ ;; Activate predefined stuff
+ (apply #'LaTeX-add-menukeys-newmenustyles LaTeX-menukeys-predefined-styles-list)
+ (LaTeX-add-menukeys-newmenucolorthemes "gray" "blacknwhite")
+
+ ;; Run style hooks for xcolor, tikz and relsize
+ (TeX-run-style-hooks "xcolor" "tikz" "relsize")
+
+ ;; 4.1 Basic macros: These are not defined if the package option
+ ;; definemenumacros ist set to false (default is true). We check
+ ;; for the package option here and add them.
+ (unless (LaTeX-provided-package-options-member "menukeys" "definemenumacros=false")
+ (TeX-add-symbols
+ ;; \menu [<separator>]{<sequence>}
+ ;; \directory [<separator>]{path}
+ ;; \keys [<separator>]{keystrokes}
+ '("menu"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Input separator")
+ LaTeX-menukeys-input-separators-list ]
+ t)
+
+ '("directory"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Input separator")
+ LaTeX-menukeys-input-separators-list ]
+ t)
+
+ '("keys"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Input separator")
+ LaTeX-menukeys-input-separators-list ]
+ t)))
+
+ (TeX-add-symbols
+ ;; 4.2.1 Predefined styles
+ ;; \drawtikzfolder[<front fill>][<draw>]
+ '("drawtikzfolder"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Front color")
+ (LaTeX-xcolor-definecolor-list) ]
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Line color")
+ (LaTeX-xcolor-definecolor-list) ] )
+
+ ;; 4.2.2 Declaring styles
+ ;; \newmenustylesimple*{<name>}[<pre>]{<style>}[<sep>][<post>]{<theme>}
+ '("newmenustylesimple"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((name (TeX-read-string
+ (TeX-argument-prompt optional nil "Name"))))
+ (LaTeX-add-menukeys-newmenustyles name)
+ (format "%s" name))))
+ [ t ] nil [ nil ] [ nil ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color theme")
+ (LaTeX-menukeys-newmenucolortheme-list)))
+
+ '("newmenustylesimple*"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((name (TeX-read-string
+ (TeX-argument-prompt optional nil "Name"))))
+ (LaTeX-add-menukeys-newmenustyles name)
+ (format "%s" name))))
+ [ t ] nil [ nil ] [ nil ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color theme")
+ (LaTeX-menukeys-newmenucolortheme-list)))
+
+ ;; \newmenustyle*{<name>}[<pre>]{<first>}[<sep>]{<mid>}{<last>}{<single>}[<post>]{<theme>}
+ '("newmenustyle"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((name (TeX-read-string
+ (TeX-argument-prompt optional nil "Name"))))
+ (LaTeX-add-menukeys-newmenustyles name)
+ (format "%s" name))))
+ [ t ] nil [ nil ] nil nil nil [ nil ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color theme")
+ (LaTeX-menukeys-newmenucolortheme-list)))
+
+ '("newmenustyle*"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((name (TeX-read-string
+ (TeX-argument-prompt optional nil "Name"))))
+ (LaTeX-add-menukeys-newmenustyles name)
+ (format "%s" name))))
+ [ t ] nil [ nil ] nil nil nil [ nil ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color theme")
+ (LaTeX-menukeys-newmenucolortheme-list)))
+
+ '("CurrentMenuElement" 0)
+
+ ;; 4.2.3 Copying styles
+ '("copymenustyle"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((copy (TeX-read-string
+ (TeX-argument-prompt optional nil "Copy")))
+ (orig (completing-read
+ (TeX-argument-prompt optional nil "Original")
+ (LaTeX-menukeys-newmenustyle-list))))
+ (LaTeX-add-menukeys-newmenustyles copy)
+ (TeX-argument-insert copy optional)
+ (format "%s" orig)))))
+
+ ;; 4.2.4 Changing styles
+ ;; \changemenuelement*{name}{element}{definition}
+ '("changemenuelement"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Name")
+ (LaTeX-menukeys-newmenustyle-list))
+ 2)
+
+ '("changemenuelement*"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Name")
+ (LaTeX-menukeys-newmenustyle-list))
+ 2)
+
+ ;; Same arguments as \newmenustylesimple
+ '("renewmenustylesimple"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Name")
+ (LaTeX-menukeys-newmenustyle-list))
+ [ t ] nil [ nil ] [ nil ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color theme")
+ (LaTeX-menukeys-newmenucolortheme-list)))
+
+ '("providemenustylesimple"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((name (TeX-read-string
+ (TeX-argument-prompt optional nil "Name"))))
+ (LaTeX-add-menukeys-newmenustyles name)
+ (format "%s" name))))
+ [ t ] nil [ nil ] [ nil ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color theme")
+ (LaTeX-menukeys-newmenucolortheme-list)))
+
+ ;; Same arguments as \newmenustyle
+ '("providemenustyle"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Name")
+ (LaTeX-menukeys-newmenustyle-list))
+ [ t ] nil [ nil ] nil nil nil [ nil ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color theme")
+ (LaTeX-menukeys-newmenucolortheme-list)))
+
+ '("renewmenustyle"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((name (TeX-read-string
+ (TeX-argument-prompt optional nil "Name"))))
+ (LaTeX-add-menukeys-newmenustyles name)
+ (format "%s" name))))
+ [ t ] nil [ nil ] nil nil nil [ nil ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color theme")
+ (LaTeX-menukeys-newmenucolortheme-list)))
+
+ ;; 4.3 Color themes
+ ;; 4.3.2 Create a theme
+ ;; \newmenucolortheme{<name>}{<model>}{<bg>}{<br>}{<txt>}[<a>][<b>][<c>]
+ '("newmenucolortheme"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((name (TeX-read-string
+ (TeX-argument-prompt optional nil "Name"))))
+ (LaTeX-add-menukeys-newmenucolorthemes name)
+ (format "%s" name))))
+ (TeX-arg-eval
+ (lambda ()
+ (let ((model (completing-read
+ (TeX-argument-prompt optional nil "Model")
+ (LaTeX-xcolor-color-models))))
+ (TeX-argument-insert model optional)
+ (if (string= model "named")
+ (let ((bg (completing-read
+ (TeX-argument-prompt optional nil "Node background color")
+ (LaTeX-xcolor-definecolor-list)))
+ (br (completing-read
+ (TeX-argument-prompt optional nil "Node border color")
+ (LaTeX-xcolor-definecolor-list)))
+ (txt (completing-read
+ (TeX-argument-prompt optional nil "Node text color")
+ (LaTeX-xcolor-definecolor-list))))
+ (TeX-argument-insert bg optional)
+ (TeX-argument-insert br optional)
+ (format "%s" txt))
+ (let ((bg (TeX-read-string
+ (TeX-argument-prompt optional nil "Node background color spec")))
+ (br (TeX-read-string
+ (TeX-argument-prompt optional nil "Node border color spec")))
+ (txt (TeX-read-string
+ (TeX-argument-prompt optional nil "Node text color spec"))))
+ (TeX-argument-insert bg optional)
+ (TeX-argument-insert br optional)
+ (format "%s" txt))))))
+ (TeX-arg-conditional (y-or-n-p "With additional optional arguments? ")
+ ( [ 3 ] )
+ (ignore)))
+
+ ;; 4.3.3 Copy a theme
+ '("copymenucolortheme"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((copy (TeX-read-string
+ (TeX-argument-prompt optional nil "Copy")))
+ (orig (completing-read
+ (TeX-argument-prompt optional nil "Original")
+ (LaTeX-menukeys-newmenucolortheme-list))))
+ (LaTeX-add-menukeys-newmenucolorthemes copy)
+ (TeX-argument-insert copy optional)
+ (format "%s" orig)))))
+
+ ;; 4.3.4 Change a theme
+ '("changemenucolor"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Name")
+ (LaTeX-menukeys-newmenucolortheme-list))
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Element")
+ '("bg" "br" "txt"))
+ (TeX-arg-eval
+ (lambda ()
+ (let ((model (completing-read
+ (TeX-argument-prompt optional nil "Model")
+ (LaTeX-xcolor-color-models))))
+ (TeX-argument-insert model optional)
+ (if (string= model "named")
+ (let ((color (completing-read
+ (TeX-argument-prompt optional nil "Color")
+ (LaTeX-xcolor-definecolor-list))))
+ (format "%s" color))
+ (let ((color (TeX-read-string
+ (TeX-argument-prompt optional nil "Color spec"))))
+ (format "%s" color)))))))
+
+ ;; Same arguments as \newmenucolortheme
+ '("renewmenucolortheme"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((name (TeX-read-string
+ (TeX-argument-prompt optional nil "Name"))))
+ (LaTeX-add-menukeys-newmenucolorthemes name)
+ (format "%s" name))))
+ (TeX-arg-eval
+ (lambda ()
+ (let ((model (completing-read
+ (TeX-argument-prompt optional nil "Model")
+ (LaTeX-xcolor-color-models))))
+ (TeX-argument-insert model optional)
+ (if (string= model "named")
+ (let ((bg (completing-read
+ (TeX-argument-prompt optional nil "Node background color")
+ (LaTeX-xcolor-definecolor-list)))
+ (br (completing-read
+ (TeX-argument-prompt optional nil "Node border color")
+ (LaTeX-xcolor-definecolor-list)))
+ (txt (completing-read
+ (TeX-argument-prompt optional nil "Node text color")
+ (LaTeX-xcolor-definecolor-list))))
+ (TeX-argument-insert bg optional)
+ (TeX-argument-insert br optional)
+ (format "%s" txt))
+ (let ((bg (TeX-read-string
+ (TeX-argument-prompt optional nil "Node background color spec")))
+ (br (TeX-read-string
+ (TeX-argument-prompt optional nil "Node border color spec")))
+ (txt (TeX-read-string
+ (TeX-argument-prompt optional nil "Node text color spec"))))
+ (TeX-argument-insert bg optional)
+ (TeX-argument-insert br optional)
+ (format "%s" txt))))))
+ (TeX-arg-conditional (y-or-n-p "With additional optional arguments? ")
+ ( [ 3 ] )
+ (ignore)))
+
+ ;; 4.4 Menu macros
+ ;; 4.4.2 Defining or changing menu macros
+ ;; \newmenumacro{<macro>} [<input sep>]{<style>}
+ '("newmenumacro" TeX-arg-menukeys-newmenumacro)
+ '("providemenumacro" TeX-arg-menukeys-newmenumacro)
+ '("renewmenumacro" (TeX-arg-menukeys-newmenumacro t)))
+
+ ;; 4.5 Keys: These macros are defined when definekeys option is not
+ ;; false.
+ ;; 0 : No argment, one macro
+ ;; 1 : One argument, with completion
+ ;; 2 : No argment, three macros: \<key>, \<key>win, \<key>mac
+ (unless (LaTeX-provided-package-options-member "menukeys" "definekeys=false")
+ (let ((keycmds '(("shift" . 0) ("capslock" . 2) ("tab" . 2)
+ ("esc" . 2) ("ctrl" . 2) ("alt" . 2)
+ ("AltGr" . 0) ("cmd" . 0) ("Space" . 0)
+ ("SPACE" . 0) ("return" . 2) ("enter" . 2)
+ ("winmenu" . 0) ("backspace" . 0) ("del" . 0)
+ ("arrowkeyup" . 0) ("arrowkeydown" . 0)
+ ("arrowkeyleft" . 0) ("arrowkeyright" . 0)
+ ("arrowkey" . 1)
+ ;; Text inside some keys:
+ ("ctrlname" . 0) ("delname" . 0) ("spacename" . 0)))
+ (os '("mac" "win"))
+ collector)
+ (dolist (cmd keycmds)
+ (cond
+ ((= (cdr cmd) 0)
+ (push (car cmd) collector))
+ ((= (cdr cmd) 1)
+ (push (list (car cmd) '(TeX-arg-eval completing-read
+ "Direction: "
+ '("^" "v" ">" "<")))
+ collector))
+ ((= (cdr cmd) 2)
+ (push (car cmd) collector)
+ (dolist (x os)
+ (push (concat (car cmd) x) collector)))))
+ (apply #'TeX-add-symbols collector)))
+
+ ;; Fontification:
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("menu" "[{")
+ ("directory" "[{")
+ ("keys" "[{")
+ ("drawtikzfolder" "[["))
+ 'textual)
+ (font-latex-add-keywords '(("newmenustylesimple" "*{[{[[{")
+ ("newmenustyle" "*{[{[{{{[{")
+ ("copymenustyle" "{{")
+ ("changemenuelement" "*{{{")
+ ("renewmenustylesimple" "{[{[[{")
+ ("providemenustylesimple" "{[{[[{")
+ ("providemenustyle" "{[{[{{{[{")
+ ("renewmenustyle" "{[{[{{{[{")
+ ("newmenucolortheme" "{{{{{[[[")
+ ("copymenucolortheme" "{{")
+ ("changemenucolor" "{{{{")
+ ("renewmenucolortheme" "{{{{{[[[")
+ ("newmenumacro" "|{\\[{")
+ ("providemenumacro" "|{\\[{")
+ ("renewmenumacro" "|{\\[{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-menukeys-package-options-list
+ '(("definemenumacros" ("true" "false"))
+ ("definekeys" ("true" "false"))
+ ("mackeys" ("text" "symbols"))
+ ("os" ("mac" "win")))
+ "Package options for menukeys package.")
+
+(defun LaTeX-menukeys-package-options ()
+ "Prompt for package options for the menukeys package."
+ (TeX-read-key-val t LaTeX-menukeys-package-options-list))
+
+;;; menukeys.el ends here
--- /dev/null
+;;; minted.el --- AUCTeX style for `minted.sty' (v2.5)
+
+;; Copyright (C) 2014-2017 Free Software Foundation, Inc.
+
+;; Author: Tassilo Horn <tsdh@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-12-19
+;; 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 `minted.sty' (v2.5) from 2017/07/19.
+
+;;; Code:
+
+(require 'tex)
+
+(defvar LaTeX-minted-key-val-options
+ '(("autogobble" ("true" "false"))
+ ("baselinestretch" ("auto"))
+ ("beameroverlays" ("true" "false"))
+ ("breakafter")
+ ("breakaftergroup" ("true" "false"))
+ ("breakaftersymbolpre")
+ ("breakaftersymbolpost")
+ ("breakanywhere" ("true" "false"))
+ ("breakanywheresymbolpre")
+ ("breakanywheresymbolpost")
+ ("breakautoindent" ("true" "false"))
+ ("breakbefore")
+ ("breakbeforegroup" ("true" "false"))
+ ("breakbeforesymbolpre")
+ ("breakbeforesymbolpost")
+ ("breakbytoken" ("true" "false"))
+ ("breakbytokenanywhere" ("true" "false"))
+ ("breakindent")
+ ("breakindentnchars")
+ ("breaklines" ("true" "false"))
+ ("breaksymbol")
+ ("breaksymbolleft")
+ ("breaksymbolright")
+ ("breaksymbolindent")
+ ("breaksymbolindentnchars")
+ ("breaksymbolindentleft")
+ ("breaksymbolindentleftnchars")
+ ("breaksymbolindentright")
+ ("breaksymbolseprightnchars")
+ ("breaksymbolsep")
+ ("breaksymbolsepnchars")
+ ("breaksymbolsepleft")
+ ("breaksymbolsepleftnchars")
+ ("breaksymbolsepright")
+ ("breaksymbolseprightnchars")
+ ("bgcolor")
+ ("codetagify")
+ ("curlyquotes" ("true" "false"))
+ ("encoding")
+ ("escapeinside")
+ ("firstline")
+ ("firstnumber" ("auto" "last" "integer"))
+ ("fontfamily" ("tt" "courier" "helvetica"))
+ ("fontseries" ("auto"))
+ ("fontsize" ("auto" "\\tiny" "\\large" "\\scriptsize" "\\Large"
+ "\\footnotesize" "\\LARGE" "\\small" "\\huge"
+ "\\normalsize" "\\Huge"))
+ ("fontshape" ("auto"))
+ ("formatcom")
+ ("frame" ("none" "leftline" "topline" "bottomline" "lines" "single"))
+ ("framerule")
+ ("framesep")
+ ("funcnamehighlighting" ("true" "false"))
+ ("gobble")
+ ("highlightcolor")
+ ("highlightlines")
+ ("keywordcase" ("lower" "upper" "capitalize"))
+ ("label")
+ ("labelposition" ("none" "topline" "bottomline" "all"))
+ ("lastline")
+ ("linenos" ("true" "false"))
+ ("numberfirstline" ("true" "false"))
+ ("numbers" ("left" "right" "both" "none"))
+ ("mathescape" ("true" "false"))
+ ("numberblanklines" ("true" "false"))
+ ("numbersep")
+ ("obeytabs" ("true" "false"))
+ ("outencoding")
+ ("python3" ("true" "false"))
+ ("resetmargins" ("true" "false"))
+ ("rulecolor")
+ ("samepage" ("true" "false"))
+ ("showspaces" ("true" "false"))
+ ("showtabs" ("true" "false"))
+ ("space")
+ ("spacecolor")
+ ("startinline" ("true" "false"))
+ ;; FIXME: It would be nice to use the function
+ ;; `LaTeX-minted-style-list' here, but with a file local var like:
+ ;; %%% TeX-command-extra-options: "-shell-escape"
+ ;; in a .tex file, Emacs asks to apply a variable which is not
+ ;; safe and does not restore the frame; the splitted frame
+ ;; remains. I couldn't figure out why, so for now, I add the
+ ;; styles from Pygments version 2.1.3 here.
+ ("style" ("colorful" "default" "emacs" "friendly" "fruity" "igor"
+ "lovelace" "manni" "monokai" "murphy" "native"
+ "paraiso-dark" "paraiso-light" "pastie" "perldoc"
+ "rrt" "tango" "trac" "vim" "vs" "xcode"))
+ ("stepnumber")
+ ("stepnumberfromfirst")
+ ("stepnumberoffsetvalues" ("true" "false"))
+ ("stripall" ("true" "false"))
+ ("stripnl" ("true" "false"))
+ ("tab")
+ ("tabcolor")
+ ("tabsize")
+ ("texcl" ("true" "false"))
+ ("texcomments" ("true" "false"))
+ ("xleftmargin")
+ ("xrightmargin"))
+ "Key=value options for minted macros and environments.")
+
+(defvar LaTeX-minted-key-val-options-local nil
+ "Buffer-local key=value options for minted macros and environments.")
+(make-variable-buffer-local 'LaTeX-minted-key-val-options-local)
+
+(defvar LaTeX-minted-pygmentize-program (executable-find "pygmentize"))
+
+(defvar LaTeX-minted-language-list nil
+ "List containing languages provided by pymentize program.")
+
+(defun LaTeX-minted-language-list (&rest _ignored)
+ "Return a list of languages provided by pymentize program.
+Update the variable `LaTeX-minted-language-list' if still nil."
+ (or LaTeX-minted-language-list
+ (when LaTeX-minted-pygmentize-program
+ (with-temp-buffer
+ (shell-command (concat LaTeX-minted-pygmentize-program " -L lexers")
+ (current-buffer))
+ (goto-char (point-min))
+ (let (languages)
+ (while (re-search-forward "^\\*[[:space:]]\\([^:]+\\):" nil t)
+ (dolist (lang (split-string (match-string 1) "[[:space:],]" t))
+ (push lang languages)))
+ (setq LaTeX-minted-language-list languages))
+ LaTeX-minted-language-list))))
+
+(defun LaTeX-arg-minted-language (optional &optional prompt)
+ "Insert a selected pygmentize language as argument for macros from minted.sty.
+If OPTIONAL is non-nil, insert it as optional argument in
+brackets. PROMPT replaces the standard one."
+ (TeX-argument-insert
+ (completing-read (TeX-argument-prompt optional prompt "Language")
+ (LaTeX-minted-language-list))
+ optional))
+
+(defvar LaTeX-minted-style-list nil
+ "List containing styles provided by pymentize program.")
+
+(defun LaTeX-minted-style-list (&rest _ignored)
+ "Return a list of styles provided by pymentize program.
+Update the variable `LaTeX-minted-style-list' if still nil."
+ (or LaTeX-minted-style-list
+ (when LaTeX-minted-pygmentize-program
+ (with-temp-buffer
+ (shell-command (concat LaTeX-minted-pygmentize-program " -L styles")
+ (current-buffer))
+ (goto-char (point-min))
+ (let (styles)
+ (while (re-search-forward "^\\*[[:space:]]\\([^:]+\\):" nil t)
+ (dolist (style (split-string (match-string 1) "[[:space:],]" t))
+ (push style styles)))
+ (setq LaTeX-minted-style-list styles))
+ LaTeX-minted-style-list))))
+
+(defun LaTeX-arg-minted-style (optional &optional prompt)
+ "Insert a selected pygmentize style as argument for macros from minted.sty.
+If OPTIONAL is non-nil, insert it as optional argument in
+brackets. PROMPT replaces the standard one."
+ (TeX-argument-insert
+ (completing-read (TeX-argument-prompt optional prompt "Style")
+ (LaTeX-minted-style-list))
+ optional))
+
+(defun LaTeX-minted-update-key-vals ()
+ "Update color related key-vals in `LaTeX-minted-key-val-options-local'.
+This function checks if one of the packages \"xcolor.sty\" or
+\"xcolor.sty\" is loaded and appends defined colors as values to
+color related key. \"xcolor.sty\" is preferred if both packages
+are loaded."
+ (when (or (member "xcolor" (TeX-style-list))
+ (member "color" (TeX-style-list)))
+ (let* ((colorcmd (if (member "xcolor" (TeX-style-list))
+ #'LaTeX-xcolor-definecolor-list
+ #'LaTeX-color-definecolor-list))
+ (colorkeys '("bgcolor" "highlightcolor"
+ "rulecolor" "spacecolor" "tabcolor"))
+ (opts (copy-alist LaTeX-minted-key-val-options-local)))
+ (dolist (key colorkeys)
+ (setq opts (assq-delete-all (car (assoc key opts)) opts))
+ (push (list key (mapcar #'car (funcall colorcmd)))
+ opts))
+ (setq LaTeX-minted-key-val-options-local
+ (copy-alist opts)))))
+
+(defvar LaTeX-minted-auto-newminted nil)
+(defvar LaTeX-minted-newminted-regexp
+ '("\\\\newminted\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
+ (1 2) LaTeX-minted-auto-newminted))
+
+(defvar LaTeX-minted-auto-newmint nil)
+(defvar LaTeX-minted-newmint-regexp
+ '("\\\\newmint\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
+ (1 2) LaTeX-minted-auto-newmint))
+
+(defvar LaTeX-minted-auto-newmintinline nil)
+(defvar LaTeX-minted-newmintinline-regexp
+ '("\\\\newmintinline\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
+ (1 2) LaTeX-minted-auto-newmintinline))
+
+(defvar LaTeX-minted-auto-newmintedfile nil)
+(defvar LaTeX-minted-newmintedfile-regexp
+ '("\\\\newmintedfile\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
+ (1 2) LaTeX-minted-auto-newmintedfile))
+
+(defun LaTeX-minted-auto-prepare ()
+ (setq LaTeX-minted-auto-newminted nil
+ LaTeX-minted-auto-newmint nil
+ LaTeX-minted-auto-newmintinline nil
+ LaTeX-minted-auto-newmintedfile nil
+ LaTeX-minted-language-list nil
+ LaTeX-minted-style-list nil))
+
+(defun LaTeX-minted-auto-cleanup ()
+ ;; \newminted{lang}{opts} => new langcode and langcode* envs.
+ ;; \newminted[envname]{lang}{opts} => new envname/envname* envs.
+ (dolist (name-lang LaTeX-minted-auto-newminted)
+ (let* ((env (if (> (length (car name-lang)) 0)
+ (car name-lang)
+ (concat (cadr name-lang) "code")))
+ (env* (concat env "*")))
+ (add-to-list 'LaTeX-auto-environment (list env))
+ (add-to-list 'LaTeX-auto-environment
+ (list env* 'LaTeX-env-args
+ '(TeX-arg-key-val LaTeX-minted-key-val-options-local)))
+ (add-to-list 'LaTeX-indent-environment-list `(,env current-indentation) t)
+ (add-to-list 'LaTeX-indent-environment-list `(,env* current-indentation) t)
+ (add-to-list 'LaTeX-verbatim-environments-local env)
+ (add-to-list 'LaTeX-verbatim-environments-local env*)))
+ ;; \newmint{foo}{opts} => \foo[key=vals]|code|
+ ;; \newmint[macname]{foo}{opts} => \macname[key=vals]|code|
+ (dolist (name-lang LaTeX-minted-auto-newmint)
+ (let ((lang (if (> (length (car name-lang)) 0)
+ (car name-lang)
+ (cadr name-lang))))
+ (add-to-list 'TeX-auto-symbol
+ `(,lang [ TeX-arg-key-val LaTeX-minted-key-val-options-local ]
+ TeX-arg-verb))
+ (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)
+ (when (and (fboundp 'font-latex-add-keywords)
+ (fboundp 'font-latex-update-font-lock)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords `((,lang "[")) 'textual))))
+ ;; \newmintinline{foo}{opts} => \fooinline[key=vals]|code| or
+ ;; \fooinline[key=vals]{code}
+ ;; \newmintinline[macname]{foo}{opts} => \macname[key=vals]|code| or
+ ;; \macname[key=vals]{code}
+ (dolist (name-lang LaTeX-minted-auto-newmintinline)
+ (let ((lang (if (> (length (car name-lang)) 0)
+ (car name-lang)
+ (concat (cadr name-lang) "inline"))))
+ (add-to-list 'TeX-auto-symbol
+ `(,lang [ TeX-arg-key-val LaTeX-minted-key-val-options-local ]
+ TeX-arg-verb))
+ (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)
+ (add-to-list 'LaTeX-verbatim-macros-with-braces-local lang)
+ (when (and (fboundp 'font-latex-add-keywords)
+ (fboundp 'font-latex-update-font-lock)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords `((,lang "[")) 'textual))))
+ ;; \newmintedfile{foo}{opts} => \foofile[key=vals]{file-name}
+ ;; \newmintedfile[macname]{foo}{opts} => \macname[key=vals]{file-name}
+ (dolist (name-lang LaTeX-minted-auto-newmintedfile)
+ (let ((lang (if (> (length (car name-lang)) 0)
+ (car name-lang)
+ (concat (cadr name-lang) "file"))))
+ (add-to-list 'TeX-auto-symbol
+ `(,lang [ TeX-arg-key-val LaTeX-minted-key-val-options-local ]
+ TeX-arg-file))))
+ (when (and (fboundp 'font-latex-update-font-lock)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ ;; Refresh font-locking so that the verbatim envs take effect.
+ (font-latex-update-font-lock t))
+ ;; Also update the key=vals
+ (LaTeX-minted-update-key-vals))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-minted-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-minted-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun LaTeX-minted-add-syntactic-keywords-extra (type macro)
+ "Add MACRO from minted.sty to `font-latex-syntactic-keywords-extra'.
+TYPE is one of the symbols `brace' or `delim' indicating how
+verbatim text is enclosed after the macro. MACRO is a string or
+a list of strings."
+ (let ((syntax (if (eq type 'brace)
+ '((1 "|") (2 "|"))
+ '((1 "\"") (2 ".") (3 "\""))))
+ regexp)
+ (when (listp macro)
+ (setq macro (regexp-opt macro "\\(?:")))
+ (setq regexp `(,(concat
+ ;; The backslash
+ (regexp-quote TeX-esc)
+ ;; Name of the macro(s)
+ macro
+ ;; The optional argument
+ "\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
+ ;; The first mandatory argument
+ "\\(?:{[^}]+}\\)"
+ ;; With 'brace, allow braced sub-groups otherwise
+ ;; we stop matching too early. With 'delim, copy
+ ;; font-latex.el:
+ (if (eq type 'brace)
+ (concat "\\({\\)"
+ "\\(?:[^}{]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*}[^}{]*\\)*"
+ "}[^}{]*\\)*"
+ "}[^}{]*\\)*"
+ "\\)"
+ "\\(}\\)")
+ (concat
+ ;; Opening delimiter
+ "\\([^a-z@*\n\f{]\\).*?"
+ ;; Closing delimiter
+ "\\(" (regexp-quote TeX-esc) "*\\)\\(\\1\\)")))))
+ (add-to-list 'font-latex-syntactic-keywords-extra (append regexp syntax))))
+
+(TeX-add-style-hook
+ "minted"
+ (lambda ()
+
+ ;; Activate local-version of key=vals
+ (setq LaTeX-minted-key-val-options-local
+ (copy-alist LaTeX-minted-key-val-options))
+
+ ;; New symbols
+ (TeX-add-symbols
+ '("mint"
+ [ TeX-arg-key-val LaTeX-minted-key-val-options-local ]
+ LaTeX-arg-minted-language TeX-arg-verb)
+ '("mintinline"
+ [ TeX-arg-key-val LaTeX-minted-key-val-options-local ]
+ LaTeX-arg-minted-language TeX-arg-verb)
+ '("newminted" ["Environment Name"] LaTeX-arg-minted-language
+ (TeX-arg-key-val LaTeX-minted-key-val-options-local))
+ '("newmint" ["Macro Name"] LaTeX-arg-minted-language
+ (TeX-arg-key-val LaTeX-minted-key-val-options-local))
+ '("newmintinline" ["Macro Name"] LaTeX-arg-minted-language
+ (TeX-arg-key-val LaTeX-minted-key-val-options-local))
+ '("newmintedfile" ["Macro Name"] LaTeX-arg-minted-language
+ (TeX-arg-key-val LaTeX-minted-key-val-options-local))
+ ;; 3.3 Formatting source code
+ '("inputminted"
+ [ TeX-arg-key-val LaTeX-minted-key-val-options-local ]
+ (LaTeX-arg-minted-language)
+ TeX-arg-file)
+ ;; 3.4 Using different styles
+ '("usemintedstyle"
+ [ LaTeX-arg-minted-language ] LaTeX-arg-minted-style)
+ ;; 5.2 Macro option usage
+ '("setminted"
+ [ LaTeX-arg-minted-language ]
+ (TeX-arg-key-val LaTeX-minted-key-val-options-local))
+ '("setmintedinline"
+ [ LaTeX-arg-minted-language ]
+ (TeX-arg-key-val LaTeX-minted-key-val-options-local)))
+
+ ;; New environments
+ (LaTeX-add-environments
+ '("minted" LaTeX-env-args [TeX-arg-key-val LaTeX-minted-key-val-options-local]
+ LaTeX-arg-minted-language))
+
+ ;; 4 Floating listings: If option "newfloat" is given, run the
+ ;; style hook and use the interface provided by the style,
+ ;; otherwise add "listing" manually
+ (if (or (LaTeX-provided-package-options-member "minted" "newfloat")
+ (LaTeX-provided-package-options-member "minted" "newfloat=true"))
+ (progn
+ (TeX-run-style-hooks "newfloat")
+ (LaTeX-add-newfloat-DeclareFloatingEnvironments
+ '("listing" "verbatim")))
+ (LaTeX-add-environments '("listing" ["Float Position"]))
+ (TeX-add-symbols '("listoflistings")
+ '("listingscaption")
+ '("listoflistingscaption"))
+ (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
+ '("listing" current-indentation) t)
+ (add-to-list 'LaTeX-label-alist '("listing" . LaTeX-listing-label) t)
+ (when (fboundp 'reftex-add-label-environments)
+ (reftex-add-label-environments
+ '(("listing" ?l "lst:" "~\\ref{%s}" caption nil nil)))))
+
+ ;; Add to the auto parser
+ (TeX-auto-add-regexp LaTeX-minted-newminted-regexp)
+ (TeX-auto-add-regexp LaTeX-minted-newmint-regexp)
+ (TeX-auto-add-regexp LaTeX-minted-newmintinline-regexp)
+ (TeX-auto-add-regexp LaTeX-minted-newmintedfile-regexp)
+
+ ;; Filling
+ (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
+ '("minted" current-indentation) t)
+ (add-to-list 'LaTeX-verbatim-environments-local "minted")
+
+ ;; Fontification
+ (when (and (fboundp 'font-latex-add-keywords)
+ (fboundp 'font-latex-update-font-lock)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("usemintedstyle" "[{")
+ ("setminted" "[{")
+ ("setmintedinline" "[{")
+ ("newminted" "[{{")
+ ("newmint" "[{{")
+ ("newmintinline" "[{{")
+ ("newmintedfile" "[{{"))
+ 'function)
+ (font-latex-add-keywords '(("inputminted" "[{{")
+ ("mint" "[{")
+ ("mintinline" "[{"))
+ 'textual)
+ ;; Add \mint & \mintinline to
+ ;; `font-latex-syntactic-keywords-extra' and cater for their
+ ;; special syntax: \mint[optional]{lang}{verbatim} or
+ ;; \mint[optional]{lang}|verbatim|
+ (LaTeX-minted-add-syntactic-keywords-extra 'brace
+ '("mint" "mintinline"))
+ (LaTeX-minted-add-syntactic-keywords-extra 'delim
+ '("mint" "mintinline"))
+ ;; Tell font-lock about the update.
+ (font-latex-update-font-lock t)))
+ LaTeX-dialect)
+
+(defvar LaTeX-minted-package-options '("chapter" "cache"
+ "cachedir" "finalizecache"
+ "frozencache" "draft"
+ "final" "kpsewhich"
+ "langlinenos" "newfloat"
+ "outputdir" "section")
+ "Package options for the minted package.")
+
+;;; minted.el ends here
--- /dev/null
+;;; mn2e.el --- AUCTeX style for `mn2e.cls' version 2.2.
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Maintainer: auctex-devel@gnu.org
+;; Author: Mosè Giordano <mose@gnu.org>
+;; 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 `mn2e.cls' version 2.2.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "mn2e"
+ (lambda ()
+ (if (LaTeX-provided-class-options-member "mn2e" "usegraphicx")
+ (TeX-run-style-hooks "graphicx"))
+ (if (LaTeX-provided-class-options-member "mn2e" "usenatbib")
+ (TeX-run-style-hooks "natbib"))
+ (if (LaTeX-provided-class-options-member "mn2e" "usedcolumn")
+ (TeX-run-style-hooks "dcolumn"))
+ (TeX-add-symbols
+ ;; 4.5.3 Bold Greek
+ "balpha"
+ "bbeta"
+ "bgamma"
+ "bdelta"
+ "bepsilon"
+ "bzeta"
+ "boldeta"
+ "btheta"
+ "biota"
+ "bkappa"
+ "blambda"
+ "bmu"
+ "bnu"
+ "bxi"
+ "bpi"
+ "brho"
+ "bsigma"
+ "btau"
+ "bupsilon"
+ "bphi"
+ "bchi"
+ "bpsi"
+ "bomega"
+ "bvarepsilon"
+ "bvartheta"
+ "bvarpi"
+ "bvarrho"
+ "bvarsigma"
+ "bvarphi"
+ ;; 4.5.5 Special symbols
+ "getsto"
+ "cor"
+ "lid"
+ "gid"
+ "sol"
+ "sog"
+ "lse"
+ "gse"
+ "grole"
+ "leogr"
+ "loa"
+ "goa"
+ "sun"
+ "earth"
+ "degr"
+ "diameter"
+ "sq"
+ "squareforqed"
+ "fd"
+ "fh"
+ "fm"
+ "fs"
+ "fdg"
+ "farcm"
+ "farcs"
+ "fp"
+ "arcmin"
+ "arcsec"
+ "micron"
+ ;; Authors' notes
+ '("title" ["Short title"] "Long title")
+ '("author" ["Short author(s)"] (LaTeX-arg-author "Long author(s)"))
+ "newauthor"
+ "nokeywords"
+ "plate"
+ "contcaption"
+ '("bmath" "Math text")
+ '("mathbfss" "Text")
+ '("textbfss" "Text")
+ '("mathbfit" "Text")
+ '("textbfit" "Text")
+ ;; Editors' notes
+ "pagerange"
+ "volume"
+ "pubyear"
+ "journal"
+ "bsp")
+ (if (LaTeX-provided-class-options-member "mn2e" "useAMS")
+ (TeX-add-symbols
+ ;; 4.5.4 Upright Greek characters
+ "upi"
+ "umu"
+ "upartial"
+ "leqslant"
+ "geqslant"
+ "la"
+ "ga"))
+ (LaTeX-add-environments
+ "keywords"
+ "abstract"
+ "proof")
+ (LaTeX-add-pagestyles
+ "headings"
+ "myheadings"
+ "titlepage"
+ "plate")
+ (LaTeX-add-counters
+ "part"
+ "section"
+ "subsection"
+ "subsubsection"
+ "paragraph"
+ "subparagraph"
+ "dummy"
+ "table"
+ "figure")
+ (LaTeX-add-lengths
+ "realparindent"
+ "bibhang")
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("author" "[{")
+ ("title" "[{")
+ ("newauthor")
+ ("nokeywords" "{")
+ ("plate" "{")
+ ("contcaption" "{")
+ ("pagerange" "{")
+ ("volume" "{")
+ ("pubyear" "{")
+ ("journal")
+ ("bsp"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-mn2e-class-options
+ '("useAMS" "usegraphicx" "usenatbib" "usedcolumn"
+ "doublespacing" "galley" "landscape" "letters" "onecolumn" "referee")
+ "Package options for the mn2e package.")
+
+;; mn2e.el ends here
--- /dev/null
+;;; mnras.el --- AUCTeX style for `mnras.cls' version 3.0.
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Maintainer: auctex-devel@gnu.org
+;; Author: Mosè Giordano <mose@gnu.org>
+;; 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 `mnras.cls' version 3.0.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "mnras"
+ (lambda ()
+ (if (LaTeX-provided-class-options-member "mnras" "usegraphicx")
+ (TeX-run-style-hooks "graphicx"))
+ (if (LaTeX-provided-class-options-member "mnras" "usenatbib")
+ (TeX-run-style-hooks "natbib"))
+ (if (LaTeX-provided-class-options-member "mnras" "usedcolumn")
+ (TeX-run-style-hooks "dcolumn"))
+ (TeX-run-style-hooks
+ "geometry"
+ "fixltx2e"
+ "hyperref")
+ (TeX-add-symbols
+ ;; 5 Title page
+ '("title" ["Short title"] "Long title")
+ '("author" ["Short author(s)"] (LaTeX-arg-author "Long author(s)"))
+ "newauthor"
+ ;; 7.2 Special symbols
+ '("bmath" 1)
+ '("mathbfit" 1)
+ '("mathbfss" 1)
+ ;; 7.2 Special symbols -- Table 1
+ "sun"
+ "earth"
+ "degr"
+ "diameter"
+ "sq"
+ "fd"
+ "fh"
+ "fm"
+ "fs"
+ "fdg"
+ "farcm"
+ "farcs"
+ "fp"
+ "arcmin"
+ "arcsec"
+ "micron"
+ ;; 7.2 Special symbols -- Table 2
+ "upi"
+ "umu"
+ "upartial"
+ "leqslant"
+ "geqslant"
+ "la"
+ "ga"
+ "getsto"
+ "cor"
+ "lid"
+ "gid"
+ "sol"
+ "sog"
+ "lse"
+ "gse"
+ "grole"
+ "leogr"
+ "loa"
+ "goa"
+ ;; 7.3 Ions
+ '("ion" 2)
+ ;; A Journal abbreviations -- Table A1
+ "aap"
+ "astap"
+ "aapr"
+ "aaps"
+ "actaa"
+ "afz"
+ "aj"
+ "ao"
+ "applopt"
+ "aplett"
+ "apj"
+ "apjl"
+ "apjlett"
+ "apjs"
+ "apjsupp"
+ "apss"
+ "araa"
+ "arep"
+ "aspc"
+ "azh"
+ "baas"
+ "bac"
+ "bain"
+ "caa"
+ "cjaa"
+ "fcp"
+ "gca"
+ "grl"
+ "iaucirc"
+ "icarus"
+ "japa"
+ "jcap"
+ "jcp"
+ "jgr"
+ "jqsrt"
+ "jrasc"
+ "memras"
+ "memsai"
+ "mnassa"
+ "na"
+ "nar"
+ "nat"
+ "nphysa"
+ "pra"
+ "prb"
+ "prc"
+ "prd"
+ "pre"
+ "prl"
+ "pasa"
+ "pasp"
+ "pasj"
+ "physrep"
+ "physscr"
+ "planss"
+ "procspie"
+ "rmxaa"
+ "qjras"
+ "sci"
+ "skytel"
+ "solphys"
+ "sovast"
+ "ssr"
+ "zap")
+
+ (LaTeX-add-environments
+ "keywords"
+ "proof")
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("author" "[{")
+ ("title" "[{")
+ ("newauthor"))
+ 'function))))
+
+(defvar LaTeX-mnras-class-options
+ '("letters" "onecolumn" "doublespacing" "referee" "galley" "landscape"
+ "usenatbib" "usegraphicx" "useAMS" "usedcolumn")
+ "Package options for the mnras package.")
+
+;; mnras.el ends here
--- /dev/null
+;;; moodle.el --- AUCTeX style for `moodle.sty' (v0.5)
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-06-10
+;; 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 `moodle.sty' (v0.5) from 2016/01/11.
+
+;; In multi environments, the correct answer is marked with `\item*'.
+;; This style adds asterisk to the list of key=values queried after
+;; \item in this environment in order to make the input procedure
+;; easier.
+
+;;; Code:
+
+(defvar LaTeX-moodle-key-val-options
+ '(("points")
+ ("default grade")
+ ("penalty")
+ ("fraction")
+ ("feedback"))
+ "Key=value options for moodle macros and environments.")
+
+(defun LaTeX-moodle-question-env-with-args (env)
+ "Insert ENV provided by moodle.sty incl. arguments and first \\item."
+ (LaTeX-insert-environment
+ env
+ (let ((opts (TeX-read-key-val
+ t
+ (cond (;; 3.3.1 Multiple Choice
+ (string= env "multi")
+ (append '(("shuffle" ("true" "false"))
+ ("numbering" ("alph" "Alph" "arabic"
+ "roman" "Roman" "none"))
+ ("single" ("true" "false"))
+ ("multiple" ("true" "false")))
+ (when (string= "cloze" (LaTeX-current-environment))
+ '(("vertical" ("true" "false"))
+ ("horizonal" ("true" "false"))))
+ LaTeX-moodle-key-val-options))
+ ;; 3.3.3 Short Answer
+ ((string= env "shortanswer")
+ (append '(("case sensitive" ("true" "false"))
+ ("usecase" ("true" "false")))
+ (when (string= "cloze" (LaTeX-current-environment))
+ '(("vertical" ("true" "false"))
+ ("horizonal" ("true" "false"))))
+ LaTeX-moodle-key-val-options))
+ ;; 3.3.4 Essay Questions
+ ((string= env "essay")
+ (append '(("response required" ("true" "false"))
+ ("response format" ("html" "file"
+ "html+file"
+ "text" "monospaced"))
+ ("response field lines")
+ ("attachments allowed" ("0" "1" "2" "3"
+ "unlimited"))
+ ("attachments required" ("0" "1" "2" "3"))
+ ("response template"))
+ (when (string= "cloze" (LaTeX-current-environment))
+ '(("vertical" ("true" "false"))
+ ("horizonal" ("true" "false"))))
+ LaTeX-moodle-key-val-options))
+ ;; 3.4 Matching Questions
+ ((string= env "matching")
+ (append '(("shuffle" ("true" "false"))
+ ("drag and drop" ("true" "false"))
+ ("dd" ("true" "false")))
+ LaTeX-moodle-key-val-options))
+ (t (append
+ (when (string= "cloze" (LaTeX-current-environment))
+ '(("vertical" ("true" "false"))
+ ("horizonal" ("true" "false"))))
+ LaTeX-moodle-key-val-options)))))
+ (qname (unless (string= "cloze" (LaTeX-current-environment))
+ (TeX-read-string (TeX-argument-prompt nil nil "Question name")))))
+ (concat
+ (when (and opts (not (string= opts "")))
+ (format "[%s]" opts))
+ (when (and qname (not (string= qname "")))
+ (format "{%s}" qname)))))
+ (if (TeX-active-mark)
+ (progn
+ (LaTeX-find-matching-begin)
+ (end-of-line 1))
+ (end-of-line 0))
+ (delete-char 1)
+ (when (looking-at (concat "^[ \t]+$\\|"
+ "^[ \t]*" TeX-comment-start-regexp "+[ \t]*$"))
+ (delete-region (point) (line-end-position)))
+ (delete-horizontal-space)
+ ;; Deactivate the mark here in order to prevent `TeX-parse-macro'
+ ;; from swapping point and mark and the \item ending up right after
+ ;; \begin{...}.
+ (TeX-deactivate-mark)
+ ;; Query and insert the question text.
+ (let ((qtext (TeX-read-string (TeX-argument-prompt nil nil "Question Text"))))
+ (when (and qtext (not (string= qtext "")))
+ (newline)
+ (indent-according-to-mode)
+ (insert qtext)
+ (LaTeX-fill-paragraph)))
+ (LaTeX-insert-item)
+ ;; The inserted \item may have outdented the first line to the
+ ;; right. Fill it, if appropriate.
+ (when (and (not (looking-at "$"))
+ (not (assoc env LaTeX-indent-environment-list))
+ (> (- (line-end-position) (line-beginning-position))
+ (current-fill-column)))
+ (LaTeX-fill-paragraph nil)))
+
+(defun LaTeX-moodle-item-argument ()
+ "Insert an \\item with optional argument in environments of moodle package."
+ ;; Do not query for an optional argument here, this happens below:
+ (let ((TeX-insert-macro-default-style 'mandatory-args-only))
+ (TeX-insert-macro "item"))
+ ;; Add * to `LaTeX-moodle-key-val-options' in multi environment and
+ ;; query for the key=values:
+ (let ((opts
+ (TeX-read-key-val t (if (string= "multi" (LaTeX-current-environment))
+ (append '(("*")) LaTeX-moodle-key-val-options)
+ LaTeX-moodle-key-val-options))))
+ ;; Insert key=values; if * is chosen, drop []:
+ (when (and opts (not (string= opts "")))
+ (delete-horizontal-space)
+ (if (string= opts "*")
+ (insert opts)
+ (insert LaTeX-optop opts LaTeX-optcl))))
+ (just-one-space)
+ ;; Bonus point: Insert the macro \answer in matching environment:
+ (when (string= "matching" (LaTeX-current-environment))
+ (save-excursion
+ (insert TeX-esc "answer")
+ (just-one-space))))
+
+(TeX-add-style-hook
+ "moodle"
+ (lambda ()
+
+ (LaTeX-add-environments
+ ;; 3.2 Quiz and Question Environments
+ '("quiz"
+ (lambda (environment)
+ (LaTeX-insert-environment
+ environment
+ (let ((opts (TeX-read-key-val t LaTeX-moodle-key-val-options))
+ (bank (TeX-read-string (TeX-argument-prompt nil nil "Question bank name"))))
+ (concat
+ (when (and opts (not (string= opts "")))
+ (format "[%s]" opts))
+ (format "{%s}" bank))))))
+ ;; 3.5 Cloze Questions
+ '("cloze" "Question bank name"))
+
+ ;; Make other environments available to AUCTeX:
+ (dolist (env '("multi" "numerical" "shortanswer" "essay" "matching"))
+ (LaTeX-add-environments `(,env LaTeX-moodle-question-env-with-args))
+ (add-to-list 'LaTeX-item-list `(,env . LaTeX-moodle-item-argument) t))
+
+ (TeX-add-symbols
+ '("moodleset"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((opts (TeX-read-key-val optional
+ (append '(("ppi")) LaTeX-moodle-key-val-options))))
+ (format "%s" opts)))))
+
+ ;; 5 Graphics
+ '("ghostscriptcommand" "File name")
+ '("imagemagickcommand" "File name")
+ '("opensslcommand" "File name"))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("moodleset" "{")
+ ("ghostscriptcommand" "{")
+ ("imagemagickcommand" "{")
+ ("opensslcommand" "{"))
+ 'function)
+ (font-latex-add-keywords '(("answer" "")
+ ;; Cater for a fontified starred \item
+ ("item" "*["))
+ 'textual)))
+ LaTeX-dialect)
+
+(defvar LaTeX-moodle-package-options
+ '("draft")
+ "Package options for the moodle package.")
+
+;;; moodle.el ends here
--- /dev/null
+;;; newfloat.el --- AUCTeX style for `newfloat.sty' (v1.1-109)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-09-19
+;; 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 `newfloat.sty' (v1.1-109) from 2015/09/17.
+;; `newfloat.sty' is part of TeXLive.
+
+;; This style has some facilities to process the newly defined
+;; floating environments within AUCTeX, e.g. indentation, label
+;; addition etc. Currently it makes provision for `figure', `table'
+;; and `verbatim' floating types. To make things work, the style
+;; needs some help from the user. When a new floating environment is
+;; defined, the user should pass the floating type as a comment to
+;; AUCTeX, e.g.
+;;
+;; \DeclareFloatingEnvironment[
+;; name=Code,
+;; listname={List of Codes},
+;; fileext=lol]{code} % {verbatim}
+;;
+;; Note the `{verbatim}' as a comment after the name of the float env.
+;; Due to parsing reasons, this key-word must be in the same line as
+;; the name of the float and enclosed in braces `{}'.
+;;
+;; Before the opening brace, only spaces and comment chars `%' are
+;; allowed. Anything following the closing brace `}' is ignored.
+
+;; If things do not work or when in doubt, press `C-c C-n'. Comments
+;; for improvement are welcome.
+
+;;; Code:
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+(defvar LaTeX-newfloat-key-val-options
+ '(("fileext")
+ ("listname")
+ ("name")
+ ("placement" ("t" "b" "p" "tbp" "htbp"))
+ ("chapterlistsgaps" ("on" "off")))
+ "Key=value options for newfloat macros.")
+
+(defvar LaTeX-newfloat-key-val-options-local nil
+ "Buffer-local Key=value options for newfloat macros.")
+(make-variable-buffer-local 'LaTeX-newfloat-key-val-options-local)
+
+;; Setup parsing for \DeclareFloatingEnvironment:
+(TeX-auto-add-type "newfloat-DeclareFloatingEnvironment" "LaTeX")
+
+(defvar LaTeX-newfloat-DeclareFloatingEnvironment-regex
+ `(,(concat "\\\\DeclareFloatingEnvironment"
+ "[ \t\n\r%]*"
+ "\\["
+ "[ \t\n\r%{}a-zA-Z0-9=,-]*"
+ "\\]"
+ "[ \t\n\r%]*"
+ "{\\([^}]+\\)}"
+ "\\(?:[ %]*{\\([^}]*\\)}\\)?")
+ (1 2) LaTeX-auto-newfloat-DeclareFloatingEnvironment)
+ "Matches the argument of `\\DeclareFloatingEnvironment' from
+`newfloat.sty'.")
+
+(defun LaTeX-newfloat-auto-prepare ()
+ "Clear `LaTeX-auto-newfloat-DeclareFloatingEnvironment' before parsing."
+ (setq LaTeX-auto-newfloat-DeclareFloatingEnvironment nil))
+
+(defun LaTeX-newfloat-auto-cleanup ()
+ "Process definded floats with \\DeclareFloatingEnvironment.
+Depending on floating type passed as a comment to
+AUCTeX (\"figure\", \"table\" or \"verbatim\"), update
+`LaTeX-figure-label' and `LaTeX-table-label'. If RefTeX is
+loaded, add the new floating environment via
+`reftex-add-label-environments'. For \"verbatim\" environments,
+update `LaTeX-indent-environment-list' to suppress indentation.
+If `caption.el' is loaded, add the new floating environment to
+`LaTeX-caption-supported-float-types'. Also define the macros
+\"listofENVs\" and \"listofENVes\"."
+ (dolist (flt-type (LaTeX-newfloat-DeclareFloatingEnvironment-list))
+ (let ((flt (car flt-type))
+ (type (cadr flt-type)))
+ (cond ((string-equal type "figure")
+ (LaTeX-add-environments `(,flt LaTeX-env-figure))
+ (add-to-list 'LaTeX-label-alist `(,flt . LaTeX-figure-label) t)
+ (when (fboundp 'reftex-add-label-environments)
+ (reftex-add-label-environments
+ `((,flt ?f ,LaTeX-figure-label "~\\ref{%s}" caption nil nil)))))
+ ((string-equal type "table")
+ (LaTeX-add-environments `(,flt LaTeX-env-figure))
+ (add-to-list 'LaTeX-label-alist `(,flt . LaTeX-table-label) t)
+ (when (fboundp 'reftex-add-label-environments)
+ (reftex-add-label-environments
+ `((,flt ?t ,LaTeX-table-label "~\\ref{%s}" caption nil nil)))))
+ ((string-equal type "verbatim")
+ (LaTeX-add-environments `(,flt ["Float Position"]))
+ (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
+ `(,flt current-indentation) t)
+ (add-to-list 'LaTeX-label-alist `(,flt . LaTeX-listing-label) t)
+ (when (fboundp 'reftex-add-label-environments)
+ (reftex-add-label-environments
+ `((,flt ?l "lst:" "~\\ref{%s}" caption nil nil)))))
+ (t
+ (LaTeX-add-environments `(,flt ["Float Position"]))))
+ (when (boundp 'LaTeX-caption-supported-float-types)
+ (add-to-list (make-local-variable 'LaTeX-caption-supported-float-types)
+ flt))
+ (if (string-equal "e" (substring flt -1))
+ (TeX-add-symbols (concat "listof" flt "s"))
+ (TeX-add-symbols
+ (concat "listof" flt "s")
+ (concat "listof" flt "es"))))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-newfloat-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-newfloat-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "newfloat"
+ (lambda ()
+
+ ;; Add newfloat to the parser.
+ (TeX-auto-add-regexp LaTeX-newfloat-DeclareFloatingEnvironment-regex)
+
+ ;; Depending on class, add "within" key to the local options list
+ ;; and use it.
+ (setq LaTeX-newfloat-key-val-options-local
+ (copy-alist LaTeX-newfloat-key-val-options))
+
+ (if (< (LaTeX-largest-level) 2)
+ (add-to-list 'LaTeX-newfloat-key-val-options-local
+ '("within" ("chapter" "section" "none")))
+ (add-to-list 'LaTeX-newfloat-key-val-options-local
+ '("within" ("section" "none"))))
+
+ ;; Commands:
+ (TeX-add-symbols
+ '("DeclareFloatingEnvironment"
+ [TeX-arg-key-val LaTeX-newfloat-key-val-options-local]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((newfloat (TeX-read-string
+ (TeX-argument-prompt nil nil "Floating environment"))))
+ (LaTeX-add-newfloat-DeclareFloatingEnvironments newfloat)
+ (format "%s" newfloat)))))
+
+ '("SetupFloatingEnvironment"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt nil nil "Floating environment")
+ (mapcar 'car (LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+ (TeX-arg-key-val LaTeX-newfloat-key-val-options-local))
+
+ '("ForEachFloatingEnvironment" t)
+ '("ForEachFloatingEnvironment*" t)
+
+ '("PrepareListOf"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt nil nil "Floating environment")
+ (mapcar 'car (LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+ t)
+
+ '("newfloatsetup"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((keyvals (TeX-read-key-val
+ nil
+ (append '(("chapterlistsgap"))
+ (if (< (LaTeX-largest-level) 2)
+ '(("within" ("chapter" "section" "none")))
+ '(("within" ("section" "none"))))))))
+ (format "%s" keyvals))))))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("DeclareFloatingEnvironment" "[{")
+ ("SetupFloatingEnvironment" "{{")
+ ("ForEachFloatingEnvironment" "*{")
+ ("PrepareListOf" "{{")
+ ("newfloatsetup" "{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defun LaTeX-newfloat-package-options ()
+ "Prompt for package options for the newfloat package."
+ (TeX-read-key-val
+ t
+ (append
+ '(("chapterlistsgap"))
+ (if (< (LaTeX-largest-level) 2)
+ '(("within" ("chapter" "section" "none")))
+ '(("within" ("section" "none")))))))
+
+;;; newfloat.el ends here
--- /dev/null
+;;; newpxmath.el --- AUCTeX style for `newpxmath.sty' (v1.232)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-05-02
+;; 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 `newpxmath.sty' (v1.232) from 2015/04/07.
+;; `newpxmath.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "newpxmath"
+ (lambda ()
+
+ ;; Run style hook for amsmath
+ (TeX-run-style-hooks "amsmath")
+
+ ;; New symbols
+ (TeX-add-symbols
+ '("overgroup" t)
+ '("undergroup" t)
+ '("overgroupra" t)
+ '("overgroupla" t)
+ '("undergroupra" t)
+ '("undergroupla" t)
+ '("widering" t)
+ '("widearc" t)
+ '("wideOarc" t)
+ '("uppartial" 0)
+ '("upvarkappa" 0)
+ '("varmathbb" "Character")
+ '("vmathbb" "Character")
+ '("vvmathbb" "Character")))
+ LaTeX-dialect)
+
+(defvar LaTeX-newpxmath-package-options
+ '("varg"
+ "cmintegrals"
+ "uprightGreek"
+ "slantedGreek"
+ "cmbraces"
+ "bigdelims"
+ "varbb"
+ "vvarbb"
+ "nosymbolsc"
+ "amssymbols"
+ "noamssymbols"
+ "frenchmath")
+ "Package options for the newpxmath package.")
+
+;;; newpxmath.el ends here
--- /dev/null
+;;; newpxtext.el --- AUCTeX style for `newpxtext.sty' (v1.232)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-05-02
+;; 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 `newpxtext.sty' (v1.232) from 2015/04/15.
+;; `newpxtext.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "newpxtext"
+ (lambda ()
+
+ ;; Run style hook for various packages loaded by newpxtext
+ (TeX-run-style-hooks "textcomp" "fontaxes")
+
+ ;; New symbols
+ (TeX-add-symbols
+ '("useosf" 0) ; Only preamble command
+ '("useproportional" 0) ; Only preamble command
+ '("lfstyle" -1) ; lf declaration
+ '("tlfstyle" -1) ; tlf declaration
+ '("osfstyle" -1) ; osf declaration
+ '("tosfstyle" -1) ; tosf declaration
+ '("sustyle" -1) ; sup style declaration
+ '("textlf" t) ; lf command
+ '("texttlf" t) ; tlf command
+ '("textosf" t) ; osf command
+ '("texttosf" t) ; tosf command
+ '("textsu" t)) ; sup style command
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("textlf" "{")
+ ("texttlf" "{")
+ ("textosf" "{")
+ ("texttosf" "{")
+ ("textsu" "{"))
+ 'type-command)
+ (font-latex-add-keywords '(("lfstyle" "")
+ ("tlfstyle" "")
+ ("osfstyle" "")
+ ("tosfstyle" "")
+ ("sustyle" ""))
+ 'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-newpxtext-package-options
+ '("defaultsups" "scosf" "largesc"
+ "scaled" "helvratio"
+ "tighter" "looser" "spacing" "stretch" "shrink"
+ "lining" "lf" "oldstyle" "osf" "tabular"
+ "p" "proportional" "theoremfont")
+ "Package options for the newpxtext package.")
+
+;;; newpxtext.el ends here
--- /dev/null
+;;; newtxmath.el --- AUCTeX style for `newtxmath.sty' (v1.321)
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-11-22
+;; 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 `newtxmath.sty' (v1.321) from 2014/11/16.
+;; `newtxmath.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "newtxmath"
+ (lambda ()
+
+ ;; Run style hook for amsmath
+ (TeX-run-style-hooks "amsmath")
+
+ ;; New symbols
+ (TeX-add-symbols
+ '("overgroup" t)
+ '("undergroup" t)
+ '("overgroupra" t)
+ '("overgroupla" t)
+ '("undergroupra" t)
+ '("undergroupla" t)
+ '("widering" t)
+ '("widearc" t)
+ '("wideOarc" t)
+ '("varnothing" 0)
+ '("emtysetAlt" 0)
+ '("forallAlt" 0)
+ '("existsAlt" 0)
+ '("nexistsAlt" 0)
+ '("vvmathbb" "Character")))
+ LaTeX-dialect)
+
+(defvar LaTeX-newtxmath-package-options
+ '("varg"
+ "cmintegrals"
+ "uprightGreek"
+ "slantedGreek"
+ "cmbraces"
+ "bigdelims"
+ "varbb"
+ "vvarbb"
+ "nosymbolsc"
+ "amssymbols"
+ "noamssymbols"
+ "libaltvw"
+ "liby"
+ "timesmathacc"
+ "libertine"
+ "minion"
+ "garamondx"
+ "baskervaldx"
+ "utopia" "heuristica"
+ "erewhon"
+ "xcharter")
+ "Package options for the newtxmath package.")
+
+;;; newtxmath.el ends here
--- /dev/null
+;;; newtxsf.el --- AUCTeX style for `newtxsf.sty' (v1.0)
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-11-22
+;; 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 `newtxsf.sty' (v1.0) from 2014/11/14.
+;; `newtxsf.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "newtxsf"
+ (lambda ()
+ ;; Run style hook for amsmath
+ (TeX-run-style-hooks "amsmath")
+
+ ;; New symbols
+ (TeX-add-symbols
+ '("upimath" 0)
+ '("upjmath" 0)))
+ LaTeX-dialect)
+
+(defvar LaTeX-newtxsf-package-options
+ '("scaled"
+ "nosymbolsc"
+ "cmintegrals"
+ "amssymbols"
+ "noamssymbols"
+ "uprightGreek"
+ "slantedGreek"
+ "frenchmath")
+ "Package options for the newtxsf package.")
+
+;;; newtxsf.el ends here
--- /dev/null
+;;; newtxtext.el --- AUCTeX style for `newtxtext.sty' (v1.434)
+
+;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-11-19
+;; 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 `newtxtext.sty' (v1.434) from 2015/04/07.
+;; `newtxtext.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "newtxtext"
+ (lambda ()
+
+ ;; Run style hook for various packages loaded by newtxtext
+ (TeX-run-style-hooks "textcomp" "fontaxes")
+
+ ;; New symbols
+ (TeX-add-symbols
+ '("useosf" 0) ; Only preamble command
+ '("useproportional" 0) ; Only preamble command
+ '("lfstyle" -1) ; lf declaration
+ '("tlfstyle" -1) ; tlf declaration
+ '("osfstyle" -1) ; osf declaration
+ '("tosfstyle" -1) ; tosf declaration
+ '("sustyle" -1) ; sup style declaration
+ '("textlf" t) ; lf command
+ '("texttlf" t) ; tlf command
+ '("textosf" t) ; osf command
+ '("texttosf" t) ; tosf command
+ '("textsu" t)) ; sup style command
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("textlf" "{")
+ ("texttlf" "{")
+ ("textosf" "{")
+ ("texttosf" "{")
+ ("textsu" "{"))
+ 'type-command)
+ (font-latex-add-keywords '(("lfstyle" "")
+ ("tlfstyle" "")
+ ("osfstyle" "")
+ ("tosfstyle" "")
+ ("sustyle" ""))
+ 'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-newtxtext-package-options
+ '("defaultsups" "helvratio" "osf" "scaled" "scosf"
+ ;; New options since 1.4
+ "largesc" "adobesc" "theoremfont"
+ "lining" "lf" "oldstyle" "tabular" "p" "proportional")
+ "Package options for the newtxtext package.")
+
+;;; newtxtext.el ends here
--- /dev/null
+;;; newtxtt.el --- AUCTeX style for `newtxtt.sty' (v1.05)
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-11-22
+;; 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 `newtxtt.sty' (v1.05) from 2014/11/18.
+;; `newtxtt.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "newtxtt"
+ (lambda ()
+
+ ;; Run style hook for newtxtt
+ (TeX-run-style-hooks "textcomp")
+
+ ;; New symbols
+ (TeX-add-symbols
+ '("textttz" t)
+ '("ttz" -1)
+ '("ttzdefault" -1))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("textttz" "{"))
+ 'type-command)
+ (font-latex-add-keywords '(("ttzfamily" "")
+ ("ttz" ""))
+ 'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-newtxtt-package-options
+ '("scaled" "zerostyle" "nomono" "straightquotes"
+ "ttdefault" "ttzdefault")
+ "Package options for the newtxtt package.")
+
+;;; newtxtt.el ends here
--- /dev/null
+;;; newzealand.el --- AUCTeX style for the `newzealand' babel option.
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-07-02
+;; 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:
+
+;; Set up AUCTeX for editing Newzealand text in connection with the
+;; `newzealand' babel option.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "newzealand"
+ (lambda ()
+ (TeX-run-style-hooks "english"))
+ LaTeX-dialect)
+
+;;; newzealand.el ends here
--- /dev/null
+;;; ntheorem.el --- AUCTeX style for `ntheorem.sty' (v1.33)
+
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-10-31
+;; 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 `ntheorem.sty' (v1.33) from 2011/08/15.
+;; `ntheorem.sty' is and part of TeXLive.
+
+;; The style provides the function `LaTeX-ntheorem-env-label' which
+;; enables new defined environments with "\newtheoreom" to interact
+;; with AUCTeX and RefTeX mechanisms for inserting labels. Check
+;; docstring of `LaTeX-ntheorem-env-label' for instructions.
+
+;;; Code
+
+(defvar LaTeX-ntheorem-theoremstyle-list
+ '(("plain") ("break") ("change") ("changebreak") ("margin")
+ ("marginbreak") ("nonumberplain") ("nonumberbreak") ("empty"))
+ "List of theorem styles provided by `ntheorem.el' and new ones
+defined with \"\\newtheoremstyle\".")
+
+(defvar LaTeX-ntheorem-listtype-list
+ '(("all") ("allname") ("opt") ("optname"))
+ "List of predefined formatting options available for
+\"\\theoremlisttype\" provided by `ntheorem.el' and new ones
+defined with \"\\newtheoremlisttype\".")
+
+(defvar LaTeX-ntheorem-fontdecl
+ '(;; family
+ "rmfamily" "sffamily" "ttfamily"
+ ;; series
+ "mdseries" "bfseries"
+ ;; shape
+ "upshape" "itshape" "slshape" "scshape"
+ ;; size
+ "tiny" "scriptsize" "footnotesize"
+ "small" "normalsize" "large"
+ "Large" "LARGE" "huge" "Huge"
+ ;; reset macro
+ "normalfont")
+ "List of font declaration commands for \"\\newtheoremstyle\".")
+
+(defun LaTeX-arg-ntheorem-fontdecl (optional &optional prompt)
+ "Prompt for font declaration commands in \"\\theorem(body\|header)font\".
+If OPTIONAL is non-nil, insert the resulting value as an optional
+argument. Use PROMPT as the prompt string."
+ ;; `INITIAL-INPUT' (5th argument to `TeX-completing-read-multiple')
+ ;; is hard-coded to `TeX-esc'.
+ (let* ((crm-separator (regexp-quote TeX-esc))
+ (fontdecl (mapconcat 'identity
+ (TeX-completing-read-multiple
+ (TeX-argument-prompt optional prompt "Font declaration")
+ LaTeX-ntheorem-fontdecl nil nil TeX-esc)
+ TeX-esc)))
+ (TeX-argument-insert fontdecl optional)))
+
+(defun LaTeX-ntheorem-env-label (environment)
+ "Insert ENVIRONMENT, query for an optional argument and prompt
+for label. AUCTeX users should add ENVIRONMENT to
+`LaTeX-label-alist' via customize or in init-file with:
+
+ (add-to-list \\='LaTeX-label-alist \\='(\"lemma\" . \"lem:\"))
+
+RefTeX users should customize or add ENVIRONMENT to
+`LaTeX-label-alist' and `reftex-label-alist', e.g.
+
+ (add-to-list \\='LaTeX-label-alist \\='(\"lemma\" . \"lem:\"))
+ (add-to-list \\='reftex-label-alist
+ \\='(\"lemma\" ?m \"lem:\" \"~\\ref{%s}\"
+ nil (\"Lemma\" \"lemma\") nil))"
+ (let ((opthead (TeX-read-string
+ (TeX-argument-prompt t nil "Heading"))))
+ (LaTeX-insert-environment environment
+ (when (and opthead
+ (not (string= opthead "")))
+ (format "[%s]" opthead))))
+ (when (LaTeX-label environment 'environment)
+ (LaTeX-newline)
+ (indent-according-to-mode)))
+
+;; Needed for auto-parsing
+(require 'tex)
+
+;; Setup parsing for \newtheorem
+(TeX-auto-add-type "ntheorem-newtheorem" "LaTeX")
+
+;; Setup parsing for \newtheoremstyle
+(TeX-auto-add-type "ntheorem-newtheoremstyle" "LaTeX")
+
+;; Setup parsing for \newtheoremlisttype
+(TeX-auto-add-type "ntheorem-newtheoremlisttype" "LaTeX")
+
+(defun LaTeX-ntheorem-auto-prepare ()
+ "Clear `LaTeX-auto-ntheorem-newtheorem' and
+`LaTeX-auto-ntheorem-newtheoremstyle' before parsing."
+ (setq LaTeX-auto-ntheorem-newtheorem nil)
+ (setq LaTeX-auto-ntheorem-newtheoremstyle nil)
+ (setq LaTeX-auto-ntheorem-newtheoremlisttype nil))
+
+(defun LaTeX-ntheorem-auto-cleanup ()
+ "Move parsed results from `LaTeX-auto-ntheorem-newtheorem' and
+make them available as new environments. Update
+`LaTeX-ntheorem-theoremstyle-list' with styles defined with
+\"\\newtheoremstyle\"."
+ (dolist (newthm (mapcar 'car (LaTeX-ntheorem-newtheorem-list)))
+ (LaTeX-add-environments (list newthm 'LaTeX-ntheorem-env-label))
+ (LaTeX-add-environments (list (concat newthm "*")
+ 'LaTeX-ntheorem-env-label)))
+ (dolist (newthmstyle (LaTeX-ntheorem-newtheoremstyle-list))
+ (add-to-list (make-local-variable 'LaTeX-ntheorem-theoremstyle-list)
+ newthmstyle))
+ (dolist (newthmlist (LaTeX-ntheorem-newtheoremlisttype-list))
+ (add-to-list (make-local-variable 'LaTeX-ntheorem-listtype-list)
+ newthmlist))
+ (when (LaTeX-provided-package-options-member "ntheorem" "thmmarks")
+ (dolist (nthm (mapcar 'car (LaTeX-ntheorem-newtheorem-list)))
+ (TeX-add-symbols (concat nthm "Symbol"))))
+ (dolist (nthm (mapcar 'car (LaTeX-ntheorem-newtheorem-list)))
+ (TeX-add-symbols (concat nthm "name"))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-ntheorem-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-ntheorem-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "ntheorem"
+ (lambda ()
+
+ (TeX-auto-add-regexp
+ `(,(concat "\\\\newtheorem{\\(" TeX-token-char "+\\)}")
+ 1 LaTeX-auto-ntheorem-newtheorem))
+ (TeX-auto-add-regexp
+ `(,(concat "\\\\newframedtheorem{\\(" TeX-token-char "+\\)}")
+ 1 LaTeX-auto-ntheorem-newtheorem))
+ (TeX-auto-add-regexp
+ `(,(concat "\\\\newshadedtheorem{\\(" TeX-token-char "+\\)}")
+ 1 LaTeX-auto-ntheorem-newtheorem))
+ (TeX-auto-add-regexp
+ `(,(concat "\\\\newtheoremstyle{\\(" TeX-token-char "+\\)}")
+ 1 LaTeX-auto-ntheorem-newtheoremstyle))
+ (TeX-auto-add-regexp
+ `(,(concat "\\\\newtheoremlisttype{\\(" TeX-token-char "+\\)}")
+ 1 LaTeX-auto-ntheorem-newtheoremlisttype))
+
+ (TeX-add-symbols
+ ;; 2.2 Defining New Theorem Sets
+ ;; Overrule the defintion in `latex.el':
+ '("newtheorem"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((nthm (TeX-read-string
+ (TeX-argument-prompt nil nil "Environment"))))
+ (LaTeX-add-ntheorem-newtheorems nthm)
+ (LaTeX-add-environments (list nthm 'LaTeX-ntheorem-env-label))
+ (LaTeX-add-environments (list (concat nthm "*")
+ 'LaTeX-ntheorem-env-label))
+ (format "%s" nthm))))
+ [ TeX-arg-environment "Numbered like" ]
+ t [ (TeX-arg-eval progn (if (eq (save-excursion
+ (backward-char 2)
+ (preceding-char)) ?\])
+ ()
+ (TeX-arg-counter t "Within counter"))
+ "") ])
+
+ '("renewtheorem"
+ (TeX-arg-eval completing-read "Environment: "
+ (LaTeX-ntheorem-newtheorem-list))
+ [ TeX-arg-environment "Numbered like" ]
+ t [ (TeX-arg-eval progn (if (eq (save-excursion
+ (backward-char 2)
+ (preceding-char)) ?\])
+ ()
+ (TeX-arg-counter t "Within counter"))
+ "") ])
+
+ ;; 2.3 Defining the Layout of Theorem Sets
+ '("theoremstyle"
+ (TeX-arg-eval completing-read "Style: "
+ LaTeX-ntheorem-theoremstyle-list))
+
+ '("theorembodyfont"
+ (LaTeX-arg-ntheorem-fontdecl "Body font"))
+
+ '("theoremheaderfont"
+ (LaTeX-arg-ntheorem-fontdecl "Header font"))
+
+ '("theoremnumbering"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Numbering scheme")
+ '("arabic" "roman" "Roman" "alph" "Alph"
+ "greek" "Greek" "fnsymbol")))
+
+ '("theoremseparator" "Separator")
+
+ '("theorempreskip"
+ (TeX-arg-length "Skip before theorem"))
+
+ '("theorempostskip"
+ (TeX-arg-length "Skip after theorem"))
+
+ '("theoremindent"
+ (TeX-arg-free "Theorem indent"))
+
+ (when (LaTeX-provided-package-options-member "ntheorem" "thmmarks")
+ '("theoremsymbol" t))
+
+ '("theoremprework" t)
+ '("theorempostwork" t)
+
+ '("theoremclass"
+ (TeX-arg-eval completing-read "Theorem type: "
+ (append '(("LaTeX"))
+ (LaTeX-ntheorem-newtheorem-list))))
+
+ ;; 2.3.6 A Standard Set of Theorems
+ (when (LaTeX-provided-package-options-member "ntheorem" "standard")
+ (let ((env '("Theorem" "Lemma" "Proposition"
+ "Corollary" "Satz" "Korollar"
+ "Definition" "Example" "Beispiel"
+ "Anmerkung" "Bemerkung" "Remark"
+ "Proof" "Beweis")))
+ (dolist (elt env)
+ (LaTeX-add-ntheorem-newtheorems elt)
+ (LaTeX-add-environments (list elt 'LaTeX-ntheorem-env-label))
+ (LaTeX-add-environments (list (concat elt "*")
+ 'LaTeX-ntheorem-env-label)))))
+
+ ;; 2.3.7 Framed and Boxed Theorems
+ '("newframedtheorem"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((nthm (TeX-read-string
+ (TeX-argument-prompt nil nil "Environment"))))
+ (LaTeX-add-ntheorem-newtheorems nthm)
+ (LaTeX-add-environments (list nthm 'LaTeX-ntheorem-env-label))
+ (LaTeX-add-environments (list (concat nthm "*")
+ 'LaTeX-ntheorem-env-label))
+ (format "%s" nthm))))
+ [ TeX-arg-environment "Numbered like" ]
+ t [ (TeX-arg-eval progn (if (eq (save-excursion
+ (backward-char 2)
+ (preceding-char)) ?\])
+ ()
+ (TeX-arg-counter t "Within counter"))
+ "") ])
+
+ '("newshadedtheorem"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((nthm (TeX-read-string
+ (TeX-argument-prompt nil nil "Environment"))))
+ (LaTeX-add-ntheorem-newtheorems nthm)
+ (LaTeX-add-environments (list nthm 'LaTeX-ntheorem-env-label))
+ (LaTeX-add-environments (list (concat nthm "*")
+ 'LaTeX-ntheorem-env-label))
+ (format "%s" nthm))))
+ [ TeX-arg-environment "Numbered like" ]
+ t [ (TeX-arg-eval progn (if (eq (save-excursion
+ (backward-char 2)
+ (preceding-char)) ?\])
+ ()
+ (TeX-arg-counter t "Within counter"))
+ "") ])
+ '("shadecolor"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((color (cond ((member "xcolor" (TeX-style-list))
+ (completing-read "Color name: " (LaTeX-xcolor-definecolor-list)))
+ ((member "color" (TeX-style-list))
+ (completing-read "Color name: " (LaTeX-color-definecolor-list)))
+ (t
+ (TeX-read-string "Color name: ")))))
+ (format "%s" color)))))
+
+ '("theoremframepreskip"
+ (TeX-arg-length "Skip before framed theorem"))
+
+ '("theoremframepostskip"
+ (TeX-arg-length "Skip after framed theorem"))
+
+ '("theoreminframepreskip"
+ (TeX-arg-length "Skip inside framed theorem"))
+
+ '("theoreminframepostskip"
+ (TeX-arg-length "Skip inside framed theorem"))
+
+ ;; 2.4 Generating Theoremlists
+ '("listtheorems"
+ (TeX-arg-eval mapconcat 'identity
+ (TeX-completing-read-multiple
+ "Lists: "
+ (LaTeX-ntheorem-newtheorem-list)) ","))
+
+ ;; 2.4.2 Writing Extra Stuff to the Theorem File
+ '("addtheoremline"
+ (TeX-arg-eval completing-read "Environment: "
+ (LaTeX-ntheorem-newtheorem-list))
+ t)
+
+ '("addtheoremline*"
+ (TeX-arg-eval completing-read "Environment: "
+ (LaTeX-ntheorem-newtheorem-list))
+ t)
+
+ '("addtotheoremfile"
+ [ TeX-arg-eval completing-read "Environment: "
+ (LaTeX-ntheorem-newtheorem-list) ]
+ t)
+
+ ;; 2.5.1 Defining New Theorem Layouts
+ '("newtheoremstyle"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((style (TeX-read-string
+ (TeX-argument-prompt optional nil "Style name"))))
+ (LaTeX-add-ntheorem-newtheoremstyles style)
+ (add-to-list (make-local-variable 'LaTeX-ntheorem-theoremstyle-list)
+ (list style))
+ (format "%s" style))))
+ 2)
+
+ '("renewtheoremstyle"
+ (TeX-arg-eval completing-read "Style name: "
+ LaTeX-ntheorem-theoremstyle-list)
+ 2)
+
+ ;; 2.5.2 Defining New Theorem List Layouts
+ '("newtheoremlisttype"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((layout (TeX-read-string
+ (TeX-argument-prompt optional nil "List layout name"))))
+ (LaTeX-add-ntheorem-newtheoremlisttypes layout)
+ (add-to-list (make-local-variable 'LaTeX-ntheorem-listtype-list)
+ (list layout))
+ (format "%s" layout))))
+ 3)
+
+ '("renewtheoremlisttype"
+ (TeX-arg-eval completing-read "Style name: "
+ LaTeX-ntheorem-listtype-list)
+ 3)
+
+ ;; 2.6 Setting End Marks
+ '("qedsymbol" t)
+ '("NoEndMark" 0)
+
+ ;; 2.7 Extended Referencing Features
+ (when (LaTeX-provided-package-options-member "ntheorem" "thref")
+ '("thref" TeX-arg-ref)) )
+
+ ;; 2.6 Setting End Marks
+ ;; ... the endmark can manually be set by just saying \<name>Symbol.
+ (when (LaTeX-provided-package-options-member "ntheorem" "thmmarks")
+ (dolist (nthm (mapcar 'car (LaTeX-ntheorem-newtheorem-list)))
+ (TeX-add-symbols (concat nthm "Symbol"))))
+
+ ;; 2.8 Miscellaneous
+ ;; Inside a theorem-like environment <env>, the name given as
+ ;; optional argument is accessible by \<env>name
+ (dolist (nthm (mapcar 'car (LaTeX-ntheorem-newtheorem-list)))
+ (TeX-add-symbols (concat nthm "name")))
+
+;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("newtheorem" "{[{[")
+ ("renewtheorem" "{[{[")
+ ("theoremstyle" "{")
+ ("theorembodyfont" "{")
+ ("theoremheaderfont" "{")
+ ("theoremnumbering" "{")
+ ("theoremseparator" "{")
+ ("theorempreskip" "{")
+ ("theorempostskip" "{")
+ ("theoremsymbol" "{")
+ ("theoremindent" "")
+ ("theoremprework" "{")
+ ("theorempostwork" "{")
+ ("theoremclass" "{")
+ ("newframedtheorem" "{[{[")
+ ("newshadedtheorem" "*{[{[")
+ ("shadecolor" "{")
+ ("theoremframepreskip" "{")
+ ("theoremframepostskip" "{")
+ ("theoreminframepreskip" "{")
+ ("theoreminframepostskip" "{")
+ ("listtheorems" "{")
+ ("addtheoremline" "*{{")
+ ("addtotheoremfile" "[{")
+ ("newtheoremstyle" "{{{")
+ ("renewtheoremstyle" "{{{")
+ ("newtheoremlisttype" "{{{{")
+ ("renewtheoremlisttype" "{{{{"))
+ 'function)
+ (font-latex-add-keywords '(("thref" "{"))
+ 'reference)))
+ LaTeX-dialect)
+
+(defvar LaTeX-ntheorem-package-options
+ '("standard" "noconfig" "framed" "thmmarks" "thref" "amsmath" "hyperref")
+ "Package options for the ntheorem package.")
+
+;;; ntheorem.el ends here
--- /dev/null
+;;; paracol.el --- AUCTeX style for `paracol.sty' (v1.32)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-05-26
+;; 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 `paracol.sty' (v1.32) from 2015/10/10.
+;; `paracol.sty' is part of TeXLive.
+
+;; `paracol.sty' provides an environment (paracol) and a command
+;; (\switchcolumn) which take a star as the second (!) optional
+;; argument. In order to make the input process easier for the users,
+;; this style provides the environment `paracol*' and the command
+;; `switchcolumn*' in the list of completion after entering C-c C-e or
+;; C-c C-m (or C-c RET).
+
+;; Further, `\switchcolumn' takes a third optional argument containing
+;; text which will be inserted spanned over the columns. This style
+;; does not ask for this argument. If you need it, just enter it by
+;; hand after the completion. This is a deliberate decision since I
+;; think that over the time, the annoyance factor of hitting `RET'
+;; will be larger than the number of times where this argument is
+;; actually used.
+
+;;; Code:
+
+(defun TeX-arg-paracol-switchcolumn* (optional)
+ "Query and insert the column argument of \\switchcolum macro.
+If OPTIONAL is non-nil, insert the result in square brackets."
+ (let ((col (TeX-read-string
+ (TeX-argument-prompt optional nil "Column"))))
+ (when (and col (not (string= col "")))
+ (save-excursion
+ (backward-char 1)
+ (TeX-argument-insert col optional)))))
+
+(TeX-add-style-hook
+ "paracol"
+ (lambda ()
+
+ (LaTeX-add-environments
+ ;; 7.1 Environment paracol
+ ;; \begin{paracol}[numleft]{num}[text] body \end{paracol}
+ ;; \begin{paracol}[numleft]*{num}[text] body \end{paracol}
+ '("paracol" [ "Number left" ] "Number of columns" [ "Text across columns" ] )
+ '("paracol*"
+ (lambda (_env)
+ (let ((numleft (TeX-read-string
+ (TeX-argument-prompt t nil "Number left")))
+ (numcol (TeX-read-string
+ (TeX-argument-prompt nil nil "Number of columns")))
+ (txt (TeX-read-string
+ (TeX-argument-prompt t nil "Text across columns"))))
+ (LaTeX-insert-environment
+ ;; Simply feed the function with "paracol", other option is
+ ;; something like:
+ ;; (replace-regexp-in-string (regexp-quote "*") "" env)
+ "paracol"
+ (concat
+ (when (and numleft (not (string= numleft "")))
+ (format "[%s]" numleft))
+ "*"
+ (format "{%s}" numcol)
+ (when (and txt (not (string= txt "")))
+ (format "[%s]" txt)))))))
+
+ ;; 7.2 Column-Switching Command and Environments
+ ;; \begin{column} body \end{column}
+ ;; \begin{column*}[text] body \end{column*}
+ '("column")
+ '("column*" [ "Text across columns" ] )
+
+ ;; \begin{nthcolumn}{col} body \end{nthcolumn}
+ ;; \begin{nthcolumn*}{col}[text] body \end{nthcolumn*}
+ '("nthcolumn" "Column")
+ '("nthcolumn*" "Column" [ "Text across columns" ] )
+
+ ;; \begin{leftcolumn} body \end{leftcolumn}
+ ;; \begin{leftcolumn*}[text] body \end{leftcolumn*}
+ ;; \begin{rightcolumn} body \end{rightcolumn}
+ ;; \begin{rightcolumn*}[text] body \end{rightcolumn*}
+ '("leftcolumn")
+ '("leftcolumn*" [ "Text across columns" ] )
+ '("rightcolumn")
+ '("rightcolumn*" [ "Text across columns" ] ))
+
+ (TeX-add-symbols
+ ;; 7.2 Column-Switching Command and Environments
+ ;; \switchcolumn[col]
+ ;; \switchcolumn[col]*[text]
+ '("switchcolumn" [ "Column" ] )
+ '("switchcolumn*" [ TeX-arg-paracol-switchcolumn* ] )
+ '("thecolumn")
+ '("ensurevspace" TeX-arg-length)
+
+ ;; 7.3 Commands for Column and Gap Width
+ ;; \columnratio{r0, r1, ... , rk}[r0', r1', ... , rk']
+ '("columnratio" "Fraction(s)" [ "Fraction(s)" ] )
+
+ ;; \setcolumnwidth{s0, s1, ... , sk}[s0', s1', ... , sk']
+ ;; with s as width/gap
+ '("setcolumnwidth" "Width/Gap" [ "Width/Gap" ] )
+
+ ;; 7.4 Commands for Two-Sided Typesetting and Marginal Note Placement
+ ;; \twosided[t1t2 ... tk]
+ '("twosided" [ "Features (combination of p, c, m, b)" ])
+
+ ;; \marginparthreshold{k}[k']
+ '("marginparthreshold" "Number of columns" [ "Number of columns" ] )
+
+ ;; 7.5 Commands for Counters
+ ;; \globalcounter{ctr}
+ ;; \globalcounter*
+ '("globalcounter" TeX-arg-counter)
+ '("globalcounter*")
+
+ ;; \localcounter{ctr}
+ '("localcounter" TeX-arg-counter)
+
+ ;; \definethecounter{ctr}{col}{rep}
+ '("definethecounter" TeX-arg-counter "Column" t)
+
+ ;; \synccounter{ctr}
+ '("synccounter" TeX-arg-counter)
+ '("syncallcounters")
+
+ ;; 7.6 Page-Wise Footnotes
+ '("footnotelayout"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Layout")
+ '("c" "m" "p")))
+
+ ;; \footnote*[num]{text}
+ ;; \footnotemark*[num]
+ ;; \footnotetext*[num]{text}
+ ;; Copied from `latex.el'
+ '("footnote*"
+ (TeX-arg-conditional TeX-arg-footnote-number-p ([ "Number" ]) nil)
+ t)
+ '("footnotetext*"
+ (TeX-arg-conditional TeX-arg-footnote-number-p ([ "Number" ]) nil)
+ t)
+ '("footnotemark*"
+ (TeX-arg-conditional TeX-arg-footnote-number-p ([ "Number" ]) nil))
+
+ '("fncounteradjustment" 0)
+ '("nofncounteradjustment" 0)
+
+ ;; 7.7 Commands for Coloring Texts and Column-Separating Rules
+ ;; \columncolor[mode]{color}[col]
+ ;;
+ ;; This clashes if colortbl.el is loaded since it provides a
+ ;; command with the same name but different arguments. We add
+ ;; the command only here but not for fontification
+ '("columncolor" (TeX-arg-conditional (member "xcolor" (TeX-style-list))
+ (TeX-arg-xcolor)
+ (TeX-arg-color))
+ [ "Column" ] )
+
+ ;; \normalcolumncolor[col]
+ '("normalcolumncolor" [ "Column" ] )
+ '("coloredwordhyphenated" 0)
+ '("nocoloredwordhyphenated" 0)
+
+ ;; \colseprulecolor[mode]{color}[col]
+ ;; \normalcolseprulecolor[col]
+ '("colseprulecolor" (TeX-arg-conditional (member "xcolor" (TeX-style-list))
+ (TeX-arg-xcolor)
+ (TeX-arg-color))
+ [ "Column" ] )
+ '("normalcolseprulecolor" [ "Column" ] )
+
+ ;; 7.8 Commands for Background Painting
+ ;; \backgroundcolor{region}[mode]{color}
+ ;; \backgroundcolor{region(x0,y0)}[mode]{color}
+ ;; \backgroundcolor{region(x0,y0)(x1,y1)}[mode]{color}
+ '("backgroundcolor"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Region")
+ '("c" "g" "s" "f" "n" "p" "t" "b" "l" "r"
+ "C" "G" "S" "F" "N" "P" "T" "B" "L" "R"))
+ (TeX-arg-conditional (member "xcolor" (TeX-style-list))
+ (TeX-arg-xcolor)
+ (TeX-arg-color)))
+
+ ;; \nobackgroundcolor{region}
+ '("nobackgroundcolor"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Region")
+ '("c" "g" "s" "f" "n" "p" "t" "b" "l" "r"
+ "C" "G" "S" "F" "N" "P" "T" "B" "L" "R")))
+
+ ;; \resetbackgroundcolor
+ '("resetbackgroundcolor" 0)
+
+ ;; 7.9 Control of Contents Output
+ ;; \addcontentsonly{file}{col}
+ '("addcontentsonly"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Content file")
+ '("toc" "lof" "lot"))
+ "Column")
+
+ '("flushpage" 0))
+
+ ; \switchcolumn should get its own line:
+ (LaTeX-paragraph-commands-add-locally "switchcolumn")
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ ;; FIXME: Syntax is \switchcolumn[num]*[text].
+ ;; font-latex.el doesn't handle the case
+ ;; where `*' comes after the first `['.
+ ;; Therefore, we use this compromise to
+ ;; get something fontified at least.
+ (font-latex-add-keywords '(("switchcolumn" "*["))
+ 'textual)
+ (font-latex-add-keywords '(("flushpage" "*["))
+ 'warning)
+ (font-latex-add-keywords '(("footnote" "*[{")
+ ("footnotemark" "*[")
+ ("footnotetext" "*[{"))
+ 'reference)
+ (font-latex-add-keywords '(("ensurevspace" "{")
+ ("columnratio" "{[")
+ ("setcolumnwidth" "{[")
+ ("twosided" "[")
+ ("marginparthreshold" "{[")
+ ;; FIXME: Syntax is
+ ;; \globalcounter{ctr} or
+ ;; \globalcounter* We ignore `{' since
+ ;; font-latex.el doesn't handle a
+ ;; missing bracket nicely.
+ ("globalcounter" "*")
+ ("definethecounter" "{{{")
+ ("synccounter" "{")
+ ("syncallcounters" "")
+ ("footnotelayout" "{")
+ ("fncounteradjustment" "")
+ ("nofncounteradjustment" "")
+ ("normalcolumncolor" "[")
+ ("coloredwordhyphenated" "")
+ ("nocoloredwordhyphenated" "")
+ ("colseprulecolor" "[{[")
+ ("normalcolseprulecolor" "[")
+ ("backgroundcolor" "{[{")
+ ("nobackgroundcolor" "{")
+ ("resetbackgroundcolor" "")
+ ("addcontentsonly" "{{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-paracol-package-options nil
+ "Package options for the paracol package.")
+
+;;; paracol.el ends here
--- /dev/null
+;;; pdflscape.el --- AUCTeX style for `pdflscape.sty' (v0.11)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-07-31
+;; 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 `pdflscape.sty' (v0.11) from 2016/05/14.
+;; `pdflscape.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "pdflscape"
+ (lambda ()
+ ;; Load lscape.el and we are done
+ (TeX-run-style-hooks "lscape"))
+ LaTeX-dialect)
+
+(defvar LaTeX-pdflscape-package-options nil
+ "Package options for the pdflscape package.")
+
+;;; pdflscape.el ends here
--- /dev/null
+;;; pdfpages.el --- AUCTeX style for `pdfpages.sty' (v0.4v)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-05-23
+;; 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 `pdfpages.sty' (v0.4v) from 2013/08/25.
+;; `pdfpages.sty' is part of TeXLive.
+
+;; Thanks to Andreas Matthias for testing this style and writing
+;; `pdfpages.sty' in the first place.
+
+;;; Code:
+(defvar LaTeX-pdfpages-key-val-options
+ '(;; Main options:
+ ("pages" ("-"))
+ ("nup")
+ ("landscape" ("true" "false"))
+ ;; Layout options:
+ ("delta")
+ ("offset")
+ ("frame" ("true" "false"))
+ ("column" ("true" "false"))
+ ("columnstrict" ("true" "false"))
+ ("openright" ("true" "false"))
+ ("pagecommand")
+ ("turn" ("true" "false"))
+ ("noautoscale" ("true" "false"))
+ ("fitpaper" ("true" "false"))
+ ("reflect" ("true" "false"))
+ ("signature")
+ ("signature*")
+ ("booklet" ("true" "false"))
+ ("picturecommand")
+ ("picturecommand*")
+ ("pagetemplate")
+ ("templatesize")
+ ("rotateoversize" ("true" "false"))
+ ("doublepages" ("true" "false"))
+ ("doublepagestwist" ("true" "false"))
+ ("doublepagestwistodd" ("true" "false"))
+ ("doublepagestwist*" ("true" "false"))
+ ("doublepagestwistodd*" ("true" "false"))
+ ("duplicatepages")
+ ;; Miscellaneous options:
+ ("lastpage")
+ ;; Hypertext options:
+ ("link" ("true" "false"))
+ ("linkname")
+ ("thread" ("true" "false"))
+ ("threadname")
+ ("linktodoc" ("true" "false"))
+ ;; Additional hypertext options:
+ ("linkfit" ("Fit" "FitH " "FitV " "FitB" "FitBH " "FitBV " "Region"))
+ ("linktodocfit" ("/Fit" "/FitH " "/FitV " "/FitB" "/FitBH " "/FitBV " "/Region"))
+ ("newwindow" ("true" "false"))
+ ("linkfilename")
+ ;; Experimental options: (Syntax may change in future versions!)
+ ("addtotoc")
+ ("addtolist")
+ ("survey" ("true" "false"))
+ ("survey-nolink" ("true" "false"))
+ ("xr-prefix"))
+ "Key=value options for pdfpages macros.")
+
+(TeX-add-style-hook
+ "pdfpages"
+ (lambda ()
+ ;; Run style hook for packages loaded by pdfpages; all packages
+ ;; are required for running LaTeX, but not necessary within AUCTeX
+ (TeX-run-style-hooks "graphicx" "eso-pic" "everyshi" "ifthen" "calc")
+
+ (TeX-add-symbols
+ ;; \includepdf[<options>]{<filename>}
+ '("includepdf"
+ [TeX-arg-key-val LaTeX-pdfpages-key-val-options]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((pdffile (file-relative-name
+ (read-file-name
+ "File to include: " nil nil nil nil
+ (lambda (pdfs)
+ (string-match "\\.pdf$" pdfs)))
+ (TeX-master-directory))))
+ (format "%s" pdffile)))))
+
+ ;; \includepdfmerge[<options>]{<file-page-list>}
+ ;; The mandatory argument is complex, we just insert a pair of
+ ;; braces and leave the rest to the user
+ '("includepdfmerge"
+ [TeX-arg-key-val LaTeX-pdfpages-key-val-options] t)
+
+ ;; \includepdfset{<options>}
+ '("includepdfset"
+ (TeX-arg-key-val LaTeX-pdfpages-key-val-options))
+
+ '("threadinfodict" 0))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("includepdfset" "{"))
+ 'function)
+ (font-latex-add-keywords '(("includepdf" "[{")
+ ("includepdfmerge" "[{"))
+ 'reference)))
+ LaTeX-dialect)
+
+(defvar LaTeX-pdfpages-package-options
+ '("final" "draft" "enable-survey")
+ "Prompt for package options for the pdfpages package.")
+
+;;; pdfpages.el ends here
--- /dev/null
+;;; polyglossia.el --- AUCTeX style for `polyglossia.sty' version 1.42.0.
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Maintainer: auctex-devel@gnu.org
+;; Author: Mosè Giordano <mose@gnu.org>
+;; 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 `polyglossia.sty' version 1.42.0.
+
+;;; TODO:
+
+;; -- Create language specific styles with names `gloss-<lang>.el'. They
+;; should add `text<lang>' macros, `<lang>' environments (`Arabic' for
+;; `arabic' language), and the others language-specific commands.
+
+;;; Code:
+
+(require 'tex) ;Indispensable when compiling the call to `TeX-auto-add-type'.
+
+(TeX-auto-add-type "polyglossia-lang" "LaTeX")
+
+;; Self Parsing -- see (info "(auctex)Hacking the Parser").
+(defvar LaTeX-polyglossia-lang-regexp
+ (concat "\\\\set\\(defaultlanguage\\|mainlanguage\\|otherlanguages?\\)"
+ "[ \t\n\r]*\\(?:\\[\\(.*\\)\\]\\)?[ \t\n\r]*{\\([A-Za-z, ]+\\)}")
+ "Matches languages set with polyglossia macros.")
+
+(defvar LaTeX-polyglossia-setkeys-regexp
+ (concat "\\\\setkeys"
+ "[ \t\n\r]*{\\([A-Za-z]+\\)}[ \t\n\r]*{\\([^}]*\\)}")
+ "Matches polyglossia languages options set using \"\setkeys\".")
+
+(defvar LaTeX-auto-polyglossia-lang nil
+ "Temporary for parsing polyglossia languages.")
+
+(defvar LaTeX-auto-polyglossia-setkeys nil
+ "Temporary for parsing polyglossia language options.")
+
+(defun LaTeX-polyglossia-prepare ()
+ "Clear some polyglossia variables before use."
+ (setq LaTeX-auto-polyglossia-lang nil
+ LaTeX-auto-polyglossia-setkeys nil
+ LaTeX-polyglossia-lang-list nil))
+
+(defun LaTeX-polyglossia-cleanup ()
+ "Move languages and their options from
+`LaTeX-auto-polyglossia-lang' to `LaTeX-polyglossia-lang-list'."
+ ;; Example: now the value of `LaTeX-auto-polyglossia-lang' is something like
+ ;; '(("danish" "defaultlanguage" "")
+ ;; ("arabic" "otherlanguage" "locale=tunisia,numerals=maghrib")
+ ;; ("german" "otherlanguage" "spelling=new,script=latin")
+ ;; ("icelandic,brazil,sanskrit" "otherlanguages" ""))
+ ;; We want to end up with a list like
+ ;; '(("danish" "defaultlanguage")
+ ;; ("arabic" "otherlanguage" "locale=tunisia" "numerals=maghrib")
+ ;; ("german" "otherlanguage" "spelling=new" "script=latin")
+ ;; ("icelandic" "otherlanguages")
+ ;; ("brazil" "otherlanguages")
+ ;; ("sanskrit" "otherlanguages" "script=Devanagari"))
+ ;; with "script=Devanagari" option to "sanskrit" language set using
+ ;; "\setkeys".
+ ;; In each element of the alist, the key is the language, the second value is
+ ;; the polyglossia command which set the language, the rest of values is the
+ ;; list of options given to the language.
+ (let (opts otheropts)
+ (mapc
+ (lambda (elt)
+ (mapc
+ (lambda (language)
+ ;; `opts' is the string of options for `language', set using
+ ;; "\setdefaultlanguage" or "\setotherlanguage".
+ (setq opts (cdr (cdr elt)))
+ ;; `otheropts' is the string of options for `language' set using
+ ;; "\setkeys".
+ (setq otheropts
+ (car (cdr (assoc language LaTeX-auto-polyglossia-setkeys))))
+ (add-to-list
+ 'LaTeX-polyglossia-lang-list
+ (append
+ (list language) (list (nth 1 elt))
+ (unless (equal opts '(""))
+ (LaTeX-listify-package-options (car opts)))
+ (if otheropts (LaTeX-listify-package-options otheropts))) t))
+ (LaTeX-listify-package-options (car elt))))
+ LaTeX-auto-polyglossia-lang)))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-polyglossia-prepare)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-polyglossia-cleanup)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+;; Run style hooks for every active language. This *has* to be done after
+;; `TeX-auto-parse'.
+(add-hook 'TeX-update-style-hook #'LaTeX-polyglossia-load-languages t)
+
+(defvar LaTeX-polyglossia-language-list
+ '("albanian" "amharic" "arabic" "armenian" "asturian" "bahasai" "bahasam"
+ "basque" "bengali" "brazil" "breton" "bulgarian" "catalan" "coptic"
+ "croatian" "czech" "danish" "divehi" "dutch" "english" "esperanto"
+ "estonian" "farsi" "finnish" "french" "friulan" "galician" "german" "greek"
+ "hebrew" "hindi" "icelandic" "interlingua" "irish" "italian" "kannada"
+ "khmer" "korean" "lao" "latin" "latvian" "lithuanian" "lsorbian" "magyar"
+ "malayalam" "marathi" "nko" "norsk" "nynorsk" "occitan" "piedmontese"
+ "polish" "portuges" "romanian" "romansh" "russian" "samin" "sanskrit"
+ "scottish" "serbian" "slovak" "slovenian" "spanish" "swedish" "syriac"
+ "tamil" "telugu" "thai" "tibetan" "turkish" "turkmen" "ukrainian" "urdu"
+ "usorbian" "vietnamese" "welsh")
+ "List of languages supported by the polyglossia LaTeX package.")
+
+(defun LaTeX-polyglossia-active-languages ()
+ "Return a list of polyglossia languages used in the document.
+The last language is the default one."
+ (let (active-languages default)
+ (mapc
+ (lambda (elt)
+ (setq default (or (string-equal "defaultlanguage" (nth 1 elt))
+ (string-equal "mainlanguage" (nth 1 elt))))
+ ;; Append the language to the list if it's the default one.
+ (add-to-list 'active-languages (car elt) default))
+ LaTeX-polyglossia-lang-list)
+ active-languages))
+
+(defun LaTeX-polyglossia-lang-option-member (language option)
+ "Return non-nil if OPTION has been given to polyglossia LANGUAGE.
+The value is actually the tail of the list of options given to LANGUAGE."
+ (member option (cdr (cdr (assoc language LaTeX-polyglossia-lang-list)))))
+
+(defun LaTeX-arg-polyglossia-lang (_optional default multiple setkeys)
+ "Prompt for language and its options with completion and insert them
+as arguments.
+
+This function is triggered by \"\setdefaultlanguage\",
+\"\setotherlanguage\", \"\setotherlanguages\", and \"\setkeys\"
+macros by polyglossia package.
+
+OPTIONAL is ignored, if DEFAULT is non-nil treat inserted
+language as default, if MULTIPLE is non-nil prompt for multiple
+languages, if SETKEYS is non-nil insert options as second
+mandatory argument."
+ ;; DEFAULT = t , MULTIPLE = nil, SETKEYS = nil: "\setdefaultlanguage".
+ ;; DEFAULT = nil, MULTIPLE = nil, SETKEYS = nil: "\setotherlanguage".
+ ;; DEFAULT = nil, MULTIPLE = t , SETKEYS = nil: "\setotherlanguages".
+ ;; DEFAULT = nil, MULTIPLE = nil, SETKEYS = t : "\setkeys".
+ (let ((language (funcall
+ (if multiple
+ 'TeX-completing-read-multiple
+ 'completing-read)
+ (if multiple "Languages: " "Language: ")
+ (if setkeys
+ (LaTeX-polyglossia-active-languages)
+ LaTeX-polyglossia-language-list)))
+ var options)
+ (if multiple
+ (mapc (lambda (elt) (TeX-run-style-hooks (concat "gloss-" elt)))
+ language)
+ (TeX-run-style-hooks (concat "gloss-" language)))
+ ;; "\setotherlanguages" doesn't take options, don't prompt for them.
+ (setq options
+ (if multiple ""
+ (setq var (intern (format "LaTeX-polyglossia-%s-options-list" language)))
+ (if (and (boundp var) (symbol-value var))
+ ;; "\setdefaultlanguage" and "\setotherlanguage" use `options'
+ ;; as first optional argument; "\setkeys" uses `options' as
+ ;; second mandatory argument.
+ (TeX-read-key-val (not setkeys) (symbol-value var))
+ ;; When `LaTeX-polyglossia-<lang>-options-list' is nil or not
+ ;; defined, don't prompt for options.
+ "")))
+ (unless setkeys
+ (let ((TeX-arg-opening-brace LaTeX-optop)
+ (TeX-arg-closing-brace LaTeX-optcl))
+ (TeX-argument-insert options t)))
+ (if multiple
+ (setq language (mapconcat 'identity language ",")))
+ (TeX-argument-insert language nil)
+ (if setkeys
+ (TeX-argument-insert options nil))))
+
+(defun LaTeX-arg-polyglossiasetup-options (optional)
+ "Prompt for setup options of polyglossia package.
+If OPTIONAL is non-nil, insert the resulting value as an optional
+argument, otherwise as a mandatory one."
+ (TeX-arg-key-val optional
+ '(("language") ;; TODO: add completion in `fontspec.el', see
+ ;; "\newfontlanguage"s in `fontspec-xetex.sty'.
+ ("hyphennames")
+ ("script") ;; TODO: add completion in `fontspec.el', see
+ ;; "\newfontscript"s in `fontspec-xetex.sty'.
+ ("direction" ("RL" "LR"))
+ ("scripttag")
+ ("langtag")
+ ("hyphenmins")
+ ("frenchspacing" ("true" "false"))
+ ("indentfirst" ("true" "false"))
+ ("fontsetup" ("true" "false"))
+ ;; The following options aren't already implemented but are
+ ;; present in `polyglossia.sty' comments.
+ ;; ("nouppercase" ("true" "false"))
+ ;; ("localalph")
+ ;; ("localnumber")
+ )))
+
+(defun LaTeX-polyglossia-load-languages ()
+ "Load style files of babel active languages."
+ (mapc (lambda (elt) (TeX-run-style-hooks (concat "gloss-" elt)))
+ (LaTeX-polyglossia-active-languages)))
+
+(TeX-add-style-hook
+ "polyglossia"
+ (lambda ()
+ (TeX-check-engine-add-engines 'luatex 'xetex)
+ (TeX-auto-add-regexp
+ `(,LaTeX-polyglossia-lang-regexp (3 1 2) LaTeX-auto-polyglossia-lang))
+ (TeX-auto-add-regexp
+ `(,LaTeX-polyglossia-setkeys-regexp (1 2) LaTeX-auto-polyglossia-setkeys))
+ (TeX-run-style-hooks "etoolbox" "makecmds" "xkeyval" "fontspec")
+ (TeX-add-symbols
+ '("setdefaultlanguage" (LaTeX-arg-polyglossia-lang t nil nil))
+ '("setmainlanguage" (LaTeX-arg-polyglossia-lang t nil nil))
+ '("setotherlanguage" (LaTeX-arg-polyglossia-lang nil nil nil))
+ '("setotherlanguages" (LaTeX-arg-polyglossia-lang nil t nil))
+ '("setkeys" (LaTeX-arg-polyglossia-lang nil nil t ))
+ '("PolyglossiaSetup" (TeX-arg-eval completing-read "Language: "
+ (LaTeX-polyglossia-active-languages))
+ LaTeX-arg-polyglossiasetup-options)
+ "selectbackgroundlanguage"
+ '("resetdefaultlanguage" ["argument"] 1)
+ "normalfontlatin"
+ "rmfamilylatin"
+ "sffamilylatin"
+ "ttfamilylatin"
+ "selectlanguage"
+ "foreignlanguage")
+
+ (TeX-declare-expert-macros
+ "polyglossia"
+ "PolyglossiaSetup" "selectbackgroundlanguage" "resetdefaultlanguage"
+ "normalfontlatin" "rmfamilylatin" "sffamilylatin" "ttfamilylatin"
+ "selectlanguage" "foreignlanguage")
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("setdefaultlanguage" "[{")
+ ("setmainlanguage" "[{")
+ ("setotherlanguage" "[{")
+ ("setotherlanguages" "{")
+ ("setkeys" "{{"))
+ 'function)))
+ LaTeX-dialect)
+
+;; TODO: move each option variable in its specific `gloss-<lang>.el' file.
+(defvar LaTeX-polyglossia-arabic-options-list
+ '(("calendar" ("gregorian" "islamic"))
+ ("locale" ("default" "mashriq" "libya" "algeria" "tunisia" "morocco" "mauritania"))
+ ("numerals" ("mashriq" "maghrib"))
+ ("abjadjimnotail" ("false" "true")))
+ "Arabic language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-bengali-options-list
+ '(("numerals" ("Western" "Devanagari"))
+ ("changecounternumbering" ("true" "false")))
+ "Bengali language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-catalan-options-list
+ '(("babelshorthands" ("true" "false")))
+ "Catalan language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-dutch-options-list
+ '(("babelshorthands" ("true" "false")))
+ "Dutch language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-english-options-list
+ '(("variant" ("american" "usmax" "british" "australian" "newzealand"))
+ ("ordinalmonthday" ("true" "false")))
+ "English language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-farsi-options-list
+ '(("numerals" ("western" "eastern"))
+ ;; ("locale") ;; not yet implemented
+ ;; ("calendar") ;; not yet implemented
+ )
+ "Farsi language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-german-options-list
+ '(("variant" ("german" "austrian" "swiss"))
+ ("spelling" ("new" "old"))
+ ("latesthyphen" ("true" "false"))
+ ("babelshorthands" ("true" "false"))
+ ("script" ("latin" "fraktur")))
+ "German language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-greek-options-list
+ '(("variant" ("monotonic" "polytonic" "ancient"))
+ ("numerals" ("greek" "arabic"))
+ ("attic" ("true" "false")))
+ "Greek language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-hebrew-options-list
+ '(("numerals" ("hebrew" "arabic"))
+ ("calendar" ("hebrew" "gregorian")))
+ "Hebrew language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-hindi-options-list
+ '(("numerals" ("Western" "Devanagari")))
+ "Hindi language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-lao-options-list
+ '(("numerals" ("lao" "arabic")))
+ "Lao language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-russian-options-list
+ '(("spelling" ("modern" "old"))
+ ("babelshorthands" ("true" "false")))
+ "Russian language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-sanskrit-options-list
+ '(("Script" ("Devanagari")))
+ "Sanskrit language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-serbian-options-list
+ '(("script" ("cyrillic" "latin")))
+ "Serbian language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-syriac-options-list
+ '(("numerals" ("western" "eastern" "abjad")))
+ "Syriac language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-thai-options-list
+ '(("numerals" ("thai" "arabic")))
+ "Thai language options for the polyglossia package.")
+
+(defvar LaTeX-polyglossia-package-options
+ '("babelshorthands" "localmarks" "nolocalmarks" "quiet")
+ "Package options for the polyglossia package.")
+
+;;; polyglossia.el ends here
--- /dev/null
+;;; preview.el --- AUCTeX style for `preview.sty' (v2010/02/14)
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-02-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 `preview.sty' v2010/02/14.
+;; `preview.sty' is part of TeXLive.
+
+;;; Code:
+
+(defun LaTeX-preview-arg-ifpreview (_optional)
+ "Insert \\else and \\fi part of \\ifPreview command from preview.sty.
+OPTIONAL is ignored."
+ (indent-according-to-mode)
+ (LaTeX-newline)
+ (indent-according-to-mode)
+ (save-excursion
+ (LaTeX-newline)
+ (indent-according-to-mode)
+ (insert TeX-esc "else")
+ (LaTeX-newline)
+ (LaTeX-newline)
+ (indent-according-to-mode)
+ (insert TeX-esc "fi")))
+
+(TeX-add-style-hook
+ "preview"
+ (lambda ()
+
+ (LaTeX-add-environments
+ '("preview")
+ '("nopreview"))
+
+ (TeX-add-symbols
+ '("PreviewMacro" (TeX-arg-conditional (y-or-n-p "With optional arguments? ")
+ ( [ t ] [ nil ] )
+ ())
+ TeX-arg-macro)
+
+ '("PreviewMacro*" (TeX-arg-conditional (y-or-n-p "With optional arguments? ")
+ ( [ t ] [ nil ] )
+ ())
+ TeX-arg-macro)
+
+ '("PreviewEnvironment" (TeX-arg-conditional (y-or-n-p "With optional arguments? ")
+ ( [ t ] [ nil ] )
+ ())
+ TeX-arg-environment)
+
+ '("PreviewEnvironment*" (TeX-arg-conditional (y-or-n-p "With optional arguments? ")
+ ( [ t ] [ nil ] )
+ ())
+ TeX-arg-environment)
+
+ '("PreviewSnarfEnvironment" TeX-arg-environment)
+
+ '("PreviewOpen")
+ '("PreviewClose")
+
+ '("ifPreview" LaTeX-preview-arg-ifpreview))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("PreviewMacro" "*[[{")
+ ("PreviewEnvironment" "*[[{")
+ ("PreviewSnarfEnvironment" "{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-preview-package-options
+ '("active" "noconfig" "psfixbb"
+ "dvips" "pdftex" "xetex"
+ "displaymath" "floats" "textmath"
+ "graphics" "sections" "delayed"
+ "auctex" "showlabels" "tightpage"
+ "lyx" "counters" "footnotes"
+ "tracingall" "showbox")
+ "Package options for the preview package.")
+
+;;; preview.el ends here
--- /dev/null
+;;; relsize.el --- AUCTeX style for `relsize.sty' version v4.1
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-12-14
+;; 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 `relsize.sty' version v4.1 from
+;; 2013/03/29. `relsize.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "relsize"
+ (lambda ()
+ (TeX-add-symbols
+ ;; Declarations and commands
+ '("relsize" "Steps" )
+ '("relscale" "Scale factor" )
+ '("larger" [ "Steps (default 1)" ] -1)
+ '("smaller" [ "Steps (default 1)" ] -1)
+ '("textlarger" [ "Steps" ] t)
+ '("textsmaller" [ "Steps" ] t)
+ '("textscale" "Scale factor" t)
+ '("mathlarger" t)
+ '("mathsmaller" t))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ ;; This is not easy, are the first 2 'variable oder rather
+ ;; 'type-declaration? I start with 'type-declaration, let the
+ ;; users decide
+ (font-latex-add-keywords '(("relsize" "")
+ ("relscale" "")
+ ("larger" "")
+ ("smaller" ""))
+ 'type-declaration)
+ (font-latex-add-keywords '(("textlarger" "[{")
+ ("textsmaller" "[{")
+ ("textscale" "{{"))
+ 'type-command)))
+ LaTeX-dialect)
+
+(defvar LaTeX-relsize-package-options nil
+ "Package options for the relsize package.")
+
+;;; relsize.el ends here
--- /dev/null
+;;; sourcecodepro.el --- AUCTeX style for `sourcecodepro.sty' (v2.6)
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-02-18
+;; 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 `sourcecodepro.sty' (v2.6) from 2016/04/18.
+;; `sourcecodepro.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "sourcecodepro"
+ (lambda ()
+
+ ;; Load "fontspec" with package options "opentype" or "otf":
+ (when (or (LaTeX-provided-package-options-member "sourcecodepro" "opentype")
+ (LaTeX-provided-package-options-member "sourcecodepro" "opentype=true")
+ (LaTeX-provided-package-options-member "sourcecodepro" "otf")
+ (LaTeX-provided-package-options-member "sourcecodepro" "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
+ '("sourcecodepro" -1)
+ '("sourcecodepromedium" -1)
+ '("sourcecodeprolight" -1)
+ '("sourcecodeproextreme" -1)
+ '("sourcecodeprolf" -1)))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup)
+ (member "fontspec" (TeX-style-list)))
+ (font-latex-add-keywords '(("sourcecodepro" "")
+ ("sourcecodepromedium" "")
+ ("sourcecodeprolight" "")
+ ("sourcecodeproextreme" "")
+ ("sourcecodeprolf" ""))
+ 'type-declaration)))
+ LaTeX-dialect)
+
+(defvar LaTeX-sourcecodepro-package-options
+ '("lining" "nf" "lf"
+ "oldstyle" "osf"
+ "black" "semibold" "bold"
+ "light" "extralight"
+ "regular" "medium"
+ "scale" "scaled"
+ "default" "ttdefault" "nottdefault"
+ "type1" "t1"
+ "opentype" "otf")
+ "Prompt for package options for the sourcecodepro package.")
+
+;;; sourcecodepro.el ends here
--- /dev/null
+;;; splitidx.el --- AUCTeX style for `splitidx.sty' (v1.2a)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-09-19
+;; 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 `splitidx.sty' (v1.2a) from 2013/04/09.
+;; `splitidx.sty' is part of TeXLive.
+
+;; The main index macro provided by `splitidx.sty' is
+;;
+;; \sindex[<shortcut>]{<index-entry>}
+;;
+;; where <shortcut> identifies the target where <index-entry> is going
+;; into. This style checks if RefTeX is loaded and adds "\sindex" to
+;; index macros known by RefTeX; this is described in RefTeX manual
+;; section 5.5 Defining Index Macros:
+;;
+;; (setq reftex-index-macros '(("\\sindex[]{*}" 1 ?s "" nil t)))
+;;
+;; To make things more user friendly, this style does not hard-code
+;; the key `?s' and offers a customizable variable called
+;; `LaTeX-splitidx-sindex-reftex-quick-id-key'. Customize this
+;; variable to another unique key if you have other preference. Also
+;; note the integer 1 after "\\sindex[]{*}". This tells RefTeX to
+;; look in first optional argument to find out which index the entry
+;; belongs to. If omitted, RefTeX puts the index entry into "idx".
+
+;; `splitidx.sty' provides also the option `idxcommands' where a
+;; command with the name of the <shortcut> is defined for each
+;; declared index. An example from splitidx.pdf:
+;;
+;; \documentclass{article}
+;; \usepackage[idxcommands]{splitidx}
+;;
+;; \newindex[General Index]{idx} % Name and shortcut of the 1st index
+;; \newindex[Index of Animals]{ani} % ... 2nd index
+;; \newindex[Index of Fruits]{fru} % ... 3rd index
+;; \newindex[Index of Vegetables]{veg} % ... 4th index
+;; ...
+;;
+;; Now four index commands \idx, \ani, \fru and \veg are available.
+;; This style adds these commands to AUCTeX and RefTeX (check function
+;; `LaTeX-splitidx-auto-cleanup'). The only thing missing is adding
+;; these commands to `reftex-index-macros' since the unique keys must
+;; be set by user. To get full advantage from RefTeX, remember that
+;; ?i, ?I, and ?g are reserved and set something like this in your
+;; init-file:
+;;
+;; (add-to-list 'reftex-index-macros '("\\idx" "idx" ?x "" nil t))
+;; (add-to-list 'reftex-index-macros '("\\ani" "ani" ?a "" nil t))
+;; (add-to-list 'reftex-index-macros '("\\fru" "fru" ?f "" nil t))
+;; (add-to-list 'reftex-index-macros '("\\veg" "veg" ?v "" nil t))
+;;
+;; Or you can do this in your tex file:
+;;
+;; %%% Local Variables:
+;; %%% mode: latex
+;; %%% TeX-master: t
+;; %%% eval: (add-to-list 'reftex-index-macros '("\\idx" "idx" ?x "" nil t))
+;; %%% eval: (add-to-list 'reftex-index-macros '("\\ani" "ani" ?a "" nil t))
+;; %%% eval: (add-to-list 'reftex-index-macros '("\\fru" "fru" ?f "" nil t))
+;; %%% eval: (add-to-list 'reftex-index-macros '("\\veg" "veg" ?v "" nil t))
+;; %%% End:
+;;
+
+;;; Code:
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+;; Setup parsing for \newindex:
+(TeX-auto-add-type "splitidx-newindex" "LaTeX" "splitidx-newindices")
+
+(defvar LaTeX-splitidx-newindex-regex
+ `(,(concat "\\\\new\\(?:protected\\)?index"
+ "\\(?:\\[[^]]*\\]\\)?"
+ "{\\([^}]+\\)}")
+ 1 LaTeX-auto-splitidx-newindex)
+ "Matches the argument of `\\newindex' from `splitidx.sty'.")
+
+(defun LaTeX-splitidx-auto-prepare ()
+ "Clear `LaTeX-auto-splitidx-newindex' before parsing."
+ (setq LaTeX-auto-splitidx-newindex nil))
+
+(defun LaTeX-splitidx-auto-cleanup ()
+ "Process parsed results for \"splitidx.sty\"."
+ (when (LaTeX-provided-package-options-member "splitidx" "idxcommands")
+ (dolist (elt (mapcar #'car (LaTeX-splitidx-newindex-list)))
+ ;; Make every element available as a command
+ (TeX-add-symbols `(,elt TeX-arg-index))
+ ;; Add new macros's to `ispell-tex-skip-alist': skip one argument
+ (TeX-ispell-skip-setcar `((,elt ispell-tex-arg-end)))
+ ;; font-locking
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords `((,elt "{"))
+ 'reference))
+ ;; Prepare for parsing
+ (add-to-list 'LaTeX-auto-regexp-list
+ `(,(concat
+ "\\\\"
+ elt
+ "{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*"
+ "}[^}{]*\\)*}[^}{]*\\)*\\)}")
+ 1 LaTeX-auto-index-entry))
+ ;; Cater for completion
+ (add-to-list 'TeX-complete-list
+ `(,(concat "\\\\" elt "{\\([^{}\n\r]*\\)")
+ 1 LaTeX-index-entry-list "}")) )))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-splitidx-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-splitidx-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "splitidx"
+ (lambda ()
+
+ (TeX-add-symbols
+
+ ;; 3.1 Setup
+ '("newindex"
+ [ "Index name" ]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((shortcut (TeX-read-string
+ (TeX-argument-prompt optional nil "Short cut"))))
+ (LaTeX-add-splitidx-newindices shortcut)
+ (format "%s" shortcut)))))
+
+ ;; 3.2 Marking up index entries
+ '("sindex"
+ ;; I don't use `[ TeX-arg-index-tag ]' here
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Short cut")
+ (LaTeX-splitidx-newindex-list) ]
+ TeX-arg-index)
+
+ ;; 3.4 Customizing index entries
+ '("AtWriteToIndex"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Short cut")
+ (LaTeX-splitidx-newindex-list))
+ t)
+
+ '("AtNextWriteToIndex"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Short cut")
+ (LaTeX-splitidx-newindex-list))
+ t)
+
+ ;; 3.6 Preventing premature expansion of index entries
+ '("newprotectedindex"
+ [ "Index name" ]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((shortcut (TeX-read-string
+ (TeX-argument-prompt optional nil "Short cut"))))
+ (LaTeX-add-splitidx-newindices shortcut)
+ (format "%s" shortcut)))))
+
+ ;; 3.7 Including the generated indices in your document
+ '("printindex"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Short cut")
+ (LaTeX-splitidx-newindex-list) ]
+ [ "Index name" ])
+
+ '("printindex*" 0)
+
+ '("printsubindex"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Short cut")
+ (LaTeX-splitidx-newindex-list) ]
+ [ "Index name" ])
+
+ '("printsubindex*" 0)
+
+ '("setindexpreamble"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Short cut")
+ (LaTeX-splitidx-newindex-list) ]
+ t)
+
+ '("useindexpreamble" [ TeX-arg-macro ])
+
+ '("indexshortcut" 0)
+
+ '("extendtheindex" 4) )
+
+ ;; Add splitidx to the parser.
+ (TeX-auto-add-regexp LaTeX-splitidx-newindex-regex)
+
+ ;; Borrowed from index.el
+ (add-to-list 'LaTeX-auto-regexp-list
+ `(,(concat "\\\\sindex\\(?:\\[[^{}]*\\]\\)?"
+ "{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*"
+ "}[^}{]*\\)*}[^}{]*\\)*\\)}")
+ 1 LaTeX-auto-index-entry))
+
+ ;; Completion for \sindex entries
+ (add-to-list 'TeX-complete-list
+ '("\\\\sindex\\(\\[[^][{}]*\\]\\)?{\\([^{}\n\r]*\\)"
+ 2 LaTeX-index-entry-list "}"))
+
+ ;; Completion for the |see macro
+ (add-to-list 'TeX-complete-list
+ '("|see{\\([^{}\n\r]*\\)" 1 LaTeX-index-entry-list))
+
+ ;; Tell RefTeX with `reftex-add-index-macros'
+ (when (fboundp 'reftex-add-index-macros)
+ (reftex-add-index-macros
+ `(("\\sindex[]{*}" 1 ,LaTeX-splitidx-sindex-reftex-quick-id-key "" nil t))))
+
+ ;; 3.2 Marking up index entries
+ ;; \index should be an alias for \sindex
+ (when (LaTeX-provided-package-options-member "splitidx" "useindex")
+ (TeX-add-symbols
+ '("index"
+ [TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Short cut")
+ (LaTeX-splitidx-newindex-list) ]
+ (TeX-arg-index)))
+ ;; Tell RefTeX to look in the optional arg. for the index short cut
+ (when (fboundp 'reftex-add-index-macros)
+ (reftex-add-index-macros '(("\\index[]{*}" 1 ?i "" nil t))))
+ (add-to-list 'LaTeX-auto-regexp-list
+ `(,(concat
+ "\\\\index\\(?:\\[[^{}]*\\]\\)?"
+ "{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*"
+ "}[^}{]*\\)*}[^}{]*\\)*\\)}")
+ 1 LaTeX-auto-index-entry))
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("index" "[{"))
+ 'reference)))
+
+ ;; 3.5 Automatic custom index commands
+ ;; With package option `idxcommands', one can write \foo{<entry>}
+ ;; instead of \sindex[foo]{<entry>}
+ (when (and (LaTeX-provided-package-options-member "splitidx" "idxcommands")
+ (LaTeX-splitidx-newindex-list))
+ (dolist (elt (mapcar #'car (LaTeX-splitidx-newindex-list)))
+ ;; Make every `foo' available as a command
+ (TeX-add-symbols `(,elt TeX-arg-index))
+ ;; Add new macros's to `ispell-tex-skip-alist': skip one argument
+ (TeX-ispell-skip-setcar `((,elt ispell-tex-arg-end)))
+ ;; Cater for font-locking
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords `((,elt "{"))
+ 'reference))
+ ;; Add defined <entry> to `LaTeX-index-entry-list'
+ (add-to-list 'LaTeX-auto-regexp-list
+ `(,(concat
+ "\\\\"
+ elt
+ "{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*"
+ "}[^}{]*\\)*}[^}{]*\\)*\\)}")
+ 1 LaTeX-auto-index-entry)) ))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("newindex" "[{")
+ ("AtWriteToIndex" "{{")
+ ("AtNextWriteToIndex" "{{")
+ ("newprotectedindex" "[{")
+ ("setindexpreamble" "[{")
+ ("useindexpreamble" "[")
+ ("extendtheindex" "{{{{"))
+ 'function)
+ (font-latex-add-keywords '(("sindex" "[{"))
+ 'reference)))
+ LaTeX-dialect)
+
+(defvar LaTeX-splitidx-package-options
+ '("makeindex"
+ "useindex"
+ "allintoone"
+ "split"
+ "protected"
+ "idxcommands")
+ "Prompt for package options for the splitidx package.")
+
+;;; splitidx.el ends here
--- /dev/null
+;;; subcaption.el --- AUCTeX style for `subcaption.sty' (v1.1-100)
+
+;; Copyright (C) 2015--2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-09-19
+;; 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 `subcaption.sty' (v1.1-100) from
+;; 2015-09-15. `subcaption.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-subcaption-key-val-options
+ '(("subrefformat" ("default" "empty" "simple" "brace" "parens")))
+ "Key=value options for subcaption package. This key takes the
+same values as \"labelformat\" from caption package.")
+
+(defun LaTeX-arg-subcaption-subcaption (optional &optional star)
+ "Query for the arguments of \"\\subcaption\" incl. a label and insert them.
+If STAR is non-nil, then do not query for a \\label and a short
+caption, insert only a caption."
+ (let* (;; \subcaption needs an environment, "minipage" will be
+ ;; popular. If so, check next higher environment to find out
+ ;; where we are
+ (currenv (if (string= (LaTeX-current-environment) "minipage")
+ (LaTeX-current-environment 2)
+ (LaTeX-current-environment)))
+ (caption (TeX-read-string
+ (TeX-argument-prompt optional nil "Sub-caption")))
+ (short-caption
+ (when (and (not star)
+ (>= (length caption) LaTeX-short-caption-prompt-length))
+ (TeX-read-string
+ (TeX-argument-prompt t nil "Short caption")))))
+ (indent-according-to-mode)
+ (when (and short-caption (not (string= short-caption "")))
+ (insert LaTeX-optop short-caption LaTeX-optcl))
+ (insert TeX-grop caption TeX-grcl)
+ ;; Fill the \subcaption paragraph before inserting the \label:
+ (LaTeX-fill-paragraph)
+ (when (and (not star)
+ (save-excursion (LaTeX-label currenv 'environment)))
+ ;; Move \label into next line if we have one:
+ (LaTeX-newline)
+ (indent-according-to-mode)
+ (end-of-line))))
+
+(defun LaTeX-arg-subcaption-subcaptionbox (optional &optional star)
+ "Query for the arguments of \"\\subcaptionbox\" incl. a label and insert them.
+If STAR is non-nil, then do not query for a \\label and a short
+caption, insert only a caption."
+ (let* ((currenv (LaTeX-current-environment))
+ (caption (TeX-read-string
+ (TeX-argument-prompt optional nil "Sub-caption")))
+ (short-caption
+ (when (and (not star)
+ (>= (length caption) LaTeX-short-caption-prompt-length))
+ (TeX-read-string
+ (TeX-argument-prompt t nil "Short Sub-caption")))))
+ (indent-according-to-mode)
+ (when (and short-caption (not (string= short-caption "")))
+ (insert LaTeX-optop short-caption LaTeX-optcl))
+ (insert TeX-grop caption)
+ (unless star (LaTeX-label currenv 'environment))
+ (insert TeX-grcl))
+ (let* ((TeX-arg-opening-brace "[")
+ (TeX-arg-closing-brace "]")
+ (width (completing-read (TeX-argument-prompt t nil "Width")
+ (mapcar (lambda (elt) (concat TeX-esc (car elt)))
+ (LaTeX-length-list))))
+ (inpos (if (and width (not (string-equal width "")))
+ (completing-read (TeX-argument-prompt t nil "Inner position")
+ '("c" "l" "r" "s"))
+ "")))
+ (TeX-argument-insert width t)
+ (TeX-argument-insert inpos t))
+ ;; Fill the paragraph before inserting {}. We use this function
+ ;; since we add \subcaption to `paragraph-start' in the style hook
+ ;; below.
+ (LaTeX-fill-paragraph))
+
+(TeX-add-style-hook
+ "subcaption"
+ (lambda ()
+ ;; Run style hook for caption.el
+ (TeX-run-style-hooks "caption")
+
+ ;; Make "subrefformat" available in key-vals of caption.el:
+ (setq LaTeX-caption-key-val-options-local
+ (append LaTeX-subcaption-key-val-options
+ LaTeX-caption-key-val-options-local))
+
+ (TeX-add-symbols
+ ;; Basic commands
+ '("subcaption" (LaTeX-arg-subcaption-subcaption))
+ '("subcaption*" (LaTeX-arg-subcaption-subcaption t))
+ '("subcaptionbox" (LaTeX-arg-subcaption-subcaptionbox) t)
+ '("subcaptionbox*" (LaTeX-arg-subcaption-subcaptionbox t) t)
+ '("subref" TeX-arg-ref)
+ ;; \subref* is only available with hyperref.sty loaded, we don't
+ ;; check if hyperref.el is loaded and make it available directly.
+ '("subref*" TeX-arg-ref)
+ '("phantomcaption" 0)
+ '("phantomsubcaption" 0))
+
+ ;; The next 2 macros are part of the kernel of caption.sty, but we
+ ;; load them within subcaption.el.
+ (TeX-add-symbols
+ '("DeclareCaptionSubType"
+ [TeX-arg-eval
+ completing-read (TeX-argument-prompt t nil "Numbering scheme")
+ '("arabic" "roman" "Roman" "alph" "Alph" "fnsymbol")]
+ (TeX-arg-eval
+ completing-read (TeX-argument-prompt nil nil "Type")
+ '("figure" "table")))
+
+ '("DeclareCaptionSubType*"
+ [TeX-arg-eval completing-read
+ (TeX-argument-prompt t nil "Numbering scheme")
+ '("arabic" "roman" "Roman" "alph" "Alph" "fnsymbol")]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt nil nil "Type")
+ '("figure" "table"))))
+
+ ;; \subcaption(box)? macros should get their own lines
+ (LaTeX-paragraph-commands-add-locally '("subcaption" "subcaptionbox"))
+
+ ;; The subfigure & subtable environments
+ (LaTeX-add-environments
+ '("subfigure" LaTeX-env-minipage)
+ '("subtable" LaTeX-env-minipage))
+
+ ;; Append them to `LaTeX-label-alist':
+ (add-to-list 'LaTeX-label-alist '("subfigure" . LaTeX-figure-label) t)
+ (add-to-list 'LaTeX-label-alist '("subtable" . LaTeX-table-label) t)
+
+ ;; Introduce env's to RefTeX if loaded
+ (when (fboundp 'reftex-add-label-environments)
+ (reftex-add-label-environments
+ `(("subfigure" ?f ,LaTeX-figure-label "~\\ref{%s}" caption)
+ ("subtable" ?t ,LaTeX-table-label "~\\ref{%s}" caption))))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("subcaption" "*[{")
+ ("subcaptionbox" "*[{[[")
+ ("phantomcaption" "")
+ ("phantomsubcaption" ""))
+ 'textual)
+ (font-latex-add-keywords '(("subref" "*{"))
+ 'reference)
+ (font-latex-add-keywords '(("DeclareCaptionSubType" "*[{"))
+ 'function)) )
+ LaTeX-dialect)
+
+(defun LaTeX-subcaption-package-options ()
+ "Prompt for package options for the subcaption package."
+ (TeX-read-key-val t
+ (append LaTeX-subcaption-key-val-options
+ LaTeX-caption-key-val-options)))
+
+;;; subcaption.el ends here
--- /dev/null
+;;; subfiles.el --- AUCTeX style for the subfiles package.
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Uwe Brauer <oub@mat.ucm.es>
+;; Created: 07 Nov 2016
+;; 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.
+
+;; Acknowledgements
+;; Mosè Giordano <mose@gnu.org>
+;; Arash Esbati <arash@gnu.org>
+
+;;; Commentary:
+
+;; This file adds support for the subfiles package.
+
+;;; Code:
+
+(defvar LaTeX-subfiles-package-options nil
+ "Package options for the subfiles package.")
+
+(defun LaTeX-subfiles-class-options ()
+ "Return name of the main file relative to current subfile."
+ (file-relative-name
+ (read-file-name
+ "Main file: " nil nil nil nil
+ (lambda (texfiles)
+ (string-match "\\.tex$" texfiles)))
+ (TeX-master-directory)))
+
+(TeX-add-style-hook
+ "subfiles"
+ (lambda ()
+
+ ;; The following code will run `TeX-run-style-hooks' on the subfile
+ ;; master file. Thanks to Mosè Giordano <mose@gnu.org> for
+ ;; presenting a better solution using `assoc'.
+ (let ((master-file (cadr (assoc "subfiles" LaTeX-provided-class-options))))
+ (when (stringp master-file)
+ (TeX-run-style-hooks
+ (file-name-sans-extension master-file))))
+
+ (TeX-add-symbols
+ '("subfile" TeX-arg-file))
+
+ ;; Ensure that \subfile stays in one line
+ (LaTeX-paragraph-commands-add-locally "subfile")
+
+ ;; Tell AUCTeX that \subfile loads a file. regexp is the same as
+ ;; for \input or \include. This will run `TeX-run-style-hooks' on
+ ;; subfile(s) when master file is loaded.
+ (TeX-auto-add-regexp
+ `(,(concat
+ "\\\\subfile"
+ "{\\(\\.*[^#}%\\\\\\.\n\r]+\\)\\(\\.[^#}%\\\\\\.\n\r]+\\)?}")
+ 1 TeX-auto-file))
+
+ ;; Tell RefTeX the same thing.
+ (when (and (boundp 'reftex-include-file-commands)
+ (not (member "subfile" reftex-include-file-commands)))
+ (add-to-list 'reftex-include-file-commands "subfile" t)
+ (reftex-compile-variables))
+
+ ;; The following code will fontify `\subfile{}' like \input.
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("subfile" "{"))
+ 'reference)))
+ LaTeX-dialect)
+
+;;; subfiles.el ends here
--- /dev/null
+;;; tarticle.el - Special code for tarticle class.
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Ikumi Keita <ikumi@ikumi.que.jp>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-03-23
+;; 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:
+
+;; Please write me.
+
+;;; Code:
+
+(TeX-load-style "jarticle")
+(defvar LaTeX-tarticle-class-options LaTeX-jarticle-class-options
+ "Class options for the tarticle class.")
+
+(TeX-add-style-hook
+ "tarticle"
+ (lambda ()
+ (TeX-run-style-hooks "jarticle" "plext"))
+ LaTeX-dialect)
+
+;;; tarticle.el ends here
--- /dev/null
+;;; tbook.el - Special code for tbook class.
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Ikumi Keita <ikumi@ikumi.que.jp>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-03-23
+;; 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:
+
+;; Please write me.
+
+;;; Code:
+
+(TeX-load-style "jbook")
+(defvar LaTeX-tbook-class-options LaTeX-jbook-class-options
+ "Class options for the tbook class.")
+
+(TeX-add-style-hook
+ "tbook"
+ (lambda ()
+ (TeX-run-style-hooks "jbook" "plext"))
+ LaTeX-dialect)
+
+;;; tbook.el ends here
--- /dev/null
+;;; tcolorbox.el --- AUCTeX style for `tcolorbox.sty' (v4.00)
+
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
+
+;; Author: Tassilo Horn <tsdh@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-01-04
+;; 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 `tcolorbox.sty' (v4.00) from 2017/02/16.
+
+;; This style file adds support for core macros and environments and
+;; their options provided by `tcolorbox.sty'. Macros and environments
+;; provided by libraries should go in their own style files where the
+;; file is prefixed with `tcolorboxlib-',
+;; e.g. `tcolorboxlib-raster.el'.
+
+;; Libraries should also append their key=val option to variable
+;; `LaTeX-tcolorbox-keyval-options-full'. This variable is called
+;; with macro `\tcbset'.
+
+;;; Code:
+
+;; Needed for compiling `pushnew':
+(eval-when-compile (require 'cl))
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+;; FIXME: Anything missing?
+(defvar LaTeX-tcolorbox-keyval-options
+ '(;; 4.1 Title
+ ("title")
+ ("notitle")
+ ("adjusted title")
+ ("adjust text")
+ ("squeezed title")
+ ("squeezed title*")
+ ("detach title")
+ ("attach title")
+ ("attach title to upper")
+ ;; 4.2 Subtitle
+ ("subtitle style")
+ ;; 4.3 Upper Part
+ ("upperbox" ("visible" "invisible"))
+ ("visible")
+ ("invisible")
+ ("saveto")
+ ;; 4.4 Lower Part
+ ("lowerbox" ("visible" "invisible" "ignored"))
+ ("savelowerto")
+ ("lower separated" ("true" "false"))
+ ("savedelimiter")
+ ;; 4.5 Colors and Fonts
+ ("colframe")
+ ("colback")
+ ("title filled" ("true" "false"))
+ ("colbacktitle")
+ ("colupper")
+ ("collower")
+ ("coltext")
+ ("coltitle")
+ ("fontupper" ("\\rmfamily" "\\sffamily" "\\ttfamily" "\\mdseries" "\\bfseries"
+ "\\upshape" "\\itshape" "\\slshape" "\\scshape"
+ "\\tiny" "\\scriptsize" "\\footnotesize"
+ "\\small" "\\normalsize" "\\large"
+ "\\Large" "\\LARGE" "\\huge" "\\Huge" "\\normalfont"))
+ ("fontlower" ("\\rmfamily" "\\sffamily" "\\ttfamily" "\\mdseries" "\\bfseries"
+ "\\upshape" "\\itshape" "\\slshape" "\\scshape"
+ "\\tiny" "\\scriptsize" "\\footnotesize"
+ "\\small" "\\normalsize" "\\large"
+ "\\Large" "\\LARGE" "\\huge" "\\Huge" "\\normalfont"))
+ ("fonttitle" ("\\rmfamily" "\\sffamily" "\\ttfamily" "\\mdseries" "\\bfseries"
+ "\\upshape" "\\itshape" "\\slshape" "\\scshape"
+ "\\tiny" "\\scriptsize" "\\footnotesize"
+ "\\small" "\\normalsize" "\\large"
+ "\\Large" "\\LARGE" "\\huge" "\\Huge" "\\normalfont"))
+ ;; 4.6 Text Alignment
+ ("halign" ("justify" "left" "flush left" "right"
+ "flush right" "center" "flush center"))
+ ("halign lower" ("justify" "left" "flush left" "right"
+ "flush right" "center" "flush center"))
+ ("halign title" ("justify" "left" "flush left" "right"
+ "flush right" "center" "flush center"))
+ ("flushleft upper")
+ ("center upper")
+ ("flushright upper")
+ ("flushleft lower")
+ ("center lower")
+ ("flushright lower")
+ ("flushleft title")
+ ("center title")
+ ("flushright title")
+ ("valign" ("top" "center" "bottom" "scale" "scale*"))
+ ("valign upper" ("top" "center" "bottom" "scale" "scale*"))
+ ("valign lower" ("top" "center" "bottom" "scale" "scale*"))
+ ("valign scale limit")
+ ;; 4.7 Geometry:
+ ;; 4.7.1 Width
+ ("width")
+ ("text width")
+ ("add to width")
+ ;; 4.7.2 Rules
+ ("toprule")
+ ("bottomrule")
+ ("leftrule")
+ ("rightrule")
+ ("titlerule")
+ ("boxrule")
+ ;; 4.7.3 Arcs
+ ("arc")
+ ("circular arc")
+ ("bean arc")
+ ("octogon arc")
+ ("arc is angular")
+ ("arc is curved")
+ ("outer arc")
+ ("auto outer arc")
+ ;; 4.7.4 Spacing
+ ("boxsep")
+ ("left")
+ ("left*")
+ ("lefttitle")
+ ("leftupper")
+ ("leftlower")
+ ("right")
+ ("right*")
+ ("righttitle")
+ ("rightupper")
+ ("rightlower")
+ ("top")
+ ("toptitle")
+ ("bottom")
+ ("bottomtitle")
+ ("middle")
+ ;; 4.7.5 Size Shortcuts
+ ("size" ("normal" "title" "small" "fbox" "tight" "minimal"))
+ ("oversize")
+ ("toggle left and right" ("none" "forced" "evenpage"))
+ ;; 4.8 Corners
+ ("sharp corners" ("northwest" "northeast" "southwest" "southeast"
+ "north" "south" "east" "west" "downhill" "uphill" "all"))
+ ("rounded corners" ("northwest" "northeast" "southwest" "southeast"
+ "north" "south" "east" "west" "downhill" "uphill" "all"))
+ ("sharpish corners")
+ ;; 4.9 Transparency
+ ("opacityframe")
+ ("opacityback")
+ ("opacitybacktitle")
+ ("opacityfill")
+ ("opacityupper")
+ ("opacitylower")
+ ("opacitytext")
+ ("opacitytitle")
+ ;; 4.10 Height Control
+ ("natural height")
+ ("height")
+ ("height plus")
+ ("height from")
+ ("text height")
+ ("add to height")
+ ("add to natural height")
+ ("height fill" ("true" "false" "maximum"))
+ ("square")
+ ("space")
+ ("space to upper")
+ ("space to lower")
+ ("space to both")
+ ("space to")
+ ("split")
+ ("equal height group")
+ ("minimum for equal height group")
+ ("minimum for current equal height group")
+ ("use height from group")
+ ;; 4.11 Box Content Additions
+ ("before title")
+ ("after title")
+ ("before upper")
+ ("after upper")
+ ("after upper*")
+ ("before lower")
+ ("after lower")
+ ("after lower*")
+ ("text fill")
+ ("tabularx")
+ ("tabularx*")
+ ("tikz upper")
+ ("tikz lower")
+ ("tikznode upper")
+ ("tikznode lower")
+ ("tikznode")
+ ("varwidth upper")
+ ;; 4.12 Overlays
+ ("overlay")
+ ("no overlay")
+ ("overlay broken")
+ ("overlay unbroken")
+ ("overlay first")
+ ("overlay middle")
+ ("overlay last")
+ ("overlay unbroken and first")
+ ("overlay middle and last")
+ ("overlay unbroken and last")
+ ("overlay first and middle")
+ ;; 4.13 Floating Objects
+ ("floatplacement" ("htbp" "t" "b" "h" "p"))
+ ("float" ("htbp" "t" "b" "h" "p"))
+ ("float*" ("htbp" "t" "b" "h" "p"))
+ ("nofloat")
+ ("every float" ("\\centering" "\\raggedleft" "\\raggedright"))
+ ;; 4.14 Embedding into the Surroundings
+ ("before")
+ ("after")
+ ("parskip")
+ ("noparskip")
+ ("autoparskip")
+ ("nobeforeafter")
+ ("forces nobeforeafter")
+ ("baseline")
+ ("box align" ("bottom" "top" "center" "base" ))
+ ("before skip")
+ ("after skip")
+ ("beforeafter skip")
+ ("left skip")
+ ("right skip")
+ ("leftright skip")
+ ("ignore nobreak" ("true" "false"))
+ ("before nobreak")
+ ;; 4.15 Bounding Box
+ ("enlarge top initially by")
+ ("enlarge bottom finally by")
+ ("enlarge top at break by")
+ ("enlarge bottom at break by")
+ ("enlarge top by")
+ ("enlarge bottom by")
+ ("enlarge left by")
+ ("enlarge right by")
+ ("enlarge by")
+ ("flush left")
+ ("flush right")
+ ("center")
+ ("grow to left by")
+ ("grow to right by")
+ ("toggle enlargement" ("none" "forced" "evenpage"))
+ ("spread inwards")
+ ("spread outwards")
+ ("move upwards")
+ ("move upwards*")
+ ;; FIXME: This one should be added w/ `breakable' lib:
+ ;; ("fill downwards")
+ ("spread upwards")
+ ("spread upwards*")
+ ("spread sidewards")
+ ("spread")
+ ("spread downwards")
+ ("shrink tight")
+ ("extrude left by")
+ ("extrude right by")
+ ("extrude top by")
+ ("extrude bottom by")
+ ("extrude by")
+ ;; 4.16 Layered Boxes and Every Box Settings
+ ("every box")
+ ("every box on layer 1")
+ ("every box on layer 2")
+ ("every box on layer 3")
+ ("every box on layer 4")
+ ("every box on higher layers")
+ ;; 4.17 Capture Mode
+ ("capture" ("minipage" "hbox" "fitbox"))
+ ("hbox")
+ ("minipage")
+ ;; 4.18 Text Characteristics
+ ("parbox" ("true" "false"))
+ ("hyphenationfix" ("true" "false"))
+ ;; 4.19 Files
+ ("tempfile")
+ ;; 4.21 Counters, Labels, and References
+ ("phantom")
+ ("nophantom")
+ ("label")
+ ("phantomlabel")
+ ;; FIXME: Are these types documented somewhere in cleveref.pdf?
+ ("label type")
+ ("no label type")
+ ("step")
+ ("step and label")
+ ("list entry")
+ ("list text")
+ ("add to list")
+ ("nameref")
+ ;; 4.22 Even and Odd Pages
+ ("check odd page" ("true" "false"))
+ ("if odd page")
+ ("if odd page or oneside")
+ ;; FIXME: These two should be added w/ `breakable' lib:
+ ;; ("if odd page*")
+ ;; ("if odd page or oneside*")
+ ;; 4.24 Miscellaneous
+ ("reset")
+ ("only")
+ ("code")
+ ("void")
+ ;; 6 Side by Side
+ ("sidebyside" ("true" "false"))
+ ("sidebyside align" ("center" "top" "bottom" "center seam"
+ "top seam" "bottom seam"))
+ ("sidebyside gap")
+ ("lefthand width")
+ ("righthand width")
+ ("lefthand ratio")
+ ("righthand ratio")
+ ;; 8 Recording options
+ ("record")
+ ("no recording"))
+ "Key=value options for tcolorbox macros and environments.")
+
+(defvar LaTeX-tcolorbox-keyval-options-local nil
+ "Buffer-local key=value options for tcolorbox macros and environments.")
+(make-variable-buffer-local 'LaTeX-tcolorbox-keyval-options-local)
+
+(defvar LaTeX-tcolorbox-keyval-options-full nil
+ "Key=value options of tcolorbox core and all loaded libraries.")
+(make-variable-buffer-local 'LaTeX-tcolorbox-keyval-options-full)
+
+(defvar LaTeX-tcolorbox-tcbox-options
+ '(;; 4.20 \tcbox Specials
+ ("tcbox raise")
+ ("tcbox raise base")
+ ("on line")
+ ("tcbox width" ("auto" "auto limited" "forced center"
+ "forced left" "forced right" "minimum center"
+ "minimum left" "minimum right")))
+ "Key=value options only for \\tcbox and \\tcboxmath from tcolorbox.sty.")
+
+(defvar LaTeX-tcolorbox-init-options
+ '(;; 5 Initialization Option Keys
+ ;; 5.1 Numbered Boxes
+ ("auto counter")
+ ("use counter from")
+ ("use counter")
+ ("use counter*")
+ ("no counter")
+ ("number within" ("part" "chapter" "section" "subsection"))
+ ("number format" ("\\arabic" "\\roman" "\\Roman" "\\Alph" "\\alph"))
+ ("number freestyle")
+ ("crefname")
+ ("Crefname")
+ ("blend into" ("figures" "tables" "listings"))
+ ("blend before title" ("colon" "dash" "colon hang" "dash hang"))
+ ("blend before title code")
+ ;; 5.2 Lists of tcolorboxes
+ ("list inside")
+ ("list type"))
+ "Initialization key=value options for tcolorbox macros.")
+
+(defvar LaTeX-tcolorbox-library-list
+ '("skins"
+ "vignette"
+ "raster"
+ "listings"
+ "listingsutf8"
+ "minted"
+ "theorems"
+ "breakable"
+ "magazine"
+ "fitting"
+ "hooks"
+ "xparse"
+ "external"
+ "documentation"
+ "many" "most" "all")
+ "List with libraries provided by tcolorbox package.")
+
+;; Setup for \newtcolorbox:
+(TeX-auto-add-type "tcolorbox-newtcolorbox" "LaTeX" "tcolorbox-newtcolorboxes")
+
+(defvar LaTeX-tcolorbox-newtcolorbox-regexp
+ `(,(concat "\\\\\\(re\\)?newtcolorbox"
+ "[ \t\n\r%]*"
+ "\\(?:\\[[^][]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*}[^}{]*\\)*"
+ "}[^}{]*\\)*"
+ "}[^][]*\\)*"
+ "\\]\\)?"
+ "[ \t\n\r%]*"
+ "{\\([a-zA-Z0-9]+\\)}"
+ "[ \t\n\r%]*"
+ "\\(?:\\[\\([0-9]*\\)\\]\\)?"
+ "[ \t\n\r%]*"
+ "\\(\\[\\)?")
+ (2 3 4 1) LaTeX-auto-tcolorbox-newtcolorbox)
+ "Matches the arguments of \\newtcolorbox from tcolorbox package.")
+
+;; Setup for \newtcbox:
+(TeX-auto-add-type "tcolorbox-newtcbox" "LaTeX" "tcolorbox-newtcboxes")
+
+(defvar LaTeX-tcolorbox-newtcbox-regexp
+ `(,(concat "\\\\\\(re\\)?newtcbox"
+ "[ \t\n\r%]*"
+ "\\(?:\\[[^][]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*"
+ "\\(?:{[^}{]*}[^}{]*\\)*"
+ "}[^}{]*\\)*"
+ "}[^][]*\\)*"
+ "\\]\\)?"
+ "[ \t\n\r%]*"
+ "{\\\\\\([a-zA-Z]+\\)}"
+ "[ \t\n\r%]*"
+ "\\(?:\\[\\([0-9]*\\)\\]\\)?"
+ "[ \t\n\r%]*"
+ "\\(\\[\\)?")
+ (2 3 4 1) LaTeX-auto-tcolorbox-newtcbox)
+ "Matches the arguments of \\newtcbox from tcolorbox package.")
+
+;; Setup for \tcbuselibrary:
+(TeX-auto-add-type "tcolorbox-tcbuselibrary" "LaTeX" "tcbuselibraries")
+
+(defvar LaTeX-tcolorbox-tcbuselibrary-regexp
+ '("\\\\tcbuselibrary{\\([^}]+\\)}"
+ 1 LaTeX-auto-tcolorbox-tcbuselibrary)
+ "Matches the arguments of \\tcbuselibrary from tcolorbox package.")
+
+(defun LaTeX-tcolorbox-load-used-libraries ()
+ "Check which tcolorbox libraries are loaded and run respective style hooks.
+This functions checks the arguments of \\tcbuselibrary and the
+name of libraries given in the optional argument of \\usepackage
+call for tcolorbox and runs the style hook for them. The file
+for style must have the prefix \"tcolorboxlib-\" in the name,
+e.g. \"tcolorboxlib-raster.el\"."
+ (when (LaTeX-tcolorbox-tcbuselibrary-list)
+ (let (libs)
+ (dolist (x (LaTeX-tcolorbox-tcbuselibrary-list))
+ (push (TeX-replace-regexp-in-string "[ %\n\r\t]" "" (car x)) libs))
+ (setq libs (mapconcat #'identity libs ","))
+ (dolist (x (split-string libs "," t))
+ (TeX-run-style-hooks (concat "tcolorboxlib-" x)))))
+ (when (assoc "tcolorbox" LaTeX-provided-package-options)
+ (let ((opts (cdr (assoc "tcolorbox" LaTeX-provided-package-options))))
+ (dolist (x opts)
+ (when (member x LaTeX-tcolorbox-library-list)
+ (TeX-run-style-hooks (concat "tcolorboxlib-" x)))))))
+
+(defun LaTeX-tcolorbox-update-style-key ()
+ "Update some key=values in `LaTeX-tcolorbox-keyval-options-local'."
+ ;; Update the key=values for coloring.
+ (let* ((keys '("colframe"
+ "colback"
+ "colbacktitle"
+ "colupper"
+ "collower"
+ "coltext"
+ "coltitle"))
+ (tmp (copy-alist LaTeX-tcolorbox-keyval-options-local)))
+ (dolist (key keys)
+ (setq tmp (assq-delete-all (car (assoc key tmp)) tmp))
+ (pushnew
+ (list key (mapcar #'car (LaTeX-xcolor-definecolor-list))) tmp :test #'equal))
+ (setq LaTeX-tcolorbox-keyval-options-local (copy-alist tmp)))
+ (setq LaTeX-tcolorbox-keyval-options-full
+ (copy-alist LaTeX-tcolorbox-keyval-options-local)))
+
+(defun LaTeX-tcolorbox-auto-prepare ()
+ "Clear various LaTeX-tcolorbox-* variables before parsing."
+ (setq LaTeX-auto-tcolorbox-newtcolorbox nil
+ LaTeX-auto-tcolorbox-newtcbox nil
+ LaTeX-auto-tcolorbox-tcbuselibrary nil))
+
+(defun LaTeX-tcolorbox-auto-cleanup ()
+ "Process parsed results."
+ ;; Process new env's from \newtcolorbox
+ (dolist (newtcbox (apply #'append LaTeX-tcolorbox-newtcolorbox-list))
+ (let ((box (nth 0 newtcbox))
+ (arg (nth 1 newtcbox))
+ (opt (nth 2 newtcbox))
+ (renew (when (string= (nth 3 newtcbox) "re")
+ (nth 3 newtcbox))))
+ ;; When renew'ing, delete any entry from
+ ;; `LaTeX-environment-list' first:
+ (when renew
+ (setq LaTeX-environment-list
+ (assq-delete-all
+ (car (assoc box (LaTeX-environment-list)))
+ LaTeX-environment-list)))
+ (cond (;; opt. 1st argument and mandatory argument(s)
+ (and arg (not (string= arg ""))
+ opt (not (string= opt "")))
+ (LaTeX-add-environments
+ (list box
+ 'LaTeX-env-args
+ (vector 'TeX-arg-key-val 'LaTeX-tcolorbox-keyval-options-local)
+ (1- (string-to-number arg)))))
+ (;; mandatory argument(s) only
+ (and arg (not (string= arg ""))
+ (string-equal opt ""))
+ (LaTeX-add-environments
+ (list box (string-to-number arg))))
+ (t ; No args
+ (LaTeX-add-environments (list box))))))
+ ;;
+ ;; Process new macros from \newtcbox
+ (dolist (newtcbox (apply #'append LaTeX-tcolorbox-newtcbox-list))
+ (let ((box (nth 0 newtcbox))
+ (arg (nth 1 newtcbox))
+ (opt (nth 2 newtcbox))
+ (renew (when (string= (nth 3 newtcbox) "re")
+ (nth 3 newtcbox))))
+ ;; When renew'ing, delete any entry from `TeX-symbol-list'
+ ;; first:
+ (when renew
+ (setq TeX-symbol-list
+ (assq-delete-all
+ (car (assoc box (TeX-symbol-list)))
+ TeX-symbol-list)))
+ (cond (;; opt. 1st argument and mandatory argument(s)
+ (and arg (not (string= arg ""))
+ opt (not (string= opt "")))
+ (TeX-add-symbols (list box
+ (vector 'TeX-arg-key-val 'LaTeX-tcolorbox-keyval-options-local)
+ (1- (string-to-number arg)))))
+ (;; mandatory argument(s) only
+ (and arg (not (string= arg ""))
+ (string-equal opt ""))
+ (TeX-add-symbols (list box (string-to-number arg))))
+ (t ; No args -- in pratice, this will probably never happen
+ (TeX-add-symbols (list box))))))
+ ;;
+ ;; Update key=vals
+ (LaTeX-tcolorbox-update-style-key)
+ ;;
+ ;; Load style hooks for libraries, if any.
+ (LaTeX-tcolorbox-load-used-libraries))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-tcolorbox-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-tcolorbox-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "tcolorbox"
+ (lambda ()
+
+ ;; Activate the buffer-local version of key-vals.
+ (setq LaTeX-tcolorbox-keyval-options-local
+ (copy-alist LaTeX-tcolorbox-keyval-options))
+
+ ;; Collect key=val's from libraries in
+ ;; `LaTeX-tcolorbox-keyval-options-full'; \tcbset needs this:
+ (setq LaTeX-tcolorbox-keyval-options-full
+ (copy-alist LaTeX-tcolorbox-keyval-options-local))
+
+ ;; Add tcolorbox to the parser.
+ (TeX-auto-add-regexp LaTeX-tcolorbox-newtcolorbox-regexp)
+ (TeX-auto-add-regexp LaTeX-tcolorbox-newtcbox-regexp)
+ (TeX-auto-add-regexp LaTeX-tcolorbox-tcbuselibrary-regexp)
+
+ ;; We just run the style hook for `xcolor' which is loaded by pgf.sty
+ (TeX-run-style-hooks "xcolor")
+
+ ;; FIXME: Anything missing?
+ (TeX-add-symbols
+
+ ;; 1.3 Libraries
+ '("tcbuselibrary"
+ (TeX-arg-eval mapconcat #'identity
+ (TeX-completing-read-multiple
+ (TeX-argument-prompt optional nil "Libraries")
+ LaTeX-tcolorbox-library-list) ","))
+
+ ;; 3 Macros for Box Creation
+ '("tcblower" 0)
+
+ '("tcbset"
+ (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-full))
+
+ '("tcbsetforeverylayer"
+ (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+ '("tcbox"
+ [ TeX-arg-eval TeX-read-key-val optional
+ (append
+ LaTeX-tcolorbox-tcbox-options
+ LaTeX-tcolorbox-keyval-options-local) ]
+ t)
+
+ '("newtcolorbox"
+ [ TeX-arg-key-val LaTeX-tcolorbox-init-options ]
+ "Name"
+ [ TeX-arg-define-macro-arguments ]
+ (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+ '("renewtcolorbox"
+ [ TeX-arg-key-val LaTeX-tcolorbox-init-options ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color box")
+ (LaTeX-tcolorbox-newtcolorbox-list))
+ [ TeX-arg-define-macro-arguments ]
+ (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+ '("newtcbox"
+ [ TeX-arg-key-val LaTeX-tcolorbox-init-options ]
+ TeX-arg-macro
+ [ TeX-arg-define-macro-arguments ]
+ (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+ '("renewtcbox"
+ [ TeX-arg-key-val LaTeX-tcolorbox-init-options ]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((macro (completing-read
+ (TeX-argument-prompt optional nil "Macro: \\" t)
+ (LaTeX-tcolorbox-newtcbox-list))))
+ (concat TeX-esc macro))))
+ [ TeX-arg-define-macro-arguments ]
+ (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+ '("tcolorboxenvironment"
+ TeX-arg-environment
+ (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+ ;; 4.16 Layered Boxes and Every Box Settings
+ '("tcbsetmanagedlayer" "Number")
+
+ ;; 4.22 Even and Odd Pages
+ '("tcbifoddpage" 2)
+ '("tcbifoddpageoroneside" 2)
+ '("thetcolorboxnumber" 0)
+ '("thetcolorboxpage" 0)
+
+ ;; 5.2 Lists of tcolorboxes
+ '("tcblistof"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Macro")
+ (if (< (LaTeX-largest-level) 2)
+ '("\\chapter" "\\section" "\\subsection" "\\subsubsection")
+ '("\\section" "\\subsection" "\\subsubsection")) ]
+ 2)
+
+ ;; 7 Saving and Loading of Verbatim Texts
+ '("tcbusetemp")
+
+ ;; 8 Recording
+ '("tcbstartrecording" [ "File name" ])
+ '("tcbstoprecording")
+ '("tcbrecord" t)
+ '("tcbinputrecords" [ TeX-arg-file ]) ) ; Terminate TeX-add-symbols
+
+ (LaTeX-add-environments
+ ;; 3 Macros for Box Creation: Main env
+ '("tcolorbox" LaTeX-env-args
+ [ TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local ])
+
+ ;; 7 Saving and Loading of Verbatim Texts
+ '("tcbverbatimwrite" "File name")
+ '("tcbwritetemp"))
+
+ ;; Do not indent text in verbatim environments:
+ (make-local-variable 'LaTeX-indent-environment-list)
+ (add-to-list 'LaTeX-indent-environment-list
+ '("tcbverbatimwrite" current-indentation) t)
+ (add-to-list 'LaTeX-indent-environment-list
+ '("tcbwritetemp" current-indentation) t)
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("tcbuselibrary" "{")
+ ("tcbset" "{")
+ ("tcbsetforeverylayer" "{")
+ ("tcbox" "[{")
+ ("newtcolorbox" "[{[[{")
+ ("renewtcolorbox" "[{[[{")
+ ("newtcbox" "[{[[{")
+ ("renewtcbox" "[{[[{")
+ ("tcolorboxenvironment" "{{")
+ ("tcbsetmanagedlayer" "{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-tcolorbox-package-options LaTeX-tcolorbox-library-list
+ "Package options for the tcolorbox package.")
+
+;;; tcolorbox.el ends here
--- /dev/null
+;;; tcolorboxlib-raster.el --- AUCTeX style for `raster' library from tcolorbox
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; 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 `raster' library from tcolorbox.sty.
+
+;;; Code:
+
+(defvar LaTeX-tcolorbox-lib-raster-keyval-options
+ '(;; 14.3 Option Keys of the Library
+ ("raster columns")
+ ("raster rows")
+ ("raster width")
+ ("raster height")
+ ("raster before skip")
+ ("raster after skip")
+ ("raster equal skip")
+ ("raster left skip")
+ ("raster right skip")
+ ("raster column skip")
+ ("raster row skip")
+ ("raster halign" ("left" "center" "right"))
+ ("raster valign" ("top" "center" "bottom"))
+ ("raster equal height" ("noe" "rows" "all"))
+ ("raster equal height group")
+ ("raster force size" ("true" "false"))
+ ("raster reset")
+ ;; 14.4 Adding Styles for Specific Boxes
+ ("raster every box")
+ ("raster odd column")
+ ("raster even column")
+ ("raster column 1")
+ ("raster column 2")
+ ("raster column 3")
+ ("raster column 4")
+ ("raster odd row")
+ ("raster even row")
+ ("raster row 1")
+ ("raster row 2")
+ ("raster row 3")
+ ("raster row 4")
+ ("raster odd number")
+ ("raster even number")
+ ;; raster row m column n is left to user
+ ("raster number 1")
+ ("raster number 2")
+ ("raster number 3")
+ ("raster number 4")
+ ;; 14.5 Combining Columns or Rows
+ ("raster multicolumn")
+ ("raster multirow"))
+ "Key=value options for raster library from tcolorbox.")
+
+(defun LaTeX-tcolorbox-lib-raster-env-item (environment)
+ "Insert ENVIRONMENT, ask for arguments and the first item."
+ (LaTeX-insert-environment
+ environment
+ (let ((opts (TeX-read-key-val t (append
+ LaTeX-tcolorbox-lib-raster-keyval-options
+ LaTeX-tcolorbox-keyval-options-local)
+ (when (string= environment "tcboxeditemize")
+ "Raster options (k=v)")))
+ (box-opts (when (string= environment "tcboxeditemize")
+ (TeX-read-key-val nil LaTeX-tcolorbox-keyval-options-local
+ "Box options (k=v)"))))
+ (concat
+ (when (and opts (not (string= opts "")))
+ (format "[%s]" opts))
+ (when (string= environment "tcboxeditemize")
+ (format "{%s}" box-opts)))))
+ (if (TeX-active-mark)
+ (progn
+ (LaTeX-find-matching-begin)
+ (end-of-line 1))
+ (end-of-line 0))
+ (delete-char 1)
+ (when (looking-at (concat "^[ \t]+$\\|"
+ "^[ \t]*" TeX-comment-start-regexp "+[ \t]*$"))
+ (delete-region (point) (line-end-position)))
+ (delete-horizontal-space)
+ ;; Deactivate the mark here in order to prevent `TeX-parse-macro'
+ ;; from swapping point and mark and the \item ending up right after
+ ;; \begin{...}.
+ (TeX-deactivate-mark)
+ (LaTeX-insert-item)
+ ;; The inserted \item may have outdented the first line to the
+ ;; right. Fill it, if appropriate.
+ (when (and (not (looking-at "$"))
+ (not (assoc environment LaTeX-indent-environment-list))
+ (> (- (line-end-position) (line-beginning-position))
+ (current-fill-column)))
+ (LaTeX-fill-paragraph nil)))
+
+(defun LaTeX-tcolorbox-lib-raster-insert-item ()
+ "Insert \"tcbitem\" and query for optional argument."
+ (TeX-insert-macro "tcbitem"))
+
+(TeX-add-style-hook
+ "tcolorboxlib-raster"
+ (lambda ()
+
+ ;; Append key-vals from library to `LaTeX-tcolorbox-keyval-options-full':
+ (setq LaTeX-tcolorbox-keyval-options-full
+ (append LaTeX-tcolorbox-lib-raster-keyval-options
+ LaTeX-tcolorbox-keyval-options-full))
+
+ (TeX-add-symbols
+ ;; 14.2 Macros of the Library
+ '("tcbitem"
+ [ TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local "Item options (k=v)" ]
+ (TeX-arg-literal " ")))
+
+ (LaTeX-add-environments
+ ;; 14.2 Macros of the Library
+ '("tcbraster"
+ (lambda (env)
+ (LaTeX-insert-environment
+ env
+ (let ((raster-opts
+ (TeX-read-key-val t (append
+ LaTeX-tcolorbox-lib-raster-keyval-options
+ LaTeX-tcolorbox-keyval-options-local))))
+ (when (and raster-opts (not (string= raster-opts "")))
+ (concat LaTeX-optop raster-opts LaTeX-optcl))))))
+
+ '("tcbitemize" LaTeX-tcolorbox-lib-raster-env-item)
+
+ '("tcboxedraster"
+ (lambda (env)
+ (LaTeX-insert-environment
+ env
+ (let ((raster-opts
+ (TeX-read-key-val t (append
+ LaTeX-tcolorbox-lib-raster-keyval-options
+ LaTeX-tcolorbox-keyval-options-local)
+ "Raster options (k=v)"))
+ (box-opts
+ (TeX-read-key-val nil LaTeX-tcolorbox-keyval-options-local
+ "Box options (k=v)")))
+ (concat
+ (when (and raster-opts (not (string= raster-opts "")))
+ (concat LaTeX-optop raster-opts LaTeX-optcl))
+ TeX-grop box-opts TeX-grcl)))))
+
+ '("tcboxeditemize" LaTeX-tcolorbox-lib-raster-env-item))
+
+ ;; Append tcb(oxed)?itemize to `LaTeX-item-list':
+ (add-to-list 'LaTeX-item-list
+ '("tcbitemize" . LaTeX-tcolorbox-lib-raster-insert-item) t)
+ (add-to-list 'LaTeX-item-list
+ '("tcboxeditemize" . LaTeX-tcolorbox-lib-raster-insert-item) t)
+
+ ;; Append tcbitem to `LaTeX-item-regexp':
+ (unless (string-match "tcbitem" LaTeX-item-regexp)
+ (set (make-local-variable 'LaTeX-item-regexp)
+ (concat
+ LaTeX-item-regexp
+ "\\|"
+ "tcbitem\\b"))
+ (LaTeX-set-paragraph-start))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("tcbitem" "["))
+ 'textual)))
+ LaTeX-dialect)
+
+;;; tcolorboxlib-raster.el ends here
--- /dev/null
+;;; textcomp.el --- AUCTeX style for `textcomp.sty' (v1.99g)
+
+;; Copyright (C) 2014, 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-10-25
+;; 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 `textcomp.sty' (v1.99g) from 2005/09/27.
+;; `textcomp.sty' is a standard LaTeX package and part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "textcomp"
+ (lambda ()
+ (TeX-add-symbols
+ '("capitalgrave" 0) ; Type: Accent -- Slot: 0
+ '("capitalacute" 0) ; Type: Accent -- Slot: 1
+ '("capitalcircumflex" 0) ; Type: Accent -- Slot: 2
+ '("capitaltilde" 0) ; Type: Accent -- Slot: 3
+ '("capitaldieresis" 0) ; Type: Accent -- Slot: 4
+ '("capitalhungarumlaut" 0) ; Type: Accent -- Slot: 5
+ '("capitalring" 0) ; Type: Accent -- Slot: 6
+ '("capitalcaron" 0) ; Type: Accent -- Slot: 7
+ '("capitalbreve" 0) ; Type: Accent -- Slot: 8
+ '("capitalmacron" 0) ; Type: Accent -- Slot: 9
+ '("capitaldotaccent" 0) ; Type: Accent -- Slot: 10
+ '("t" 0) ; Type: Accent -- Slot: 26
+ '("capitaltie" 0) ; Type: Accent -- Slot: 27
+ '("newtie" 0) ; Type: Accent -- Slot: 28
+ '("capitalnewtie" 0) ; Type: Accent -- Slot: 29
+ '("textcapitalcompwordmark" 0) ; Type: Symbol -- Slot: 23
+ '("textascendercompwordmark" 0) ; Type: Symbol -- Slot: 31
+ '("textquotestraightbase" 0) ; Type: Symbol -- Slot: 13
+ '("textquotestraightdblbase" 0) ; Type: Symbol -- Slot: 18
+ '("texttwelveudash" 0) ; Type: Symbol -- Slot: 21
+ '("textthreequartersemdash" 0) ; Type: Symbol -- Slot: 22
+ '("textleftarrow" 0) ; Type: Symbol -- Slot: 24
+ '("textrightarrow" 0) ; Type: Symbol -- Slot: 25
+ '("textblank" 0) ; Type: Symbol -- Slot: 32
+ '("textdollar" 0) ; Type: Symbol -- Slot: 36
+ '("textquotesingle" 0) ; Type: Symbol -- Slot: 39
+ '("textasteriskcentered" 0) ; Type: Symbol -- Slot: 42
+ '("textdblhyphen" 0) ; Type: Symbol -- Slot: 45
+ '("textfractionsolidus" 0) ; Type: Symbol -- Slot: 47
+ '("textzerooldstyle" 0) ; Type: Symbol -- Slot: 48
+ '("textoneoldstyle" 0) ; Type: Symbol -- Slot: 49
+ '("texttwooldstyle" 0) ; Type: Symbol -- Slot: 50
+ '("textthreeoldstyle" 0) ; Type: Symbol -- Slot: 51
+ '("textfouroldstyle" 0) ; Type: Symbol -- Slot: 52
+ '("textfiveoldstyle" 0) ; Type: Symbol -- Slot: 53
+ '("textsixoldstyle" 0) ; Type: Symbol -- Slot: 54
+ '("textsevenoldstyle" 0) ; Type: Symbol -- Slot: 55
+ '("texteightoldstyle" 0) ; Type: Symbol -- Slot: 56
+ '("textnineoldstyle" 0) ; Type: Symbol -- Slot: 57
+ '("textlangle" 0) ; Type: Symbol -- Slot: 60
+ '("textminus" 0) ; Type: Symbol -- Slot: 61
+ '("textrangle" 0) ; Type: Symbol -- Slot: 62
+ '("textmho" 0) ; Type: Symbol -- Slot: 77
+ '("textbigcircle" 0) ; Type: Symbol -- Slot: 79
+ '("textohm" 0) ; Type: Symbol -- Slot: 87
+ '("textlbrackdbl" 0) ; Type: Symbol -- Slot: 91
+ '("textrbrackdbl" 0) ; Type: Symbol -- Slot: 93
+ '("textuparrow" 0) ; Type: Symbol -- Slot: 94
+ '("textdownarrow" 0) ; Type: Symbol -- Slot: 95
+ '("textasciigrave" 0) ; Type: Symbol -- Slot: 96
+ '("textborn" 0) ; Type: Symbol -- Slot: 98
+ '("textdivorced" 0) ; Type: Symbol -- Slot: 99
+ '("textdied" 0) ; Type: Symbol -- Slot: 100
+ '("textleaf" 0) ; Type: Symbol -- Slot: 108
+ '("textmarried" 0) ; Type: Symbol -- Slot: 109
+ '("textmusicalnote" 0) ; Type: Symbol -- Slot: 110
+ '("texttildelow" 0) ; Type: Symbol -- Slot: 126
+ '("textdblhyphenchar" 0) ; Type: Symbol -- Slot: 127
+ '("textasciibreve" 0) ; Type: Symbol -- Slot: 128
+ '("textasciicaron" 0) ; Type: Symbol -- Slot: 129
+ '("textacutedbl" 0) ; Type: Symbol -- Slot: 130
+ '("textgravedbl" 0) ; Type: Symbol -- Slot: 131
+ '("textdagger" 0) ; Type: Symbol -- Slot: 132
+ '("textdaggerdbl" 0) ; Type: Symbol -- Slot: 133
+ '("textbardbl" 0) ; Type: Symbol -- Slot: 134
+ '("textperthousand" 0) ; Type: Symbol -- Slot: 135
+ '("textbullet" 0) ; Type: Symbol -- Slot: 136
+ '("textcelsius" 0) ; Type: Symbol -- Slot: 137
+ '("textdollaroldstyle" 0) ; Type: Symbol -- Slot: 138
+ '("textcentoldstyle" 0) ; Type: Symbol -- Slot: 139
+ '("textflorin" 0) ; Type: Symbol -- Slot: 140
+ '("textcolonmonetary" 0) ; Type: Symbol -- Slot: 141
+ '("textwon" 0) ; Type: Symbol -- Slot: 142
+ '("textnaira" 0) ; Type: Symbol -- Slot: 143
+ '("textguarani" 0) ; Type: Symbol -- Slot: 144
+ '("textpeso" 0) ; Type: Symbol -- Slot: 145
+ '("textlira" 0) ; Type: Symbol -- Slot: 146
+ '("textrecipe" 0) ; Type: Symbol -- Slot: 147
+ '("textinterrobang" 0) ; Type: Symbol -- Slot: 148
+ '("textinterrobangdown" 0) ; Type: Symbol -- Slot: 149
+ '("textdong" 0) ; Type: Symbol -- Slot: 150
+ '("texttrademark" 0) ; Type: Symbol -- Slot: 151
+ '("textpertenthousand" 0) ; Type: Symbol -- Slot: 152
+ '("textpilcrow" 0) ; Type: Symbol -- Slot: 153
+ '("textbaht" 0) ; Type: Symbol -- Slot: 154
+ '("textnumero" 0) ; Type: Symbol -- Slot: 155
+ '("textdiscount" 0) ; Type: Symbol -- Slot: 156
+ '("textestimated" 0) ; Type: Symbol -- Slot: 157
+ '("textopenbullet" 0) ; Type: Symbol -- Slot: 158
+ '("textservicemark" 0) ; Type: Symbol -- Slot: 159
+ '("textlquill" 0) ; Type: Symbol -- Slot: 160
+ '("textrquill" 0) ; Type: Symbol -- Slot: 161
+ '("textcent" 0) ; Type: Symbol -- Slot: 162
+ '("textsterling" 0) ; Type: Symbol -- Slot: 163
+ '("textcurrency" 0) ; Type: Symbol -- Slot: 164
+ '("textyen" 0) ; Type: Symbol -- Slot: 165
+ '("textbrokenbar" 0) ; Type: Symbol -- Slot: 166
+ '("textsection" 0) ; Type: Symbol -- Slot: 167
+ '("textasciidieresis" 0) ; Type: Symbol -- Slot: 168
+ '("textcopyright" 0) ; Type: Symbol -- Slot: 169
+ '("textordfeminine" 0) ; Type: Symbol -- Slot: 170
+ '("textcopyleft" 0) ; Type: Symbol -- Slot: 171
+ '("textlnot" 0) ; Type: Symbol -- Slot: 172
+ '("textcircledP" 0) ; Type: Symbol -- Slot: 173
+ '("textregistered" 0) ; Type: Symbol -- Slot: 174
+ '("textasciimacron" 0) ; Type: Symbol -- Slot: 175
+ '("textdegree" 0) ; Type: Symbol -- Slot: 176
+ '("textpm" 0) ; Type: Symbol -- Slot: 177
+ '("texttwosuperior" 0) ; Type: Symbol -- Slot: 178
+ '("textthreesuperior" 0) ; Type: Symbol -- Slot: 179
+ '("textasciiacute" 0) ; Type: Symbol -- Slot: 180
+ '("textmu" 0) ; Type: Symbol -- Slot: 181
+ '("textparagraph" 0) ; Type: Symbol -- Slot: 182
+ '("textperiodcentered" 0) ; Type: Symbol -- Slot: 183
+ '("textreferencemark" 0) ; Type: Symbol -- Slot: 184
+ '("textonesuperior" 0) ; Type: Symbol -- Slot: 185
+ '("textordmasculine" 0) ; Type: Symbol -- Slot: 186
+ '("textsurd" 0) ; Type: Symbol -- Slot: 187
+ '("textonequarter" 0) ; Type: Symbol -- Slot: 188
+ '("textonehalf" 0) ; Type: Symbol -- Slot: 189
+ '("textthreequarters" 0) ; Type: Symbol -- Slot: 190
+ '("texteuro" 0) ; Type: Symbol -- Slot: 191
+ '("texttimes" 0) ; Type: Symbol -- Slot: 214
+ '("textdiv" 0) ; Type: Symbol -- Slot: 246
+ '("textcircled" 1) ; Type: Command -- Slot: N/A
+ '("capitalcedilla" 1) ; Type: Command -- Slot: N/A
+ '("capitalogonek" 1))) ; Type: Command -- Slot: N/A
+ LaTeX-dialect)
+
+(defvar LaTeX-textcomp-package-options
+ '("full" "almostfull" "euro" "safe" "force" "warn")
+ "Package options for the textcomp package.")
+
+;;; textcomp.el ends here
--- /dev/null
+;;; textpos.el --- AUCTeX style for `textpos.sty' version v1.7j
+
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-07-04
+;; 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 `textpos.sty' version v1.7j from
+;; 2014/01/03. `textpos.sty' is part of TeXLive.
+
+;;; Code:
+
+(defun LaTeX-env-arg-textpos-textblock (env)
+ "Query for the arguments of `textblock' environment and insert
+them."
+ (let* ((hsize (TeX-read-string "Width: "))
+ (ho (TeX-read-string "(Optional) X reference point: "))
+ (vo (when (not (string-equal ho ""))
+ (TeX-read-string "Y reference point: ")))
+ (hpos (TeX-read-string "X placement point: "))
+ (vpos (TeX-read-string "Y placement point: ")))
+ (LaTeX-insert-environment
+ env
+ (concat
+ (when (and hsize (not (string-equal hsize "")))
+ (format "{%s}" hsize))
+ (when (and ho (not (string-equal ho ""))
+ vo (not (string-equal vo "")))
+ (format "[%s,%s]" ho vo))
+ (when (and hpos (not (string-equal hpos ""))
+ vpos (not (string-equal vpos "")))
+ (format "(%s,%s)" hpos vpos))))))
+
+(defun LaTeX-arg-textpos-tpgrid (optional)
+ "Query and insert the optional argument of `\\TPGrid'."
+ (let* ((x (TeX-read-string "(Optional) X start coordinate: "))
+ (y (when (not (string-equal x ""))
+ (TeX-read-string "Y start coordinate: "))))
+ (when (and (not (string-equal x ""))
+ (not (string-equal y "")))
+ (TeX-argument-insert (format "%s,%s" x y) optional))))
+
+(TeX-add-style-hook
+ "textpos"
+ (lambda ()
+
+ (TeX-run-style-hooks "everyshi")
+
+ (LaTeX-add-environments
+ ;; \begin{textblock}{<hsize>}[<ho>,<vo>](<hpos>,<vpos>) ... \end{textblock}
+ '("textblock" LaTeX-env-arg-textpos-textblock)
+ '("textblock*" LaTeX-env-arg-textpos-textblock))
+
+ (TeX-add-symbols
+ '("TPGrid" [ LaTeX-arg-textpos-tpgrid ]
+ "Horizontal fraction" "Vertical fraction")
+
+ '("TPMargin" (TeX-arg-length "Margin around textblock"))
+ '("TPMargin*" (TeX-arg-length "Margin around textblock"))
+
+ ;; We ignore the `\textblock...color' (i.e. without `u') versions
+ '("textblockcolour"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((color (cond ((member "xcolor" (TeX-style-list))
+ (completing-read "Color name: " (LaTeX-xcolor-definecolor-list)))
+ ((member "color" (TeX-style-list))
+ (completing-read "Color name: " (LaTeX-color-definecolor-list)))
+ (t
+ (TeX-read-string "Color name: ")))))
+ (format "%s" color)))))
+
+ '("textblockrulecolour"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((color (cond ((member "xcolor" (TeX-style-list))
+ (completing-read "Color name: " (LaTeX-xcolor-definecolor-list)))
+ ((member "color" (TeX-style-list))
+ (completing-read "Color name: " (LaTeX-color-definecolor-list)))
+ (t
+ (TeX-read-string "Color name: ")))))
+ (format "%s" color)))))
+
+ '("TPshowboxestrue")
+ '("TPshowboxesfalse")
+
+ '("textblocklabel" t)
+ '("textblockorigin" "Horizontal position" "Vertical position"))
+
+ ;; Add the lengths defined by textpos.sty
+ (LaTeX-add-lengths "TPHorizModule" "TPVertModule" "TPboxrulesize"))
+ LaTeX-dialect)
+
+(defvar LaTeX-textpos-package-options
+ '("showboxes" "noshowtext" "absolute" "overlay" "verbose" "quiet")
+ "Package options for the textpos package.")
+
+;;; textpos.el ends here
--- /dev/null
+;;; theorem.el --- AUCTeX style for `theorem.sty' (v2.2c)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-10-31
+;; 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 `theorem.sty' (v2.2c) from 2014/10/28.
+;; `theorem.sty' is a standard LaTeX package and part of TeXLive.
+
+;; The style provides the function `LaTeX-theorem-env-label' which
+;; enables new defined environments with "\newtheoreom" to interact
+;; with AUCTeX and RefTeX mechanisms for inserting labels. Check
+;; docstring of `LaTeX-theorem-env-label' for instructions.
+
+;;; Code:
+
+(defvar LaTeX-theorem-theoremstyle-list
+ '(("plain") ("break") ("margin") ("change")
+ ("marginbreak") ("changebreak"))
+ "List of theorem styles provided by `theorem.sty'.")
+
+(defvar LaTeX-theorem-fontdecl
+ '(;; family
+ "rmfamily" "sffamily" "ttfamily"
+ ;; series
+ "mdseries" "bfseries"
+ ;; shape
+ "upshape" "itshape" "slshape" "scshape"
+ ;; size
+ "tiny" "scriptsize" "footnotesize"
+ "small" "normalsize" "large"
+ "Large" "LARGE" "huge" "Huge"
+ ;; reset macro
+ "normalfont")
+ "List of font declaration commands for \"\\theorem(body\|header)font\".")
+
+(defun LaTeX-arg-theorem-fontdecl (optional &optional prompt)
+ "Prompt for font declaration commands in \"\\theorem(body\|header)font\".
+If OPTIONAL is non-nil, insert the resulting value as an optional
+argument. Use PROMPT as the prompt string."
+ ;; `INITIAL-INPUT' (5th argument to `TeX-completing-read-multiple')
+ ;; is hard-coded to `TeX-esc'.
+ (let* ((crm-separator (regexp-quote TeX-esc))
+ (fontdecl (mapconcat 'identity
+ (TeX-completing-read-multiple
+ (TeX-argument-prompt optional prompt "Font")
+ LaTeX-theorem-fontdecl nil nil TeX-esc)
+ TeX-esc)))
+ (TeX-argument-insert fontdecl optional)))
+
+(defun LaTeX-theorem-env-label (environment)
+ "Insert ENVIRONMENT, query for an optional argument and prompt
+for label. AUCTeX users should add ENVIRONMENT to
+`LaTeX-label-alist' via customize or in init-file with:
+
+ (add-to-list \\='LaTeX-label-alist \\='(\"lemma\" . \"lem:\"))
+
+RefTeX users should customize or add ENVIRONMENT to
+`LaTeX-label-alist' and `reftex-label-alist', e.g.
+
+ (add-to-list \\='LaTeX-label-alist \\='(\"lemma\" . \"lem:\"))
+ (add-to-list \\='reftex-label-alist
+ \\='(\"lemma\" ?m \"lem:\" \"~\\ref{%s}\"
+ nil (\"Lemma\" \"lemma\") nil))"
+ (let ((opthead (TeX-read-string
+ (TeX-argument-prompt t nil "Heading"))))
+ (LaTeX-insert-environment environment
+ (when (and opthead
+ (not (string= opthead "")))
+ (format "[%s]" opthead))))
+ (when (LaTeX-label environment 'environment)
+ (LaTeX-newline)
+ (indent-according-to-mode)))
+
+;; Needed for auto-parsing
+(require 'tex)
+
+;; Setup parsing for \newtheorem
+(TeX-auto-add-type "theorem-newtheorem" "LaTeX")
+
+(defun LaTeX-theorem-auto-prepare ()
+ "Clear `LaTeX-auto-theorem-newtheorem' before parsing."
+ (setq LaTeX-auto-theorem-newtheorem nil))
+
+(defun LaTeX-theorem-auto-cleanup ()
+ "Move parsed results from `LaTeX-auto-theorem-newtheorem' and
+make them available as new environments."
+ (dolist (newthm (mapcar 'car (LaTeX-theorem-newtheorem-list)))
+ (LaTeX-add-environments (list newthm 'LaTeX-theorem-env-label))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-theorem-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-theorem-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "theorem"
+ (lambda ()
+
+ (TeX-auto-add-regexp
+ `(,(concat "\\\\newtheorem{\\(" TeX-token-char "+\\)}")
+ 1 LaTeX-auto-theorem-newtheorem))
+
+ (TeX-add-symbols
+ ;; Overrule the defintion in `latex.el':
+ '("newtheorem"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((nthm (TeX-read-string
+ (TeX-argument-prompt nil nil "Environment"))))
+ (LaTeX-add-theorem-newtheorems nthm)
+ (LaTeX-add-environments (list nthm 'LaTeX-theorem-env-label))
+ (format "%s" nthm))))
+ [ TeX-arg-environment "Numbered like" ]
+ t [ (TeX-arg-eval progn (if (eq (save-excursion
+ (backward-char 2)
+ (preceding-char)) ?\])
+ ()
+ (TeX-arg-counter t "Within counter"))
+ "") ])
+
+ '("theoremstyle"
+ (TeX-arg-eval completing-read
+ "Style: "
+ LaTeX-theorem-theoremstyle-list))
+
+ '("theorembodyfont"
+ (LaTeX-arg-theorem-fontdecl "Body font"))
+
+ '("theoremheaderfont"
+ (LaTeX-arg-theorem-fontdecl "Header font"))
+
+ '("theorempreskipamount"
+ (TeX-arg-length "Skip before theorem"))
+
+ '("theorempostskipamount"
+ (TeX-arg-length "Skip after theorem")))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("theoremstyle" "{")
+ ("theorembodyfont" "{")
+ ("theoremheaderfont" "{")
+ ("theorempreskipamount" "{")
+ ("theorempostskipamount" "{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-theorem-package-options nil
+ "Package options for the theorem package.")
+
+;;; theorem.el ends here
--- /dev/null
+;;; tikz.el --- AUCTeX style for `tikz.sty'
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Matthew Leach <matthew@mattleach.net>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-22-03
+;; Keywords: tex tikz
+
+;; 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 some support for `tikz.sty'
+
+;;; Code:
+
+(defun TeX-TikZ-get-opt-arg-string (arg &optional open close)
+ "Return a string for optional arguments.
+If ARG is nil or \"\", return \"\". Otherwise return \"OPEN ARG
+CLOSE\". If OPEN or CLOSE are nil, set them to `LaTeX-optop' and
+`LaTeX-optcl' respectively."
+ (unless (or open close)
+ (setq open LaTeX-optop)
+ (setq close LaTeX-optcl))
+ (if (and arg (> (length arg) 0))
+ (concat open arg close)
+ ""))
+
+(defun TeX-TikZ-arg-rect-point (_ignored &optional prefix)
+ "Prompt the user for a point on the Cartesian plane.
+Ask the user for an X and Y coordinate, and return the string
+\"(X,Y)\"."
+ (let ((x (TeX-read-string (TeX-argument-prompt nil nil "X-coordinate")))
+ (y (TeX-read-string (TeX-argument-prompt nil nil "Y-coordinate"))))
+ (concat " " prefix "(" x ", " y") ")))
+
+(defun TeX-TikZ-arg-polar-point (_ignored &optional prefix)
+ "Prompt the user for a point on the polar plane.
+Ask the user for r and theta values, and return the string
+\"(THETA:R)\"."
+ (let ((r (TeX-read-string (TeX-argument-prompt nil nil "R")))
+ (theta (TeX-read-string (TeX-argument-prompt nil nil "Theta"))))
+ (concat " " prefix "(" theta ":" r ") ")))
+
+(defun TeX-TikZ-arg-options (optional)
+ "Prompt the user for options to a TikZ macro.
+If OPTIONAL is non-nil, always return `LaTeX-optop' and
+`LaTeX-optcl', even if the user doesn't provide any input."
+ (let ((options (TeX-read-string (TeX-argument-prompt optional nil "Options" ))))
+ (if optional
+ (TeX-TikZ-get-opt-arg-string options)
+ (concat LaTeX-optop options LaTeX-optcl))))
+
+(defun TeX-TikZ-arg-name (optional)
+ "Prompt the user for a TikZ name.
+If OPTIONAL is non-nil, always return \"()\", even if the user
+doesn't provide any input."
+ (let ((name (TeX-read-string (TeX-argument-prompt optional nil "Name" ))))
+ (if optional
+ (TeX-TikZ-get-opt-arg-string name "(" ")")
+ (concat "(" name ")"))))
+
+(defun TeX-TikZ-arg-label (optional)
+ "Prompt the user for TikZ label.
+If OPTIONAL is non-nil always return `TeX-grop' and `TeX-grcl',
+even if the user doesn't provide any input."
+ (let ((label (TeX-read-string (TeX-argument-prompt optional nil "Label" ))))
+ (if optional
+ (TeX-TikZ-get-opt-arg-string label TeX-grop TeX-grcl)
+ (concat TeX-grop label TeX-grcl))))
+
+(defun TeX-TikZ-arg-node (_ignored)
+ "Prompt the user for the deatils of a node.
+Ask the user for the name and text for a node and return the
+string \"node[OPTIONS](NAME){TEXT}\"."
+ (let ((options (TeX-TikZ-arg-options t))
+ (name (TeX-TikZ-arg-name t))
+ (label (TeX-TikZ-arg-label nil)))
+ (concat "node" options name label " ")))
+
+(defun TeX-TikZ-get-arg-type (types prompt)
+ "Prompt the user for an argument type.
+TYPES is a list of possible types that the user can specify. Use
+PROMPT as the prompt for input."
+ (let ((completion-ignore-case t))
+ (completing-read prompt types nil t)))
+
+(defun TeX-TikZ-single-macro-arg (function-alist prompt &optional optional)
+ "Prompt the user for a single argument to compose a TikZ macro.
+FUNCTION-ALIST is a mapping of argument-types to functions. The
+user is prompted for the argument type, the chosen function is
+then called and the value returned. PROMPT is used as the prompt
+for the argument type. When OPTIONAL is non-nil, add \"\" to
+FUNCTION-ALIST with a mapping to `identity', permitting an
+optional input."
+ (let* ((selected-argument-type (TeX-TikZ-get-arg-type function-alist prompt))
+ (fn-alist-with-optional-elm (if optional
+ `(,@function-alist ("" identity))
+ function-alist))
+ (selected-mapping (assoc selected-argument-type
+ fn-alist-with-optional-elm)))
+
+ (eval
+ ;; Build the form we wish to evaluate. This will be the function
+ ;; to be called (the second element in the assoc element),
+ ;; followed by the type name (the first element), followed by any
+ ;; other elements in the list as extra arguments.
+ `(,(cadr selected-mapping)
+ ,(car selected-mapping)
+ ,@(cddr selected-mapping)))))
+
+
+(defun TeX-TikZ-macro-arg (function-alist)
+ "Prompt the user for arguments to compose a TikZ macro.
+FUNCTION-ALIST is a mapping of argument-types to functions. The
+user is repeatedly prompted for the next argument-type; they can
+choose form the cars in FUNCTION-ALIST and the appropriate
+function is then called. If the user enters \"\", then the macro
+is finished."
+ (let* ((options (TeX-TikZ-arg-options t))
+ (prompt "Next argument type (RET to finish): ")
+ (string-to-insert (TeX-TikZ-single-macro-arg function-alist prompt t)))
+
+ ;; Insert the macro options.
+ (insert options " ")
+
+ ;; Iteratively prompt the user for TikZ's arguments until "" is
+ ;; returned.
+ (while (not (string= string-to-insert ""))
+ (insert string-to-insert)
+ (setq string-to-insert
+ (TeX-TikZ-single-macro-arg function-alist prompt t)))
+
+ ;; Finish the macro.
+ (insert ";")))
+
+(defcustom TeX-TikZ-point-name-regexp
+ "(\\([A-Za-z0-9]+\\))"
+ "A regexp that matches TikZ names."
+ :type 'regexp
+ :group 'auctex-tikz)
+
+(defun TeX-TikZ-find-named-points ()
+ "Find TiKZ named points in current enviroment.
+Begin by finding the span of the current TikZ enviroment and then
+searching within that span to find all named-points and return
+them as a list of strings, dropping the '()'."
+ (let* ((env-end (save-excursion
+ (LaTeX-find-matching-end)
+ (point)))
+ (matches))
+ ;; TODO: Handle cases where we are in a nested environment, \scope
+ ;; for example.
+ (save-excursion
+ (LaTeX-find-matching-begin)
+ (save-match-data
+ (while (re-search-forward TeX-TikZ-point-name-regexp env-end t)
+ (push (match-string 1) matches))))
+ matches))
+
+(defun TeX-TikZ-arg-named-point (_ignored &optional prefix)
+ "Prompt the user for the name of a previous named-point."
+ (let ((point-name (completing-read "Point name: "
+ (TeX-TikZ-find-named-points))))
+ (concat " " prefix "(" point-name ") ")))
+
+(defun TeX-TikZ-arg-circle (_ignored)
+ "Prompt the user for the arguments to the circle command."
+ (let ((options (TeX-TikZ-arg-options t)))
+ (concat "circle" options)))
+
+(defun TeX-TikZ-arg-arc (_ignored)
+ "Prompt the user for the arguments to the arc command."
+ (let ((options (TeX-TikZ-arg-options t)))
+ (concat "arc" options)))
+
+(defun TeX-TikZ-arg-bend (optional)
+ "Prompt the user for a bend argument.
+If OPTIONAL is non-nil and the user doesn't provide a point,
+ return \"\"."
+ (let ((point
+ (TeX-TikZ-single-macro-arg TeX-TikZ-point-function-map
+ (TeX-argument-prompt optional nil "Bend point")
+ optional)))
+ (if (string= point "")
+ point
+ (concat " bend" point))))
+
+(defun TeX-TikZ-arg-parabola (_ignored)
+ "Prompt the user for the arguments to the parabola command."
+ (let ((options (TeX-TikZ-arg-options t))
+ (bend (TeX-TikZ-arg-bend t)))
+ (concat "parabola" options bend)))
+
+(defun TeX-TikZ-arg-grid (_ignored)
+ "Prompt the user for the arguments to the grid command."
+ (let ((options (TeX-TikZ-arg-options t)))
+ (concat "grid" options)))
+
+(defconst TeX-TikZ-point-function-map
+ '(("Rect Point" TeX-TikZ-arg-rect-point)
+ ("Polar Point" TeX-TikZ-arg-polar-point)
+ ("Named Point" TeX-TikZ-arg-named-point))
+ "An alist of point specification types and their functions.")
+
+(defconst TeX-TikZ-relative-point-function-map
+ (apply 'append (mapcar
+ (lambda (point-map)
+ (let ((key (car point-map))
+ (value (cadr point-map)))
+ `((,(concat "+" key) ,value "+")
+ (,(concat "++" key) ,value "++"))))
+ TeX-TikZ-point-function-map))
+ "`TeX-TikZ-point-function-map' with \"+\" and \"++\" as a
+prefix.")
+
+(defconst TeX-TikZ-path-connector-function-map
+ '(("--" identity)
+ ("|-" identity)
+ ( "-|" identity)
+ ("sin" identity)
+ ("cos" identity))
+ "An alist of path connectors.")
+
+(defconst TeX-TikZ-draw-arg-function-map
+ `(,@TeX-TikZ-point-function-map
+ ,@TeX-TikZ-relative-point-function-map
+ ,@TeX-TikZ-path-connector-function-map
+ ("Node" TeX-TikZ-arg-node)
+ ("Circle" TeX-TikZ-arg-circle)
+ ("Arc" TeX-TikZ-arg-arc)
+ ("Parabola" TeX-TikZ-arg-parabola)
+ ("Grid" TeX-TikZ-arg-grid))
+ "An alist of argument names and functoins for TikZ's \draw.")
+
+(defun TeX-TikZ-draw-arg (_ignored)
+ "Prompt the user for the arguments to a TikZ draw macro."
+ (TeX-TikZ-macro-arg TeX-TikZ-draw-arg-function-map))
+
+(defun TeX-TikZ-coordinate-arg (_ignored)
+ "Prompt the user for the arguments to a TikZ coordinate macro."
+ (let ((options (TeX-TikZ-arg-options t))
+ (name (TeX-TikZ-arg-name nil))
+ (point (TeX-TikZ-single-macro-arg TeX-TikZ-point-function-map
+ "Coordinate point type: ")))
+ (insert options " " name " at" point ";")))
+
+(defun TeX-TikZ-node-arg (_ignored)
+ "Prompt the user for the arguments to a TikZ node macro."
+ (let ((options (TeX-TikZ-arg-options t))
+ (name (TeX-TikZ-arg-name nil))
+ (point (TeX-TikZ-single-macro-arg TeX-TikZ-point-function-map
+ "Node point type: "))
+ (label (TeX-TikZ-arg-label nil)))
+ (insert options " " name " at" point label ";")))
+
+(TeX-add-style-hook
+ "tikz"
+ (lambda ()
+ (TeX-add-symbols
+ '("draw" (TeX-TikZ-draw-arg))
+ '("coordinate" (TeX-TikZ-coordinate-arg))
+ '("node" (TeX-TikZ-node-arg)))
+ (LaTeX-add-environments
+ '("tikzpicture"))))
+
+;;; tikz.el ends here
--- /dev/null
+;;; titleps.el --- AUCTeX style for `titleps.sty' (v1.1.1)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2016-06-22
+;; 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 `titleps.sty' (v1.1.1) from 2016/03/15.
+;; `titleps.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-titleps-section-command-list
+ '("part"
+ "chapter"
+ "section"
+ "subsection"
+ "subsubsection"
+ "paragraph"
+ "subparagraph")
+ "List of sectioning commands available in \"titleps.sty\".")
+
+(defun LaTeX-titleps-section-command-list ()
+ "Remove \"chapter\" from variable
+`LaTeX-titleps-section-command-list' and return the remainder.
+Removal is based on the return value of function
+`LaTeX-largest-level'."
+ (if (< (LaTeX-largest-level) 2)
+ (symbol-value 'LaTeX-titleps-section-command-list)
+ (remove "chapter" LaTeX-titleps-section-command-list)))
+
+(defvar LaTeX-titleps-newpagestyle-regexp
+ '("\\\\newpagestyle[ \t\n\r%]*{\\([^}]+\\)}" 1 LaTeX-auto-pagestyle)
+ "Match the argument of \"\\newpagestyle\" from titleps.sty.")
+
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "titleps"
+ (lambda ()
+
+ ;; Add titleps to the parser.
+ (TeX-auto-add-regexp LaTeX-titleps-newpagestyle-regexp)
+
+ ;; Add \<section>title's
+ (dolist (sec (LaTeX-titleps-section-command-list))
+ (TeX-add-symbols `(,(concat sec "title") 0)))
+
+ (TeX-add-symbols
+ ;; 2. Defining Page Styles
+ '("newpagestyle"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((ps (TeX-read-string
+ (TeX-argument-prompt optional nil "Page style"))))
+ (LaTeX-add-pagestyles ps)
+ (format "%s" ps))))
+ (TeX-arg-conditional (y-or-n-p "With optional global style? ")
+ ( [ t ] nil)
+ ( t )))
+
+ '("renewpagestyle" TeX-arg-pagestyle
+ (TeX-arg-conditional (y-or-n-p "With optional global style? ")
+ ( [ t ] nil)
+ ( t )))
+
+ '("sethead"
+ (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+ ( [ 3 ] nil nil nil)
+ ( 3 )))
+
+ '("setfoot"
+ (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+ ( [ 3 ] nil nil nil)
+ ( 3 )))
+
+ '("sethead*" 3)
+ '("setfoot*" 3)
+
+ '("settitlemarks"
+ (TeX-arg-eval mapconcat #'identity
+ (TeX-completing-read-multiple
+ (TeX-argument-prompt optional nil "Level names")
+ (LaTeX-titleps-section-command-list))
+ ","))
+
+ '("settitlemarks"
+ (TeX-arg-eval mapconcat #'identity
+ (TeX-completing-read-multiple
+ (TeX-argument-prompt optional nil "Level names")
+ (LaTeX-titleps-section-command-list))
+ ","))
+
+ '("headrule" 0)
+ '("setheadrule" "Thickness")
+
+ '("footrule" 0)
+ '("setfootrule" "Thickness")
+
+ '("makeheadrule" 0)
+ '("makefootrule" 0)
+
+ ;; 3. On \markboth and \markleft
+ '("setmarkboth" t)
+ '("resetmarkboth" 0)
+
+ ;; 4. Headline/footline width
+ '("widenhead"
+ (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+ ( [ 2 ] nil nil)
+ ( 2 )))
+
+ '("widenhead*" 2)
+
+ '("TitlepsPatchSection"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Sectioning command")
+ (LaTeX-titleps-section-command-list)))
+
+ '("TitlepsPatchSection*"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Sectioning command")
+ (LaTeX-titleps-section-command-list)))
+
+ ;; 5. Marks
+ '("bottitlemarks" 0)
+ '("toptitlemarks" 0)
+ '("firsttitlemarks" 0)
+ '("nexttoptitlemarks" 0)
+ '("outertitlemarks" 0)
+ '("innertitlemarks" 0)
+
+ '("newtitlemark" (TeX-arg-macro "Command name"))
+ '("newtitlemark*" (TeX-arg-counter "Variable name"))
+
+ '("pretitlemark"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Sectioning command")
+ (LaTeX-titleps-section-command-list))
+ "Text")
+
+ '("pretitlemark*"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Sectioning command")
+ (LaTeX-titleps-section-command-list))
+ "Text")
+
+ '("ifsamemark"
+ (TeX-arg-macro "Marks group: \\")
+ (TeX-arg-macro "Command: \\")
+ 2)
+
+ ;; 6. Running heads with floats
+ '("setfloathead"
+ (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+ ( [ 3 ] nil nil nil nil [ nil ] )
+ ( 4 [ nil ] )))
+
+ '("setfloatfoot"
+ (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+ ( [ 3 ] nil nil nil nil [ nil ] )
+ ( 4 [ nil ] )))
+
+ '("setfloathead*" 4 [ nil ] )
+ '("setfloatfoot*" 4 [ nil ] )
+
+ '("nextfloathead"
+ (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+ ( [ 3 ] nil nil nil nil [ nil ] )
+ ( 4 [ nil ] )))
+
+ '("nextfloatfoot"
+ (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+ ( [ 3 ] nil nil nil nil [ nil ] )
+ ( 4 [ nil ] )))
+
+ '("nextfloathead*" 4 [ nil ] )
+ '("nextfloatfoot*" 4 [ nil ] )
+
+ ;; 7. Extra marks: I'm not clear how the marks commands work;
+ ;; until then, I ignore them
+ )
+
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("newpagestyle" "{[{")
+ ("renewpagestyle" "{[{")
+ ("settitlemarks" "*{")
+ ("widenhead" "*[[{{")
+ ("TitlepsPatchSection" "*{")
+ ("newtitlemark" "*{")
+ ("pretitlemark" "*{{")
+ ("nextfloathead" "*[[[{{{{[")
+ ("nextfloatfoot" "*[[[{{{{["))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-titleps-package-options
+ '(;; 4. Headline/footline width
+ "nopatches"
+
+ ;; 5. Marks
+ "outermarks" "innermarks" "topmarks" "botmarks"
+
+ ;; 6. Running heads with floats
+ "psfloats"
+
+ ;; 7. Extra marks
+ "extramarks")
+ "Package options for the titleps package.")
+
+;;; titleps.el ends here
--- /dev/null
+;;; titlesec.el --- AUCTeX style for `titlesec.sty' (v2.10.0)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-09-19
+;; 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 `titlesec.sty' (v2.10.0) from
+;; 2011/12/15. `titlesec.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-titlesec-key-val-options
+ '(("page" ("even" "odd"))
+ ("numberless"))
+ "Key=value options for \"\\titleformat\" and \"\\titlespacing\"
+macros provided by \"titlesec.sty\".")
+
+(defvar LaTeX-titlesec-section-command-list
+ '("part"
+ "chapter"
+ "section"
+ "subsection"
+ "subsubsection"
+ "paragraph"
+ "subparagraph")
+ "List of sectioning commands available in \"titlesec.sty\".")
+
+(defvar LaTeX-titlesec-section-shape-list
+ '("hang"
+ "block"
+ "display"
+ "runin"
+ "leftmargin"
+ "rightmargin"
+ "drop"
+ "wrap"
+ "frame")
+ "List of sectioning shapes available for \"\\titleformat\" command.")
+
+(defun LaTeX-titlesec-section-command-list ()
+ "Remove \"chapter\" from variable
+`LaTeX-titlesec-section-command-list' and return the remainder.
+Removal is based on the return value of function
+`LaTeX-largest-level'. Items returned are prefixed with
+`TeX-esc'."
+ (mapcar (lambda (elt) (concat TeX-esc elt))
+ (if (< (LaTeX-largest-level) 2)
+ (symbol-value 'LaTeX-titlesec-section-command-list)
+ (remove "chapter" LaTeX-titlesec-section-command-list))))
+
+(defun LaTeX-arg-titlesec-titlespec (optional)
+ "Insert the first argument of \"\\titleformat\" and \"\\titlespacing\".
+Depending on returned value of function `LaTeX-largest-level',
+append a \"name\" key with corresponding values to
+`LaTeX-titlesec-key-val-options'. The values are retrieved from
+`LaTeX-titlesec-section-command-list'. The values of this list
+are also added stand-alone as keys. If OPTIONAL is non-nil,
+insert the argument in brackets."
+ (let ((keyvals
+ (TeX-read-key-val
+ optional
+ (append
+ `(("name"
+ ,(mapcar (lambda (elt) (concat TeX-esc elt))
+ (if (< (LaTeX-largest-level) 2)
+ (symbol-value 'LaTeX-titlesec-section-command-list)
+ (remove "chapter" LaTeX-titlesec-section-command-list)))))
+ (mapcar #'list
+ (mapcar (lambda (elt) (concat TeX-esc elt))
+ (if (< (LaTeX-largest-level) 2)
+ (symbol-value 'LaTeX-titlesec-section-command-list)
+ (remove "chapter" LaTeX-titlesec-section-command-list))))
+ LaTeX-titlesec-key-val-options)
+ "Sectioning command")))
+ (TeX-argument-insert keyvals optional)))
+
+(TeX-add-style-hook
+ "titlesec"
+ (lambda ()
+
+ ;; Load "titleps.el" when "pagestyles" package option is given
+ (when (LaTeX-provided-package-options-member "titlesec" "pagestyles")
+ (TeX-run-style-hooks "titleps"))
+
+ (TeX-add-symbols
+ ;; 2.4. Tools
+ '("titlelabel" t)
+
+ ;; \titleformat*{<command>}{<format>}
+ '("titleformat*" (LaTeX-arg-titlesec-titlespec) t)
+
+ ;; 3. Advanced Interface
+ ;; \titleformat{<command>}[<shape>]{<format>}{<label>}{<sep>}{<before-code>}[<after-code>]
+ '("titleformat"
+ (LaTeX-arg-titlesec-titlespec)
+ [TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Shape")
+ LaTeX-titlesec-section-shape-list]
+ (TeX-arg-conditional (y-or-n-p "With optional after-code? ")
+ (4 [nil])
+ (4)))
+
+ '("chaptertitlename" 0)
+
+ ;; 3.2. Spacing
+ ;; \titlespacing{<command>}{<left>}{<before-sep>}{<after-sep>}[<right-sep>]
+ '("titlespacing"
+ (LaTeX-arg-titlesec-titlespec)
+ (TeX-arg-length "Left margin")
+ (TeX-arg-length "Before vertical space")
+ (TeX-arg-length "Space between title and text")
+ [TeX-arg-length "Right margin"])
+
+ '("titlespacing*"
+ (LaTeX-arg-titlesec-titlespec)
+ (TeX-arg-length "Left margin")
+ (TeX-arg-length "Before vertical space")
+ (TeX-arg-length "Space between title and text")
+ [TeX-arg-length "Right margin"])
+
+ ;; 3.3. Spacing related tools
+ '("filright" 0)
+ '("filcenter" 0)
+ '("filleft" 0)
+ '("fillast" 0)
+ '("filinner" 0)
+ '("filouter" 0)
+ '("wordsep" 0)
+
+ ;; 3.4. Rules
+ '("titleline"
+ [TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Alignment")
+ '("l" "r" "c")]
+ t)
+
+ '("titlerule" [TeX-arg-length "Rule height"])
+
+ '("titlerule*" [TeX-arg-length "Box width"] "Text")
+
+ '("iftitlemeasuring" 2)
+
+ ;; 3.5. Page styles
+ '("assignpagestyle"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Sectioning command")
+ (LaTeX-titlesec-section-command-list))
+ (TeX-arg-pagestyle))
+
+ ;; 3.9. Creating new levels and changing the class
+ '("titleclass"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Sectioning command")
+ (LaTeX-titlesec-section-command-list))
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Class")
+ '("page" "top" "straight"))
+ [TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Super level command")
+ (LaTeX-titlesec-section-command-list)]) )
+
+ ;; 3.4. Rules: A variant of \titleline to be used only with calcwidth
+ (when (LaTeX-provided-package-options-member "titlesec" "calcwidth")
+ (TeX-add-symbols
+ '("titleline*"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Alignment")
+ '("l" "r" "c"))
+ t)))
+
+ ;; The length of the longest line is returned in \titlewidth
+ (LaTeX-add-lengths "titlewidth"
+ "titlewidthlast"
+ "titlewidthfirst")
+
+ ;; Fontification: We only add macros which are used at top level;
+ ;; most of macros definded above are intended to be used in
+ ;; arguments of \titleformat
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("titlelabel" "{")
+ ;;
+ ;; \titleformat comes in 2 flavors:
+ ;; with *, it takes only 2 mandatory
+ ;; argument; w/o *, a lot more. It is
+ ;; not (yet) possible to realize this
+ ;; behaviour within font-latex. Hence
+ ;; we reduce the fontification to the
+ ;; first 2 mandatory arguments and
+ ;; ignore the rest. *[ are optional anyway.
+ ("titleformat" "*{[{")
+ ("titlespacing" "*{{{{[")
+ ("iftitlemeasuring" "{{")
+ ("assignpagestyle" "{{")
+ ("titleclass" "{[{["))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-titlesec-package-options
+ '(;; 2.1. Format
+ "rm" "sf" "tt" "md" "bf" "up" "it" "sl" "sc"
+ "big" "medium" "small" "tiny"
+ "raggedleft" "center" "raggedright"
+
+ ;; 2.2. Spacing
+ "compact"
+
+ ;; 2.3. Uppercase
+ "uppercase"
+
+ ;; 3.3. Spacing related tools
+ "indentafter" "noindentafter"
+ "rigidchapters" "rubberchapters"
+ "bottomtitles" "nobottomtitles" "nobottomtitles*"
+ "aftersep" "largestsep" "pageatnewline"
+
+ ;; 3.4. Rules
+ "calcwidth"
+
+ ;; 3.7. Other Package Options
+ "explicit"
+ "newparttoc"
+ "oldparttoc"
+ "clearempty"
+ "toctitles"
+ "newlinetospace"
+ "loadonly"
+
+ ;; 5. titleps and Page Styles
+ "pagestyles")
+ "Package options for the titlesec package.")
+
+;;; titlesec.el ends here
--- /dev/null
+;;; titletoc.el --- AUCTeX style for `titletoc.sty' (v1.6)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-09-19
+;; 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 `titletoc.sty' (v1.6) from
+;; 2011/12/15. `titletoc.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-titletoc-section-command-list
+ '("part"
+ "chapter"
+ "section"
+ "subsection"
+ "subsubsection"
+ "paragraph"
+ "subparagraph"
+ "figure"
+ "table")
+ "List of sectioning commands available in \"titletoc.sty\".
+Other environments producing a \"Table of ENVIRONMENT\" (figure,
+table) are also available in this variable.")
+
+(defun LaTeX-titletoc-section-command-list ()
+ "Remove \"chapter\" from variable
+`LaTeX-titletoc-section-command-list' and return the remainder.
+Removal is based on the return value of function
+`LaTeX-largest-level'."
+ (if (< (LaTeX-largest-level) 2)
+ (symbol-value 'LaTeX-titletoc-section-command-list)
+ (remove "chapter" LaTeX-titletoc-section-command-list)))
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+;; Setup for \contentsuse:
+(TeX-auto-add-type "titletoc-contentsuse" "LaTeX")
+
+(defvar LaTeX-titletoc-contentsuse-regexp
+ '("\\\\contentsuse{\\([^}]+\\)}"
+ 1 LaTeX-auto-titletoc-contentsuse)
+ "Matches the argument of \\contentsuse from titletoc package.")
+
+(defun LaTeX-titletoc-auto-prepare ()
+ "Clear `LaTeX-auto-titletoc-contentsuse' before parsing."
+ (setq LaTeX-auto-titletoc-contentsuse nil))
+
+(defun LaTeX-titletoc-auto-cleanup ()
+ "Move parsed arguments of \"\\contentsuse\" to the variable
+`LaTeX-titletoc-section-command-list'."
+ (when (LaTeX-titletoc-contentsuse-list)
+ (make-local-variable 'LaTeX-titletoc-section-command-list)
+ (dolist (content (mapcar #'car (LaTeX-titletoc-contentsuse-list)))
+ (add-to-list 'LaTeX-titletoc-section-command-list content))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-titletoc-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-titletoc-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "titletoc"
+ (lambda ()
+
+ ;; Add titletoc to the parser
+ (TeX-auto-add-regexp LaTeX-titletoc-contentsuse-regexp)
+
+ (TeX-add-symbols
+ ;; Basic macros
+ ;; \dottedcontents{<section>}[<left>]{<above-code>}
+ ;; {<label width>}{<leader width>}
+ '("dottedcontents"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Sectioning command")
+ (LaTeX-titletoc-section-command-list))
+ [ TeX-arg-length "Left margin" ] 3)
+
+ ;; \titlecontents{<section>}[<left>]{<above-code>}
+ ;; {<numbered-entry-format>}{<numberless-entry-format>}
+ ;; {<filler-page-format>}[<below-code>]
+ '("titlecontents"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Sectioning command")
+ (LaTeX-titletoc-section-command-list))
+ [ TeX-arg-length "Left margin" ]
+ (TeX-arg-conditional (y-or-n-p "With optional below code argument? ")
+ (4 [nil])
+ (4)))
+
+ ;; \titlecontents*{<section>}[<left>]{<above-code>}
+ ;; {<numbered-entry-format>}{<numberless-entry-format>}
+ ;; {<filler-page-format>}[<separator>]
+ '("titlecontents*"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Sectioning command")
+ (LaTeX-titletoc-section-command-list))
+ [ TeX-arg-length "Left margin" ]
+ (TeX-arg-conditional (y-or-n-p "With optional separator argument? ")
+ (4 [nil])
+ (4)))
+
+ ;; \contentsmargin[<correction>]{<right>}
+ '("contentsmargin" [ "Correction" ] "Right margin")
+
+ '("thecontentslabel" 0)
+
+ '("thecontentspage" 0)
+
+ '("contentslabel" [ "Format" ] (TeX-arg-length "Space"))
+
+ '("contentspage" [ "Format" ])
+
+ '("contentspush" t)
+
+ ;; Check if newfloat.el is loaded and any new environment is
+ ;; defined with it. titletoc.sty can also be used to customize
+ ;; new environments defined with newfloat.sty. As a prerequisite,
+ ;; the environments must be introduced to titletoc.sty with
+ ;; \contentuse{ENV} and then can be used as argument to \titlecontents.
+ '("contentsuse"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((name (if (and (member "newfloat" (TeX-active-styles))
+ (LaTeX-newfloat-DeclareFloatingEnvironment-list))
+ (completing-read
+ (TeX-argument-prompt optional nil "Name of contents")
+ (mapcar #'car
+ (LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+ (TeX-read-string
+ (TeX-argument-prompt optional nil "Name of contents")))))
+ (make-local-variable 'LaTeX-titletoc-section-command-list)
+ (add-to-list 'LaTeX-titletoc-section-command-list name)
+ (format "%s" name))))
+ "File extension")
+
+ ;; 6.3. Partial TOC's
+ '("startcontents" [ "Name" ])
+
+ '("stopcontents" [ "Name" ])
+
+ '("resumecontents" [ "Name" ])
+
+ '("printcontents" [ "Name" ] "Prefix" "Start level" t)
+
+ ;; 6.4. Partial lists
+ '("startlist" [ "Name" ] "List")
+
+ '("stoplist" [ "Name" ] "List")
+
+ '("resumelist" [ "Name" ] "List")
+
+ '("printlist" [ "Name" ] "Prefix" t) )
+
+ ;; Fontification: We only add macros which are used at top level;
+ ;; most of macros definded above are intended to be used in
+ ;; arguments of \dottedcontents or \titlecontents
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("dottedcontents" "{[{{{")
+ ("titlecontents" "*{[{{{[[[")
+ ("contentsmargin" "[{")
+ ("contentsuse" "{{"))
+ 'function)) )
+ LaTeX-dialect)
+
+(defvar LaTeX-titletoc-package-options
+ '("leftlabels" "rightlabels" "dotinlabels")
+ "Package options for the titletoc package.")
+
+;;; titletoc.el ends here
--- /dev/null
+;;; transparent.el --- AUCTeX style for `transparent.sty' (v1.0)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-08-15
+;; 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 `transparent.sty' (v1.0) from 2007/01/08.
+;; `transparent.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "transparent"
+ (lambda ()
+ (TeX-add-symbols
+ '("transparent" "Transparency value (between 0,1)")
+ '("texttransparent" "Transparency value (between 0,1)" t))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("transparent" "{"))
+ 'type-declaration)
+ (font-latex-add-keywords '(("texttransparent" "{{"))
+ 'type-command)))
+ LaTeX-dialect)
+
+(defvar LaTeX-transparent-package-options nil
+ "Package options for the transparent package.")
+
+;;; transparent.el ends here
--- /dev/null
+;;; treport.el - Special code for treport class.
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Ikumi Keita <ikumi@ikumi.que.jp>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-03-23
+;; 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:
+
+;; Please write me.
+
+;;; Code:
+
+(TeX-load-style "jreport")
+(defvar LaTeX-treport-class-options LaTeX-jreport-class-options
+ "Class options for the treport class.")
+
+(TeX-add-style-hook
+ "treport"
+ (lambda ()
+ (TeX-run-style-hooks "jreport" "plext"))
+ LaTeX-dialect)
+
+;;; treport.el ends here
--- /dev/null
+;;; vwcol.el --- AUCTeX style for `vwcol.sty' (v0.2)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-07-04
+;; 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 `vwcol.sty' (v0.2) from 2015/02/10.
+;; `vwcol.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-vwcol-key-val-options
+ '(("widths")
+ ("sep" ("fill"))
+ ("presep" ("true" "false"))
+ ("postsep" ("true" "false"))
+ ("sidesep" ("true" "false"))
+ ("rule" ("none" "0pt"))
+ ("prerule" ("true" "false"))
+ ("postrule" ("true" "false"))
+ ("siderule" ("true" "false"))
+ ("justify" ("ragged" "flush" "raggedleft" "center"))
+ ("rulecolor")
+ ("indent")
+ ("lines"))
+ "Key=value options for vwcol macros and environments.")
+
+(TeX-add-style-hook
+ "vwcol"
+ (lambda ()
+
+ (LaTeX-add-environments
+ '("vwcol" LaTeX-env-args
+ [ TeX-arg-key-val LaTeX-vwcol-key-val-options ]))
+
+ (TeX-add-symbols
+ '("vwcolsetup" (TeX-arg-key-val LaTeX-vwcol-key-val-options)))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("vwcolsetup" "{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-vwcol-package-options '("quiet")
+ "Package options for the vwcol package.")
+
+;;; vwcol.el ends here
--- /dev/null
+;;; wrapfig.el --- AUCTeX style for `wrapfig.sty' version v3.6
+
+;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-12-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 `wrapfig.sty' version v3.6 from
+;; 2003/01/31. `wrapfig.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "wrapfig"
+ (lambda ()
+ (LaTeX-add-environments
+ ;; \begin{wrapfigure}[No.lines]{Placement}[Overhang]{Width} ... \end{wrapfigure}
+ '("wrapfigure"
+ (lambda (env &rest ignore)
+ (LaTeX-insert-environment
+ env
+ (let ((narrow (TeX-read-string "(Optional) Number of narrow lines: "))
+ (placement (completing-read
+ "Placement: " '(("r") ("R")
+ ("l") ("L")
+ ("i") ("I")
+ ("o") ("O"))))
+ (overhang (TeX-read-string "(Optional) Overhang: "))
+ (width (TeX-read-string "Width: ")))
+ (concat
+ (unless (string= narrow "")
+ (format "[%s]" narrow))
+ (format "{%s}" placement)
+ (unless (string= overhang "")
+ (format "[%s]" overhang))
+ (format "{%s}" width))))))
+ ;;
+ ;; \begin{wraptable}[No.lines]{Placement}[Overhang]{Width} ... \end{wraptable}
+ '("wraptable"
+ (lambda (env &rest ignore)
+ (LaTeX-insert-environment
+ env
+ (let ((narrow (TeX-read-string "(Optional) Number of narrow lines: "))
+ (placement (completing-read
+ "Placement: " '(("r") ("R")
+ ("l") ("L")
+ ("i") ("I")
+ ("o") ("O"))))
+ (overhang (TeX-read-string "(Optional) Overhang: "))
+ (width (TeX-read-string "Width: ")))
+ (concat
+ (unless (string= narrow "")
+ (format "[%s]" narrow))
+ (format "{%s}" placement)
+ (unless (string= overhang "")
+ (format "[%s]" overhang))
+ (format "{%s}" width))))))
+ ;;
+ ;; \begin{wrapfloat}{<Type>}[No.lines]{Placement}[Overhang]{Width} ... \end{wrapfloat}
+ ;;
+ ;; <Type> can be a new floating environment defined with
+ ;; "\DeclareFloatingEnvironment" from newfloat.el. We check if
+ ;; the function `LaTeX-newfloat-DeclareFloatingEnvironment-list'
+ ;; is bound and returns non-nil before offering environment for
+ ;; completion. Otherwise, just ask user without completion.
+ '("wrapfloat"
+ (lambda (env &rest ignore)
+ (LaTeX-insert-environment
+ env
+ (let ((floattype (if (and (fboundp 'LaTeX-newfloat-DeclareFloatingEnvironment-list)
+ (LaTeX-newfloat-DeclareFloatingEnvironment-list))
+ (completing-read
+ "Float type: "
+ (mapcar 'car (LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+ (TeX-read-string "Float type: ")))
+ (narrow (TeX-read-string "(Optional) Number of narrow lines: "))
+ (placement (completing-read
+ "Placement: " '(("r") ("R")
+ ("l") ("L")
+ ("i") ("I")
+ ("o") ("O"))))
+ (overhang (TeX-read-string "(Optional) Overhang: "))
+ (width (TeX-read-string "Width: ")))
+ (concat
+ (format "{%s}" floattype)
+ (unless (string= narrow "")
+ (format "[%s]" narrow))
+ (format "{%s}" placement)
+ (unless (string= overhang "")
+ (format "[%s]" overhang))
+ (format "{%s}" width))))))))
+ LaTeX-dialect)
+
+(defvar LaTeX-wrapfig-package-options '("verbose")
+ "Package options for the wrapfig package.")
+
+;;; wrapfig.el ends here
--- /dev/null
+;; xcolor.el --- AUCTeX style for `xcolor.sty' (v2.12)
+
+;; Copyright (C) 2016--2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-07-04
+;; 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 `xcolor.sty' (v2.12) from 2016/05/11.
+;; `xcolor.sty' is part of TeXLive.
+
+;; `xcolor.sty' and `color.sty' share many command namens, but the
+;; number of arguments is not always identical -- `xcolor.sty'
+;; commands take more arguments. In order to make the commands and
+;; font-locking work correctly, we follow this strategy: If
+;; `xcolor.sty' is loaded after `color.sty', everything works fine.
+;; For the way around, we guard the definitions for `color.sty' with:
+;;
+;; (unless (member "xcolor" (TeX-style-list))
+;; (<define stuff for color.sty>))
+;;
+;; to make sure that we define stuff for `color.sty' only if AUCTeX
+;; style for `xcolor.sty' is not already loaded.
+
+;;; Code:
+
+(defvar LaTeX-xcolor-core-color-models
+ '("rgb" "cmy" "cmyk" "hsb" "gray")
+ "List of core color models provided by xcolor.sty.")
+
+(defvar LaTeX-xcolor-num-color-models
+ '("RGB" "HTML" "HSB" "Gray" "HsB" "tHsB" "wave")
+ "List of integer and decimal color models provided by xcolor.sty.")
+
+(defvar LaTeX-xcolor-pseudo-color-models
+ '("named")
+ "List of pseudo color models provided by xcolor.sty.")
+
+(defvar LaTeX-xcolor-type-color-models
+ '("named" "ps")
+ "List of type color models provided by xcolor.sty.")
+
+(defvar LaTeX-xcolor-base-colors
+ '("red" "green" "blue" "cyan" "magenta" "yellow" "black"
+ "gray" "white" "darkgray" "lightgray" "brown" "lime" "olive"
+ "orange" "pink" "purple" "teal" "violet")
+ "List of colors defined and always available from xcolor.sty.")
+
+(defvar LaTeX-xcolor-dvipsnames-colors
+ '("Apricot" "Aquamarine" "Bittersweet" "Black"
+ "Blue" "BlueGreen" "BlueViolet" "BrickRed"
+ "Brown" "BurntOrange" "CadetBlue" "CarnationPink"
+ "Cerulean" "CornflowerBlue" "Cyan" "Dandelion"
+ "DarkOrchid" "Emerald" "ForestGreen" "Fuchsia"
+ "Goldenrod" "Gray" "Green" "GreenYellow"
+ "JungleGreen" "Lavender" "LimeGreen" "Magenta"
+ "Mahogany" "Maroon" "Melon" "MidnightBlue"
+ "Mulberry" "NavyBlue" "OliveGreen" "Orange"
+ "OrangeRed" "Orchid" "Peach" "Periwinkle"
+ "PineGreen" "Plum" "ProcessBlue" "Purple"
+ "RawSienna" "Red" "RedOrange" "RedViolet"
+ "Rhodamine" "RoyalBlue" "RoyalPurple" "RubineRed"
+ "Salmon" "SeaGreen" "Sepia" "SkyBlue"
+ "SpringGreen" "Tan" "TealBlue" "Thistle"
+ "Turquoise" "Violet" "VioletRed" "White"
+ "WildStrawberry" "Yellow" "YellowGreen" "YellowOrange")
+ "List of colors defined by package option dvipsnames from xcolor.sty.")
+
+(defvar LaTeX-xcolor-svgnames-colors
+ '("AliceBlue" "DarkTurquoise" "LightSalmon" "PaleVioletRed"
+ "AntiqueWhite" "DarkViolet" "LightSeaGreen" "PapayaWhip"
+ "Aqua" "DeepPink" "LightSkyBlue" "PeachPuff"
+ "Aquamarine" "DeepSkyBlue" "LightSlateBlue" "Peru"
+ "Azure" "DimGray" "LightSlateGray" "Pink"
+ "Beige" "DimGrey" "LightSlateGrey" "Plum"
+ "Bisque" "DodgerBlue" "LightSteelBlue" "PowderBlue"
+ "Black" "FireBrick" "LightYellow" "Purple"
+ "BlanchedAlmond" "FloralWhite" "Lime" "Red"
+ "Blue" "ForestGreen" "LimeGreen" "RosyBrown"
+ "BlueViolet" "Fuchsia" "Linen" "RoyalBlue"
+ "Brown" "Gainsboro" "Magenta" "SaddleBrown"
+ "BurlyWood" "GhostWhite" "Maroon" "Salmon"
+ "CadetBlue" "Gold" "MediumAquamarine" "SandyBrown"
+ "Chartreuse" "Goldenrod" "MediumBlue" "SeaGreen"
+ "Chocolate" "Gray" "MediumOrchid" "Seashell"
+ "Coral" "Green" "MediumPurple" "Sienna"
+ "CornflowerBlue" "GreenYellow" "MediumSeaGreen" "Silver"
+ "Cornsilk" "Grey" "MediumSlateBlue" "SkyBlue"
+ "Crimson" "Honeydew" "MediumSpringGreen" "SlateBlue"
+ "Cyan" "HotPink" "MediumTurquoise" "SlateGray"
+ "DarkBlue" "IndianRed" "MediumVioletRed" "SlateGrey"
+ "DarkCyan" "Indigo" "MidnightBlue" "Snow"
+ "DarkGoldenrod" "Ivory" "MintCream" "SpringGreen"
+ "DarkGray" "Khaki" "MistyRose" "SteelBlue"
+ "DarkGreen" "Lavender" "Moccasin" "Tan"
+ "DarkGrey" "LavenderBlush" "NavajoWhite" "Teal"
+ "DarkKhaki" "LawnGreen" "Navy" "Thistle"
+ "DarkMagenta" "LemonChiffon" "NavyBlue" "Tomato"
+ "DarkOliveGreen" "LightBlue" "OldLace" "Turquoise"
+ "DarkOrange" "LightCoral" "Olive" "Violet"
+ "DarkOrchid" "LightCyan" "OliveDrab" "VioletRed"
+ "DarkRed" "LightGoldenrod" "Orange" "Wheat"
+ "DarkSalmon" "LightGoldenrodYellow" "OrangeRed" "White"
+ "DarkSeaGreen" "LightGray" "Orchid" "WhiteSmoke"
+ "DarkSlateBlue" "LightGreen" "PaleGoldenrod" "Yellow"
+ "DarkSlateGray" "LightGrey" "PaleGreen" "YellowGreen"
+ "DarkSlateGrey" "LightPink" "PaleTurquoise")
+ "List of colors defined by package option svgnames from xcolor.sty.")
+
+(defvar LaTeX-xcolor-x11names-colors
+ '("AntiqueWhite1" "DeepSkyBlue1" "LightYellow1" "RoyalBlue1"
+ "AntiqueWhite2" "DeepSkyBlue2" "LightYellow2" "RoyalBlue2"
+ "AntiqueWhite3" "DeepSkyBlue3" "LightYellow3" "RoyalBlue3"
+ "AntiqueWhite4" "DeepSkyBlue4" "LightYellow4" "RoyalBlue4"
+ "Aquamarine1" "DodgerBlue1" "Magenta1" "Salmon1"
+ "Aquamarine2" "DodgerBlue2" "Magenta2" "Salmon2"
+ "Aquamarine3" "DodgerBlue3" "Magenta3" "Salmon3"
+ "Aquamarine4" "DodgerBlue4" "Magenta4" "Salmon4"
+ "Azure1" "Firebrick1" "Maroon1" "SeaGreen1"
+ "Azure2" "Firebrick2" "Maroon2" "SeaGreen2"
+ "Azure3" "Firebrick3" "Maroon3" "SeaGreen3"
+ "Azure4" "Firebrick4" "Maroon4" "SeaGreen4"
+ "Bisque1" "Gold1" "MediumOrchid1" "Seashell1"
+ "Bisque2" "Gold2" "MediumOrchid2" "Seashell2"
+ "Bisque3" "Gold3" "MediumOrchid3" "Seashell3"
+ "Bisque4" "Gold4" "MediumOrchid4" "Seashell4"
+ "Blue1" "Goldenrod1" "MediumPurple1" "Sienna1"
+ "Blue2" "Goldenrod2" "MediumPurple2" "Sienna2"
+ "Blue3" "Goldenrod3" "MediumPurple3" "Sienna3"
+ "Blue4" "Goldenrod4" "MediumPurple4" "Sienna4"
+ "Brown1" "Green1" "MistyRose1" "SkyBlue1"
+ "Brown2" "Green2" "MistyRose2" "SkyBlue2"
+ "Brown3" "Green3" "MistyRose3" "SkyBlue3"
+ "Brown4" "Green4" "MistyRose4" "SkyBlue4"
+ "Burlywood1" "Honeydew1" "NavajoWhite1" "SlateBlue1"
+ "Burlywood2" "Honeydew2" "NavajoWhite2" "SlateBlue2"
+ "Burlywood3" "Honeydew3" "NavajoWhite3" "SlateBlue3"
+ "Burlywood4" "Honeydew4" "NavajoWhite4" "SlateBlue4"
+ "CadetBlue1" "HotPink1" "OliveDrab1" "SlateGray1"
+ "CadetBlue2" "HotPink2" "OliveDrab2" "SlateGray2"
+ "CadetBlue3" "HotPink3" "OliveDrab3" "SlateGray3"
+ "CadetBlue4" "HotPink4" "OliveDrab4" "SlateGray4"
+ "Chartreuse1" "IndianRed1" "Orange1" "Snow1"
+ "Chartreuse2" "IndianRed2" "Orange2" "Snow2"
+ "Chartreuse3" "IndianRed3" "Orange3" "Snow3"
+ "Chartreuse4" "IndianRed4" "Orange4" "Snow4"
+ "Chocolate1" "Ivory1" "OrangeRed1" "SpringGreen1"
+ "Chocolate2" "Ivory2" "OrangeRed2" "SpringGreen2"
+ "Chocolate3" "Ivory3" "OrangeRed3" "SpringGreen3"
+ "Chocolate4" "Ivory4" "OrangeRed4" "SpringGreen4"
+ "Coral1" "Khaki1" "Orchid1" "SteelBlue1"
+ "Coral2" "Khaki2" "Orchid2" "SteelBlue2"
+ "Coral3" "Khaki3" "Orchid3" "SteelBlue3"
+ "Coral4" "Khaki4" "Orchid4" "SteelBlue4"
+ "Cornsilk1" "LavenderBlush1" "PaleGreen1" "Tan1"
+ "Cornsilk2" "LavenderBlush2" "PaleGreen2" "Tan2"
+ "Cornsilk3" "LavenderBlush3" "PaleGreen3" "Tan3"
+ "Cornsilk4" "LavenderBlush4" "PaleGreen4" "Tan4"
+ "Cyan1" "LemonChiffon1" "PaleTurquoise1" "Thistle1"
+ "Cyan2" "LemonChiffon2" "PaleTurquoise2" "Thistle2"
+ "Cyan3" "LemonChiffon3" "PaleTurquoise3" "Thistle3"
+ "Cyan4" "LemonChiffon4" "PaleTurquoise4" "Thistle4"
+ "DarkGoldenrod1" "LightBlue1" "PaleVioletRed1" "Tomato1"
+ "DarkGoldenrod2" "LightBlue2" "PaleVioletRed2" "Tomato2"
+ "DarkGoldenrod3" "LightBlue3" "PaleVioletRed3" "Tomato3"
+ "DarkGoldenrod4" "LightBlue4" "PaleVioletRed4" "Tomato4"
+ "DarkOliveGreen1" "LightCyan1" "PeachPuff1" "Turquoise1"
+ "DarkOliveGreen2" "LightCyan2" "PeachPuff2" "Turquoise2"
+ "DarkOliveGreen3" "LightCyan3" "PeachPuff3" "Turquoise3"
+ "DarkOliveGreen4" "LightCyan4" "PeachPuff4" "Turquoise4"
+ "DarkOrange1" "LightGoldenrod1" "Pink1" "VioletRed1"
+ "DarkOrange2" "LightGoldenrod2" "Pink2" "VioletRed2"
+ "DarkOrange3" "LightGoldenrod3" "Pink3" "VioletRed3"
+ "DarkOrange4" "LightGoldenrod4" "Pink4" "VioletRed4"
+ "DarkOrchid1" "LightPink1" "Plum1" "Wheat1"
+ "DarkOrchid2" "LightPink2" "Plum2" "Wheat2"
+ "DarkOrchid3" "LightPink3" "Plum3" "Wheat3"
+ "DarkOrchid4" "LightPink4" "Plum4" "Wheat4"
+ "DarkSeaGreen1" "LightSalmon1" "Purple1" "Yellow1"
+ "DarkSeaGreen2" "LightSalmon2" "Purple2" "Yellow2"
+ "DarkSeaGreen3" "LightSalmon3" "Purple3" "Yellow3"
+ "DarkSeaGreen4" "LightSalmon4" "Purple4" "Yellow4"
+ "DarkSlateGray1" "LightSkyBlue1" "Red1" "Gray0"
+ "DarkSlateGray2" "LightSkyBlue2" "Red2" "Green0"
+ "DarkSlateGray3" "LightSkyBlue3" "Red3" "Grey0"
+ "DarkSlateGray4" "LightSkyBlue4" "Red4" "Maroon0"
+ "DeepPink1" "LightSteelBlue1" "RosyBrown1" "Purple0"
+ "DeepPink2" "LightSteelBlue2" "RosyBrown2"
+ "DeepPink3" "LightSteelBlue3" "RosyBrown3"
+ "DeepPink4" "LightSteelBlue4" "RosyBrown4")
+ "List of colors defined by package option x11names from xcolor.sty.")
+
+(defvar LaTeX-xcolor-color-models
+ (append LaTeX-xcolor-core-color-models
+ LaTeX-xcolor-num-color-models
+ LaTeX-xcolor-pseudo-color-models)
+ "Combine three variables `LaTeX-xcolor-core-color-models',
+`LaTeX-xcolor-num-color-models' and `LaTeX-xcolor-pseudo-color-models'.")
+
+(defun LaTeX-xcolor-color-models (&optional no-named)
+ "Return the value of variable `LaTeX-xcolor-color-models'.
+If NO-NAMED is non-nil, remove \"named\" and return the
+remainder."
+ (if no-named
+ (remove "named" LaTeX-xcolor-color-models)
+ (symbol-value 'LaTeX-xcolor-color-models)))
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+;; Setup AUCTeX parser for \definecolor(set):
+(TeX-auto-add-type "xcolor-definecolor" "LaTeX")
+(TeX-auto-add-type "xcolor-definecolorset" "LaTeX")
+
+(defvar LaTeX-xcolor-definecolor-regexp
+ (eval-when-compile
+ `(,(concat "\\\\"
+ (regexp-opt '("definecolor" "providecolor"
+ "preparecolor" "colorlet"))
+ "\\(?:\\[\\(?:[^]]*\\)\\]\\)?{\\([^}]+\\)}")
+ 1 LaTeX-auto-xcolor-definecolor))
+ "Match the argument of various color defining macros from xcolor package.")
+
+(defvar LaTeX-xcolor-definecolorset-regexp
+ `(,(concat "\\\\\\(?:define\\|provide\\|prepare\\)"
+ "colorset"
+ "\\(?:\\[\\(?:[^]]*\\)\\]\\)?"
+ "{\\(?:[^}]+\\)}"
+ "{\\([^}]+\\)}"
+ "{\\([^}]+\\)}"
+ "{\\([^}]+\\)}")
+ (1 2 3) LaTeX-auto-xcolor-definecolorset)
+ "Match the argument of various color-set defining macros from
+xcolor package.")
+
+(defun LaTeX-xcolor-auto-prepare ()
+ "Clear `LaTeX-auto-xcolor-definecolor' before parsing."
+ (setq LaTeX-auto-xcolor-definecolor nil
+ LaTeX-auto-xcolor-definecolorset nil))
+
+(defun LaTeX-xcolor-auto-cleanup ()
+ "Process the parsed elements from `LaTeX-auto-xcolor-definecolorset'."
+ (dolist (colset (LaTeX-xcolor-definecolorset-list))
+ (let ((head (car colset))
+ (tail (cadr colset))
+ (cols (split-string
+ (TeX-replace-regexp-in-string "[ %\n\r\t]" "" (nth 2 colset))
+ "\\(,[^;]+;\\|,[^;]+$\\)" t)))
+ (dolist (color cols)
+ (LaTeX-add-xcolor-definecolors (concat head color tail))))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-xcolor-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-xcolor-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun TeX-arg-xcolor-definecolor (optional)
+ "Insert arguments of \\definecolor and similar macros from
+xcolor.sty."
+ ;; \definecolor[<type>]{<name>}{<model-list>}{<spec-list>}
+ (let* ((xcoltype (completing-read
+ (TeX-argument-prompt t nil "Type")
+ LaTeX-xcolor-type-color-models))
+ (xcolname (TeX-read-string
+ (TeX-argument-prompt optional nil "Color name")))
+ (xcolmodel (completing-read
+ (TeX-argument-prompt optional nil "Model (list)")
+ (if (string= xcoltype "named")
+ (LaTeX-xcolor-color-models t)
+ LaTeX-xcolor-color-models)))
+ (xcolspec (if (string= xcolmodel "named")
+ (completing-read
+ (TeX-argument-prompt optional nil "Color")
+ (LaTeX-xcolor-definecolor-list))
+ (TeX-read-string
+ (TeX-argument-prompt optional nil (concat xcolmodel " spec (list)"))))))
+ (when (and xcoltype (not (string= xcoltype "")))
+ (insert (format "[%s]" xcoltype)))
+ (TeX-argument-insert xcolname optional)
+ (LaTeX-add-xcolor-definecolors xcolname)
+ (TeX-argument-insert xcolmodel optional)
+ (TeX-argument-insert xcolspec optional)))
+
+(defun TeX-arg-xcolor-definecolorset (optional)
+ "Insert arguments of \\definecolorset and similar macros from
+xcolor.sty."
+ (let ((xcoltype (completing-read
+ (TeX-argument-prompt t nil "Type")
+ LaTeX-xcolor-type-color-models))
+ (xcolmodel (completing-read
+ (TeX-argument-prompt optional nil "Model")
+ (LaTeX-xcolor-color-models t))))
+ (when (and xcoltype (not (string= xcoltype "")))
+ (insert (format "[%s]" xcoltype)))
+ (TeX-argument-insert xcolmodel optional)))
+
+(defun TeX-arg-xcolor (optional)
+ "Insert arguments of various color commands from xcolor.sty."
+ ;; \color{<name>} or \color[<model-list>]{<spec-list>}
+ (let* ((xcolmodel (completing-read
+ (TeX-argument-prompt t nil "Model (list)")
+ (LaTeX-xcolor-color-models t)))
+ (xcolor (if (and xcolmodel (not (string= xcolmodel "")))
+ (TeX-read-string
+ (TeX-argument-prompt optional nil (concat xcolmodel " spec (list)")))
+ (completing-read
+ (TeX-argument-prompt optional nil "Color")
+ (LaTeX-xcolor-definecolor-list)))))
+ (when (and xcolmodel (not (string= xcolmodel "")))
+ (insert (format "[%s]" xcolmodel)))
+ (TeX-argument-insert xcolor optional)))
+
+(defun TeX-arg-xcolor-fcolorbox (optional)
+ "Insert arguments of \\fcolorbox from xcolor.sty."
+ ;;\fcolorbox[<frame model>]{<frame spec>}[<background model>]{<background spec>}{<text>}
+ (let* ((xfrmodel (completing-read
+ (TeX-argument-prompt t nil "(Frame) Color model")
+ LaTeX-xcolor-color-models))
+ (xfrspec (if (or (string= xfrmodel "")
+ (string= xfrmodel "named"))
+ (completing-read
+ (TeX-argument-prompt optional nil "Frame color spec")
+ (LaTeX-xcolor-definecolor-list))
+ (TeX-read-string
+ (TeX-argument-prompt optional nil "Frame color spec"))))
+ (xbgmodel (completing-read
+ (TeX-argument-prompt t nil "Background Color model")
+ LaTeX-xcolor-color-models))
+ (xbgspec (if (or (string= xfrmodel "")
+ (string= xfrmodel "named")
+ (string= xbgmodel "")
+ (string= xbgmodel "named"))
+ (completing-read
+ (TeX-argument-prompt optional nil "Background color spec")
+ (LaTeX-xcolor-definecolor-list))
+ (TeX-read-string
+ (TeX-argument-prompt optional nil "Background color spec")))))
+ (when (and xfrmodel (not (string= xfrmodel "")))
+ (insert (format "[%s]" xfrmodel)))
+ (TeX-argument-insert xfrspec optional)
+ (when (and xbgmodel (not (string= xbgmodel "")))
+ (insert (format "[%s]" xbgmodel)))
+ (TeX-argument-insert xbgspec optional)))
+
+
+(TeX-add-style-hook
+ "xcolor"
+ (lambda ()
+ ;; Add color to the parser.
+ (TeX-auto-add-regexp LaTeX-xcolor-definecolor-regexp)
+ (TeX-auto-add-regexp LaTeX-xcolor-definecolorset-regexp)
+
+ ;; Add list of colors which are always available.
+ (apply #'LaTeX-add-xcolor-definecolors LaTeX-xcolor-base-colors)
+
+ ;; Add dvips colors in conjunction with `dvipsnames*?'.
+ (when (or (LaTeX-provided-package-options-member "xcolor" "dvipsnames")
+ (LaTeX-provided-package-options-member "xcolor" "dvipsnames*"))
+ (apply #'LaTeX-add-xcolor-definecolors LaTeX-xcolor-dvipsnames-colors))
+
+ ;; For `svgnames*?'
+ (when (or (LaTeX-provided-package-options-member "xcolor" "svgnames")
+ (LaTeX-provided-package-options-member "xcolor" "svgnames*"))
+ (apply #'LaTeX-add-xcolor-definecolors LaTeX-xcolor-svgnames-colors))
+
+ ;; For `x11ames*?'
+ (when (or (LaTeX-provided-package-options-member "xcolor" "x11names")
+ (LaTeX-provided-package-options-member "xcolor" "x11names*"))
+ (apply #'LaTeX-add-xcolor-definecolors LaTeX-xcolor-x11names-colors))
+
+ (TeX-add-symbols
+ ;; 2.5.2 Color definition in xcolor
+ ;; \definecolor[<type>]{<name>}{<model-list>}{<spec-list>}
+ '("definecolor" TeX-arg-xcolor-definecolor)
+
+ ;; \providecolor[<type>]{<name>}{<model-list>}{<spec-list>}
+ '("providecolor" TeX-arg-xcolor-definecolor)
+
+ ;; \colorlet[<type>]{<name>}[<num model>]{<color>}
+ '("colorlet"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Type")
+ LaTeX-xcolor-type-color-models ]
+ (TeX-arg-eval
+ (lambda ()
+ (let ((xcolor (TeX-read-string
+ (TeX-argument-prompt optional nil "Color"))))
+ (LaTeX-add-xcolor-definecolors xcolor)
+ (format "%s" xcolor))))
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Model")
+ (LaTeX-xcolor-color-models t) ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color")
+ (LaTeX-xcolor-definecolor-list)))
+
+ ;; 2.5.3 Defining sets of colors
+ ;; \definecolorset[<type>]{<model-list>}{<head>}{<tail>}{<set spec>}
+ '("definecolorset" TeX-arg-xcolor-definecolorset "Head" "Tail" t)
+
+ ;; \providecolorset[<type>]{<model-list>}{<head>}{<tail>}{<set spec>}
+ '("providecolorset" TeX-arg-xcolor-definecolorset "Head" "Tail" t)
+
+ ;; 2.5.4 Immediate and deferred definitions
+ ;; \preparecolor[<type>]{<name>}{<model-list>}{<spec-list>}
+ '("preparecolor" TeX-arg-xcolor-definecolor)
+
+ ;; \preparecolorset[<type>]{<model-list>}{<head>}{<tail>}{<set spec>}
+ '("preparecolorset" TeX-arg-xcolor-definecolorset "Head" "Tail" t)
+
+ ;; \definecolors{<id-list>}
+ '("definecolors" t)
+
+ ;; \providecolors{<id-list>}
+ '("providecolors" t)
+
+ ;; 2.6 Color application
+ ;; 2.6.1 Standard color commands
+
+ ;; \color{<name>} or \color[<model>]{<color spec>}
+ '("color" TeX-arg-xcolor)
+
+ ;; \textcolor{<name>}{<text>} or
+ ;; \textcolor[<model>]{<color spec>}{<text>}
+ '("textcolor" TeX-arg-xcolor "Text")
+
+ ;; \pagecolor{<name>} or
+ ;; \pagecolor[<model>]{<color spec>}
+ '("pagecolor" TeX-arg-xcolor)
+
+ ;; \nopagecolor
+ '("nopagecolor" 0)
+
+ ;; 2.6.2 Colored boxes
+ ;; \colorbox{<name>}{<text>} or
+ ;; \colorbox[<model>]{<color spec>}{<text>}
+ '("colorbox" TeX-arg-xcolor "Text")
+
+ ;; \fcolorbox{<frame color>}{<box color>}{<text>} or
+ ;; \fcolorbox[<model>]{<frame spec>}{<background spec>}{<text>} or
+ ;; \fcolorbox[<frame model>]{<frame spec>}[<background model>]{<background spec>}{<text>}
+ '("fcolorbox" TeX-arg-xcolor-fcolorbox "Text")
+
+ ;; 2.6.4 Color testing
+ ;; \testcolor{<name>} or
+ ;; \testcolor[<model>]{<color spec>}
+ '("testcolor" TeX-arg-xcolor)
+
+ ;; 2.7 Color blending
+ '("blendcolors"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Mix expr")
+ (LaTeX-xcolor-definecolor-list)))
+ '("blendcolors*"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Mix expr")
+ (LaTeX-xcolor-definecolor-list)))
+
+ ;; 2.8 Color masks and separation
+ '("maskcolors"
+ [ TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Model")
+ (LaTeX-xcolor-color-models t) ]
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color")
+ (LaTeX-xcolor-definecolor-list)))
+
+ ;; 2.9 Color series
+ '("definecolorseries"
+ "Name"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Core model")
+ LaTeX-xcolor-core-color-models)
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Method")
+ '("step" "grad" "last"))
+ [ t ] nil [ nil ] nil)
+
+ '("resetcolorseries" [ "Div." ] "Name")
+
+ ;; 2.13 Color information
+ ;; \extractcolorspec{<color>}{<cmd>}
+ '("extractcolorspec"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color")
+ (LaTeX-xcolor-definecolor-list))
+ (TeX-arg-define-macro "Command: \\"))
+
+ ;; \extractcolorspecs{<color>}{<model-cmd>}{<color-cmd>}
+ '("extractcolorspecs"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Color")
+ (LaTeX-xcolor-definecolor-list))
+ (TeX-arg-define-macro "Model command: \\")
+ (TeX-arg-define-macro "Color command: \\"))
+
+ ;; \tracingcolors = <integer>
+ '("tracingcolors"
+ (TeX-arg-literal "="))
+
+ ;; 2.14 Color conversion
+ ;; \convertcolorspec{<model>}{<spec>}{<target model>}{cmd>}
+ '("convertcolorspec"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Model")
+ (LaTeX-xcolor-color-models))
+ (TeX-arg-eval TeX-read-string
+ (TeX-argument-prompt optional nil "Spec"))
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Model")
+ (LaTeX-xcolor-color-models t))
+ (TeX-arg-define-macro "Macro: \\")) ) ; close TeX-add-symbols
+
+ ;; 2.12 Color in tables
+ ;; These commands are available with `table' package option
+ (when (LaTeX-provided-package-options-member "xcolor" "table")
+ ;; Run style hook to colortbl.sty
+ (TeX-run-style-hooks "colortbl")
+
+ ;; Add additional commands:
+ (TeX-add-symbols
+ ;; \rowcolors[<commands>]{<row>}{<odd-row color>}{<even-row color>}
+ '("rowcolors"
+ (TeX-arg-conditional (y-or-n-p "With optional commands? ")
+ ( [ t ] )
+ (ignore))
+ "Row"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Odd-row color")
+ (LaTeX-xcolor-definecolor-list))
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Even-row color")
+ (LaTeX-xcolor-definecolor-list)))
+ '("rowcolors*"
+ (TeX-arg-conditional (y-or-n-p "With optional commands? ")
+ ( [ t ] )
+ (ignore))
+ "Row"
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Odd-row color")
+ (LaTeX-xcolor-definecolor-list))
+ (TeX-arg-eval completing-read
+ (TeX-argument-prompt optional nil "Even-row color")
+ (LaTeX-xcolor-definecolor-list)))
+ '("showrowcolors" 0)
+ '("hiderowcolors" 0))
+ (LaTeX-add-counters "rownum"))
+
+ ;; 2.6.4 Color testing
+ (LaTeX-add-environments
+ '("testcolors" LaTeX-env-args
+ [ TeX-arg-eval mapconcat #'identity
+ (TeX-completing-read-multiple
+ (TeX-argument-prompt optional nil "Color models")
+ (LaTeX-xcolor-color-models t))
+ "," ] ))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("color" "[{")
+ ("pagecolor" "[{"))
+ 'type-declaration)
+ (font-latex-add-keywords '(("textcolor" "[{{")
+ ("colorbox" "[{{" )
+ ("fcolorbox" "[{[{{"))
+ 'type-command)
+ (font-latex-add-keywords '(("definecolor" "[{{{")
+ ("providecolor" "[{{{")
+ ("colorlet" "[{[{")
+ ("definecolorset" "[{{{{")
+ ("providecolorset" "[{{{{")
+ ("preparecolor" "[{{{")
+ ("preparecolorset" "[{{{{")
+ ("definecolors" "{")
+ ("providecolors" "{")
+ ("testcolor" "[{")
+ ("blendcolors" "*{")
+ ("maskcolors" "[{")
+ ("definecolorseries" "{{{[{[{")
+ ("resetcolorseries" "[{")
+ ("extractcolorspec" "{{")
+ ("extractcolorspecs" "{{{")
+ ("convertcolorspec" "{{{{")
+ ("rowcolors" "*[{{{"))
+ 'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-xcolor-package-options
+ '(;; options that determine the color driver
+ "dvips" "xdvi" "dvipdf" "dvipdfm" "dvipdfmx" "pdftex" "dvipsone"
+ "dviwindo" "emtex" "dviwin" "oztex" "textures" "pctexps" "pctexwin"
+ "pctexhp" "pctex32" "truetex" "tcidvi" "vtex" "xetex"
+
+ ;; options that determine the target color model
+ "natural" "rgb" "cmy" "cmyk" "hsb" "gray" "RGB" "HTML"
+ "HSB" "Gray" "monochrome"
+
+ ;; options that control predefined colors loading
+ "dvipsnames" "dvipsnames*" "svgnames" "svgnames*" "x11names" "x11names*"
+
+ ;; options that determine which other packages to load
+ "table" "fixpdftex" "hyperref"
+
+ ;; options that influence the behaviour of other commands
+ "prologue" "kernelfbox" "xcdraw" "noxcdraw" "fixinclude"
+ "showerrors" "hideerrors")
+ "Package options for the xcolor package.")
+
+;;; xcolor.el ends here
--- /dev/null
+;;; xltabular.el --- AUCTeX style for `xltabular.sty' (v0.05)
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2017-11-03
+;; 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 `xltabular.sty' (v0.05) from 2017/10/26.
+;; `xltabular.sty' is part of TeXLive.
+
+(defvar LaTeX-xltabular-skipping-regexp
+ (concat "[ \t]*" (regexp-opt '("[l]" "[r]" "[c]" "")) "[ \t]*{[^}]*}[ \t]*")
+ "Regexp matching between \\begin{xltabular} and column specification.
+For xltabular environment only. See `LaTeX-insert-ampersands' for detail.
+
+This regexp assumes that the width specification contains neither
+nested curly brace pair nor escaped \"}\".")
+
+(defun LaTeX-env-xltabular (environment)
+ "Insert a xltabular ENVIRONMENT with spec, caption and label."
+ ;; xltabular has the following syntax:
+ ;; \begin{xltabular}[hPos]{width}{ l X ...}
+ ;; Optional <hPos> comes before <width>, hence we cannot use
+ ;; `LaTeX-env-tabular*' here and has to cook our own function which
+ ;; is a combination of `LaTeX-env-tabular*' and
+ ;; `LaTeX-env-longtable':
+ (let* ((pos (completing-read (TeX-argument-prompt t nil "Position")
+ '("l" "r" "c")))
+ (width (TeX-read-string "Width: " LaTeX-default-width))
+ (fmt (TeX-read-string "Format: " LaTeX-default-format))
+ (caption (TeX-read-string "Caption: "))
+ (short-caption (when (>= (length caption) LaTeX-short-caption-prompt-length)
+ (TeX-read-string "(Optional) Short caption: "))))
+ (setq LaTeX-default-format fmt)
+ (LaTeX-insert-environment environment
+ (concat
+ (unless (zerop (length pos))
+ (concat LaTeX-optop pos LaTeX-optcl))
+ (concat TeX-grop width TeX-grcl)
+ (concat TeX-grop fmt TeX-grcl)))
+ ;; top caption -- do nothing if user skips caption
+ (unless (zerop (length caption))
+ ;; insert `\caption[short-caption]{caption':
+ (insert TeX-esc "caption")
+ (when (and short-caption (not (string= short-caption "")))
+ (insert LaTeX-optop short-caption LaTeX-optcl))
+ (insert TeX-grop caption)
+ ;; ask for a label and insert it
+ (LaTeX-label environment 'environment)
+ ;; the longtable `\caption' is equivalent to a
+ ;; `\multicolumn', so it needs a `\\' at the
+ ;; end of the line. Prior to that, add } to
+ ;; close `\caption{'
+ (insert TeX-grcl "\\\\")
+ ;; fill the caption
+ (LaTeX-fill-paragraph)
+ ;; Insert a new line and indent
+ (LaTeX-newline)
+ (indent-according-to-mode))
+ ;; Insert suitable number of &'s, suppress line break
+ (LaTeX-item-xltabular t)))
+
+(defun LaTeX-item-xltabular (&optional suppress)
+ "Insert line break macro on the last line and suitable number of &'s.
+For xltabular environment only.
+
+If SUPPRESS is non-nil, do not insert line break macro."
+ (unless suppress
+ (save-excursion
+ (end-of-line 0)
+ (just-one-space)
+ (TeX-insert-macro "\\")))
+ (LaTeX-insert-ampersands
+ LaTeX-xltabular-skipping-regexp #'LaTeX-array-count-columns))
+
+(TeX-add-style-hook
+ "xltabular"
+ (lambda ()
+ ;; ltablex loads both tabularx and longtable
+ (TeX-run-style-hooks "ltablex")
+
+ ;; Add xltabular with `LaTeX-env-xltabular'::
+ (LaTeX-add-environments '("xltabular" LaTeX-env-xltabular))
+
+ ;; Use the enhanced table formatting. Append to
+ ;; `LaTeX-indent-environment-list' in order not to override custom settings.
+ (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
+ '("xltabular" LaTeX-indent-tabular) t)
+
+ ;; Append xltabular to `LaTeX-label-alist', in order not to
+ ;; override possible custome values.
+ (add-to-list 'LaTeX-label-alist '("xltabular" . LaTeX-table-label) t)
+
+ ;; Append xltabular to `LaTeX-item-list' with `LaTeX-item-xltabular'
+ (add-to-list 'LaTeX-item-list '("xltabular" . LaTeX-item-xltabular) t)
+
+ ;; Tell RefTeX -- This is the same entry as for "longtable" in
+ ;; `reftex-label-alist-builtin':
+ (when (fboundp 'reftex-add-label-environments)
+ (reftex-add-label-environments
+ '(("xltabular" ?t nil nil caption)))))
+ LaTeX-dialect)
+
+(defvar LaTeX-xltabular-package-options nil
+ "Package options for the xltabular package.")
+
+;;; xltabular.el ends here
--- /dev/null
+;;; zlmtt.el --- AUCTeX style for `zlmtt.sty' (v1.01)
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2014-10-31
+;; 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 `zlmtt.sty' (v1.01) from 2014/06/28.
+;; `zlmtt.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "zlmtt"
+ (lambda ()
+
+ ;; New symbols
+ (TeX-add-symbols
+ '("proptt" t) ; proportional typewriter
+ '("monott" t) ; monospace typewriter
+ '("lctt" t)) ; light condensed typewriter
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("proptt" "{")
+ ("monott" "{")
+ ("lctt" "{"))
+ 'type-command)))
+ LaTeX-dialect)
+
+(defvar LaTeX-zlmtt-package-options
+ '("light" "l" "lightcondensed" "lc" "med" "m"
+ "proportional" "p" "scaled")
+ "Package options for the zlmtt package.")
+
+;;; zlmtt.el ends here