1 ;;; foils.el - Special code for FoilTeX.
3 ;; Copyright (C) 1994-2014 Free Software Foundation, Inc.
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6 ;; Maintainer: auctex-devel@gnu.org
9 ;; This file is part of AUCTeX.
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 the
13 ;; Free Software Foundation; either version 3, or (at your option) any
16 ;; AUCTeX is distributed in the hope that it will be useful, but WITHOUT
17 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with AUCTeX. If not, see <http://www.gnu.org/licenses/>.
28 (TeX-add-style-hook "foils"
31 (add-hook 'LaTeX-document-style-hook 'LaTeX-style-foils)
32 (setq LaTeX-default-style "foils")
33 (setq LaTeX-default-options '("landscape"))
35 '("foilhead" [ "Rubric-body separation" ] "Foil rubric"))))
38 (defun LaTeX-style-foils nil
39 "Prompt for and insert foiltex options."
40 (let* ((date (timezone-parse-date (current-time-string)))
41 (year (string-to-number (aref date 0)))
42 (month (string-to-number (aref date 1)))
43 (day (string-to-number (aref date 2)))
44 (title (TeX-read-string "Title: ")))
46 (goto-char (point-max))
47 (re-search-backward ".begin.document.")
48 (insert TeX-esc "title"
49 TeX-grop title TeX-grcl "\n")
50 (insert TeX-esc "author"
51 TeX-grop (user-full-name) TeX-grcl "\n")
52 (insert TeX-esc "date" TeX-grop
53 (format "%d-%02d-%02d" year month day)
55 (insert "" TeX-esc "MyLogo" TeX-grop TeX-grcl "\n")
56 (insert "%" TeX-esc "Restriction" TeX-grop TeX-grcl "\n")
57 (insert "%" TeX-esc "rightfooter" TeX-grop TeX-grcl "\n")
58 (insert "%" TeX-esc "leftheader" TeX-grop TeX-grcl "\n")
59 (insert "%" TeX-esc "rightheader" TeX-grop TeX-grcl "\n\n")
60 (re-search-forward ".begin.document.")
63 (insert "" TeX-esc "maketitle\n\n"))
66 ;;; foils.el ends here