"Fossies" - the Fresh Open Source Software Archive

Member "auctex-12.3/style/fancyhdr.el" (18 Oct 2020, 4439 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 "fancyhdr.el": 12.2_vs_12.3.

    1 ;;; fancyhdr.el --- AUCTeX style for `fancyhdr.sty'
    2 
    3 ;; Copyright (C) 2012, 2013, 2018, 2020 Free Software Foundation, Inc.
    4 
    5 ;; Author: Mads Jensen <mje@inducks.org>
    6 ;; Maintainer: auctex-devel@gnu.org
    7 ;; Keywords: tex
    8 
    9 ;; This file is part of AUCTeX.
   10 
   11 ;; AUCTeX is free software; you can redistribute it and/or modify it
   12 ;; under the terms of the GNU General Public License as published by
   13 ;; the Free Software Foundation; either version 3, or (at your option)
   14 ;; any later version.
   15 
   16 ;; AUCTeX is distributed in the hope that it will be useful, but
   17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
   18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   19 ;; General Public License for more details.
   20 
   21 ;; You should have received a copy of the GNU General Public License
   22 ;; along with AUCTeX; see the file COPYING.  If not, write to the Free
   23 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   24 ;; 02110-1301, USA.
   25 
   26 ;;; Commentary:
   27 
   28 ;; This file adds support for `fancyhdr.sty', version 3.2
   29 
   30 ;;; Code:
   31 
   32 ;; Silence the compiler:
   33 (declare-function font-latex-add-keywords
   34           "font-latex"
   35           (keywords class))
   36 
   37 (TeX-add-style-hook
   38  "fancyhdr"
   39  (lambda ()
   40    (TeX-add-symbols
   41     '("lhead" t)
   42     '("lfoot" t)
   43     '("chead" t)
   44     '("cfoot" t)
   45     '("rhead" t)
   46     '("rfoot" t)
   47     '("nouppercase" t)
   48     '("MakeUppercase" t)
   49     '("fancyhead" [ TeX-arg-fancyhdr-position ] t)
   50     '("fancyfoot" [ TeX-arg-fancyhdr-position ] t)
   51     '("fancyheadoffset"
   52       [ (TeX-arg-fancyhdr-position
   53          "Position" ("LO" "LE" "L" "RE" "RO" "R" "0")) ] t)
   54     '("fancyfootoffset"
   55       [ (TeX-arg-fancyhdr-position
   56          "Position" ("LO" "LE" "L" "RE" "RO" "R" "O")) ] t)
   57     '("fancyhfoffset"
   58       [ (TeX-arg-fancyhdr-position "Position" ("E" "O" "L" "R")) ] t)
   59     '("fancypagestyle" TeX-arg-pagestyle t)
   60 
   61     "headrulewidth" "footrulewidth" "plainfootrulewidth"
   62     "plainheadrulewidth" "leftmark" "rightmark"
   63     ;; the manual does not mention any subsubsectionmark (!)
   64     "chaptermark" "sectionmark" "subsectionmark" "paragraphmark"
   65     "subparagraphmark" "footrule" "headrule")
   66 
   67    ;; `fancyhdr.sty' supplies these two pagestyles
   68    (LaTeX-add-pagestyles "fancy" "fancyplain")
   69 
   70    ;; Fontification
   71    (when (and (fboundp 'font-latex-add-keywords)
   72           (eq TeX-install-font-lock 'font-latex-setup))
   73      (font-latex-add-keywords '(("fancyhead" "[{")
   74                                 ("fancyfoot" "[{")
   75                                 ("lhead" "{")
   76                                 ("lfoot" "{")
   77                                 ("chead" "{")
   78                                 ("cfoot" "{")
   79                                 ("rhead" "{")
   80                                 ("rfoot" "{")
   81                                 ("fancyheadoffset" "[{")
   82                                 ("fancyfootoffset" "[{")
   83                                 ("fancypagestyle" "{{")) 'function)
   84      (font-latex-add-keywords '(("headrulewidth" "")
   85                                 ("footrulewidth" "")
   86                                 ("plainheadrulewidth" "")
   87                                 ("plainfootrulewidth" "")) 'variable)))
   88  LaTeX-dialect)
   89 
   90 ;; Because there can be many positions, `TeX-completing-read-multiple' is used
   91 ;; instead of just `completing-read', and a `collection' argument is provided as
   92 ;; the list of positions differs between the macros
   93 (defun TeX-arg-fancyhdr-position (optional &optional prompt collection)
   94   "Prompt for a fancyhdr position with completion.
   95 If OPTIONAL is non-nil, insert the resulting value as an optional
   96 argument, otherwise as a mandatory one.  If non-nil, PROMPT is
   97 used as the prompt.  If non-nil, COLLECTION is used as the
   98 completion list for the position."
   99   (let* ((positions (if (not collection)
  100                         ;; Standard positions with no restrictions.  Lower-case
  101                         ;; versions, and reverse versions (e.g., OC) are left
  102                         ;; out for simplicity.
  103                         '("LO" "LE" "L" "CO" "CE" "C" "RE" "RO" "R")
  104                       collection))
  105         (arguments
  106          (mapconcat 'identity
  107                     (TeX-completing-read-multiple
  108                      (TeX-argument-prompt optional prompt "Position")
  109                      (mapcar 'list positions)) ",")))
  110     (TeX-argument-insert arguments optional)))
  111 
  112 (defvar LaTeX-fancyhdr-package-options nil
  113   "Package options for fancyhdr.")
  114 
  115 ;;; fancyhdr.el ends here
  116