118
|
1 ;;; foils.el - Special code for FoilTeX.
|
|
2
|
|
3 ;; $Id: foils.el,v 1.1 1997/04/05 17:56:45 steve Exp $
|
|
4
|
|
5 ;;; Code:
|
|
6
|
|
7 (require 'latex)
|
|
8
|
|
9 (TeX-add-style-hook "foils"
|
|
10 (function
|
|
11 (lambda ()
|
|
12 (add-hook 'LaTeX-document-style-hook 'LaTeX-style-foils)
|
|
13 (setq LaTeX-default-style "foils")
|
|
14 (setq LaTeX-default-options '("landscape"))
|
|
15 (TeX-add-symbols
|
|
16 '("foilhead" [ "Rubric-body separation" ] "Foil rubric")))))
|
|
17
|
|
18 (defun LaTeX-style-foils nil
|
|
19 "Prompt for and insert foiltex options."
|
|
20 (require 'timezone)
|
|
21 (let* ((date (timezone-parse-date (current-time-string)))
|
|
22 (year (string-to-int (aref date 0)))
|
|
23 (month (string-to-int (aref date 1)))
|
|
24 (day (string-to-int (aref date 2)))
|
|
25 (title (read-input "Title: ")))
|
|
26 (save-excursion
|
|
27 (goto-char (point-max))
|
|
28 (re-search-backward ".begin.document.")
|
|
29 (insert TeX-esc "title"
|
|
30 TeX-grop title TeX-grcl "\n")
|
|
31 (insert TeX-esc "author"
|
|
32 TeX-grop (user-full-name) TeX-grcl "\n")
|
|
33 (insert TeX-esc "date" TeX-grop
|
|
34 (format "%d-%02d-%02d" year month day)
|
|
35 TeX-grcl "\n")
|
|
36 (insert "" TeX-esc "\nMyLogo" TeX-grop TeX-grcl "\n")
|
|
37 (insert "%" TeX-esc "Restriction" TeX-grop TeX-grcl "\n")
|
|
38 (insert "%" TeX-esc "rightfooter" TeX-grop TeX-grcl "\n")
|
|
39 (insert "%" TeX-esc "leftheader" TeX-grop TeX-grcl "\n")
|
|
40 (insert "%" TeX-esc "rightheader" TeX-grop TeX-grcl "\n\n")
|
|
41 (re-search-forward ".begin.document.")
|
|
42 (end-of-line)
|
|
43 (newline-and-indent)
|
|
44 (insert "" TeX-esc "maketitle\n\n"))
|
|
45 (forward-line -1)))
|
|
46
|
|
47 ;;; foils.el ends here
|