branch: externals/auctex commit 57344416f1a467464c4e64fe48daa670e15ea5e7 Author: Arash Esbati <esb...@gmx.de> Commit: Mosè Giordano <m...@gnu.org>
Add new styles. * Makefile.in (STYLESRC): Add new styles. * style/relsize.el: New file. * style/wrapfig.el: New file. Signed-off-by: Mosè Giordano <m...@gnu.org> --- ChangeLog | 6 +++ Makefile.in | 3 +- style/relsize.el | 69 +++++++++++++++++++++++++++++++++++ style/wrapfig.el | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 184 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 72dbba8..ef0de5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2014-12-30 Arash Esbati <esb...@gmx.de> + * Makefile.in (STYLESRC): Add new styles. + + * style/relsize.el: New file. + + * style/wrapfig.el: New file. + * style/hyperref.el ("hyperref"): Add `Form' environment needed for PDF and HTML forms. (LaTeX-hyperref-forms-options): New variable for key-val options diff --git a/Makefile.in b/Makefile.in index 998e730..39402e7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -142,7 +142,8 @@ STYLESRC = style/prosper.el \ style/XCharter.el style/zlmtt.el style/ifluatex.el \ style/luatextra.el style/erewhon.el style/baskervaldx.el \ style/fbb.el style/newtxmath.el style/newtxsf.el \ - style/newtxtext.el style/newtxttt.el style/minted.el + style/newtxtext.el style/newtxttt.el style/minted.el \ + style/wrapfig.el style/relsize.el STYLEELC = $(STYLESRC:.el=.elc) ifeq (@preview_enabled@,yes) diff --git a/style/relsize.el b/style/relsize.el new file mode 100644 index 0000000..20dc975 --- /dev/null +++ b/style/relsize.el @@ -0,0 +1,69 @@ +;;; relsize.el --- AUCTeX style for `relsize.sty' version v4.1 + +;; Copyright (C) 2014 Free Software Foundation, Inc. + +;; Author: Arash Esbati <esbati'at'gmx.de> +;; Maintainer: auctex-de...@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 diff --git a/style/wrapfig.el b/style/wrapfig.el new file mode 100644 index 0000000..bcb90c2 --- /dev/null +++ b/style/wrapfig.el @@ -0,0 +1,107 @@ +;;; wrapfig.el --- AUCTeX style for `wrapfig.sty' version v3.6 + +;; Copyright (C) 2014 Free Software Foundation, Inc. + +;; Author: Arash Esbati <esbati'at'gmx.de> +;; Maintainer: auctex-de...@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 (read-string "(Optional) Number of narrow lines: ")) + (placement (completing-read + "Placement: " '(("r") ("R") + ("l") ("L") + ("i") ("I") + ("o") ("O")))) + (overhang (read-string "(Optional) Overhang: ")) + (width (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 (read-string "(Optional) Number of narrow lines: ")) + (placement (completing-read + "Placement: " '(("r") ("R") + ("l") ("L") + ("i") ("I") + ("o") ("O")))) + (overhang (read-string "(Optional) Overhang: ")) + (width (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} + '("wrapfloat" + (lambda (env &rest ignore) + (LaTeX-insert-environment + env + (let ((floattype (read-string "Float type: ")) + (narrow (read-string "(Optional) Number of narrow lines: ")) + (placement (completing-read + "Placement: " '(("r") ("R") + ("l") ("L") + ("i") ("I") + ("o") ("O")))) + (overhang (read-string "(Optional) Overhang: ")) + (width (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