emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/auctex f708e1b 29/95: Add new style/preview.el


From: Tassilo Horn
Subject: [elpa] externals/auctex f708e1b 29/95: Add new style/preview.el
Date: Sun, 16 Apr 2017 01:26:49 -0400 (EDT)

branch: externals/auctex
commit f708e1b1a5766cd8e51df333b1e19abeb83bd8d7
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>

    Add new style/preview.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/preview.el: New file.
---
 Makefile.in      |   2 +-
 style/preview.el | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+), 1 deletion(-)

diff --git a/Makefile.in b/Makefile.in
index 19ef2ab..424bc1d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -163,7 +163,7 @@ STYLESRC = style/prosper.el \
           style/bicaption.el style/amsfonts.el  style/subfiles.el \
           style/dcolumn.el   style/mdframed.el  style/tcolorboxlib-raster.el \
           style/titleps.el   style/titlesec.el  style/titletoc.el \
-          style/exam.el      style/breqn.el
+          style/exam.el      style/breqn.el     style/preview.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/preview.el b/style/preview.el
new file mode 100644
index 0000000..26987e1
--- /dev/null
+++ b/style/preview.el
@@ -0,0 +1,104 @@
+;;; preview.el --- AUCTeX style for `preview.sty' (v2010/02/14)
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <address@hidden>
+;; Maintainer: address@hidden
+;; 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]