"Fossies" - the Fresh Open Source Software Archive

Member "auctex-12.3/style/preview.el" (18 Oct 2020, 3168 Bytes) of package /linux/misc/auctex-12.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lisp source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "preview.el": 12.2_vs_12.3.

    1 ;;; preview.el --- AUCTeX style for `preview.sty' (v2010/02/14)
    2 
    3 ;; Copyright (C) 2017, 2018 Free Software Foundation, Inc.
    4 
    5 ;; Author: Arash Esbati <arash@gnu.org>
    6 ;; Maintainer: auctex-devel@gnu.org
    7 ;; Created: 2017-02-05
    8 ;; Keywords: tex
    9 
   10 ;; This file is part of AUCTeX.
   11 
   12 ;; AUCTeX is free software; you can redistribute it and/or modify it
   13 ;; under the terms of the GNU General Public License as published by
   14 ;; the Free Software Foundation; either version 3, or (at your option)
   15 ;; any later version.
   16 
   17 ;; AUCTeX is distributed in the hope that it will be useful, but
   18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
   19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   20 ;; General Public License for more details.
   21 
   22 ;; You should have received a copy of the GNU General Public License
   23 ;; along with AUCTeX; see the file COPYING.  If not, write to the Free
   24 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   25 ;; 02110-1301, USA.
   26 
   27 ;;; Commentary:
   28 
   29 ;; This file adds support for `preview.sty' v2010/02/14.
   30 ;; `preview.sty' is part of TeXLive.
   31 
   32 ;;; Code:
   33 
   34 ;; Silence the compiler:
   35 (declare-function font-latex-add-keywords
   36           "font-latex"
   37           (keywords class))
   38 
   39 (defun LaTeX-preview-arg-ifpreview (_optional)
   40   "Insert \\else and \\fi part of \\ifPreview command from preview.sty.
   41 OPTIONAL is ignored."
   42   (indent-according-to-mode)
   43   (LaTeX-newline)
   44   (indent-according-to-mode)
   45   (save-excursion
   46     (LaTeX-newline)
   47     (indent-according-to-mode)
   48     (insert TeX-esc "else")
   49     (LaTeX-newline)
   50     (LaTeX-newline)
   51     (indent-according-to-mode)
   52     (insert TeX-esc "fi")))
   53 
   54 (TeX-add-style-hook
   55  "preview"
   56  (lambda ()
   57 
   58    (LaTeX-add-environments
   59     '("preview")
   60     '("nopreview"))
   61 
   62    (TeX-add-symbols
   63     '("PreviewMacro" (TeX-arg-conditional (y-or-n-p "With optional arguments? ")
   64                       ( [ t ] [ nil ] )
   65                     ())
   66       TeX-arg-macro)
   67 
   68     '("PreviewMacro*" (TeX-arg-conditional (y-or-n-p "With optional arguments? ")
   69                        ( [ t ] [ nil ] )
   70                      ())
   71       TeX-arg-macro)
   72 
   73     '("PreviewEnvironment" (TeX-arg-conditional (y-or-n-p "With optional arguments? ")
   74                         ( [ t ] [ nil ] )
   75                           ())
   76       TeX-arg-environment)
   77 
   78     '("PreviewEnvironment*" (TeX-arg-conditional (y-or-n-p "With optional arguments? ")
   79                          ( [ t ] [ nil ] )
   80                            ())
   81       TeX-arg-environment)
   82 
   83     '("PreviewSnarfEnvironment" TeX-arg-environment)
   84 
   85     '("PreviewOpen")
   86     '("PreviewClose")
   87 
   88     '("ifPreview" LaTeX-preview-arg-ifpreview))
   89 
   90    ;; Fontification
   91    (when (and (featurep 'font-latex)
   92           (eq TeX-install-font-lock 'font-latex-setup))
   93      (font-latex-add-keywords '(("PreviewMacro"            "*[[{")
   94                 ("PreviewEnvironment"      "*[[{")
   95                 ("PreviewSnarfEnvironment" "[{"))
   96                   'function)))
   97  LaTeX-dialect)
   98 
   99 (defvar LaTeX-preview-package-options
  100   '("active"      "noconfig"   "psfixbb"
  101     "dvips"       "pdftex"     "xetex"
  102     "displaymath" "floats"     "textmath"
  103     "graphics"    "sections"   "delayed"
  104     "auctex"      "showlabels" "tightpage"
  105     "lyx"         "counters"   "footnotes"
  106     "tracingall"  "showbox")
  107   "Package options for the preview package.")
  108 
  109 ;;; preview.el ends here