Commit | Line | Data |
---|---|---|
a05074b9 GM |
1 | ;; Auxiliary functions for preparing a two volume manual. |
2 | ||
3 | ;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 | |
4 | ;; Free Software Foundation, Inc. | |
5 | ||
9f8bbf0f EZ |
6 | ;; --rjc 30mar92 |
7 | ||
a05074b9 GM |
8 | ;; This file is free software; you can redistribute it and/or modify |
9 | ;; it under the terms of the GNU General Public License as published by | |
4a9f99bd | 10 | ;; the Free Software Foundation; either version 3, or (at your option) |
a05074b9 GM |
11 | ;; any later version. |
12 | ||
13 | ;; This file is distributed in the hope that it will be useful, | |
14 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | ;; GNU General Public License for more details. | |
17 | ||
18 | ;; You should have received a copy of the GNU General Public License | |
19 | ;; along with this file; see the file COPYING. If not, write to | |
20 | ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
21 | ;; Boston, MA 02110-1301, USA. | |
22 | ||
9f8bbf0f EZ |
23 | (defun volume-aux-markup (arg) |
24 | "Append `vol. NUMBER' to page number. | |
25 | Apply to aux file that you save. | |
26 | Then insert marked file into other volume's .aux file." | |
27 | (interactive "sType volume number, 1 or 2: " ) | |
28 | (goto-char (point-min)) | |
29 | (while (search-forward "-pg" nil t) | |
30 | (end-of-line 1) | |
31 | (delete-backward-char 1 nil) | |
32 | (insert ", vol.'tie" arg "}"))) | |
33 | ||
34 | (defun volume-index-markup (arg) | |
35 | "Prepend `NUMBER:' to page number. Use Roman Numeral. | |
177c0ea7 | 36 | Apply only to unsorted index file, |
9f8bbf0f EZ |
37 | Then insert marked file into other volume's unsorted index file. |
38 | Then run texindex on that file and save." | |
39 | (interactive | |
40 | "sType volume number, roman number I or II: " ) | |
41 | (goto-char (point-min)) | |
42 | (while (search-forward "\\entry" nil t) | |
43 | (search-forward "}{" (save-excursion (end-of-line) (point)) nil) | |
44 | (insert arg ":"))) | |
45 | ||
46 | (defun volume-numbers-toc-markup (arg) | |
47 | (interactive | |
48 | "sType volume number, roman number I or II: " ) | |
49 | (goto-char (point-min)) | |
50 | (while (search-forward "chapentry" nil t) | |
51 | (end-of-line) | |
52 | (search-backward "{" nil t) | |
53 | (forward-char 1) | |
54 | (insert arg ":"))) | |
55 | ||
56 | (defun volume-header-toc-markup () | |
57 | "Insert Volume I and Volume II text into .toc file. | |
58 | NOTE: this auxilary function is file specific. | |
59 | This is for the *Elisp Ref Manual*" | |
60 | (interactive) | |
61 | (goto-char (point-min)) | |
62 | (insert "\\unnumbchapentry {Volume 1}{}\n\\unnumbchapentry {}{}\n") | |
63 | (search-forward "\\unnumbchapentry {Index}") | |
64 | (forward-line 1) | |
177c0ea7 | 65 | (insert |
9f8bbf0f EZ |
66 | "\\unnumbchapentry {}{}\n\\unnumbchapentry {}{}\n\\unnumbchapentry {}{}\n\\unnumbchapentry {}{}\n\\unnumbchapentry {Volume 2}{}\n\\unnumbchapentry {}{}\n")) |
67 | ||
68 | ||
69 | ;;; In batch mode, you cannot call functions with args; hence this kludge: | |
70 | ||
71 | (defun volume-aux-markup-1 () (volume-aux-markup "1")) | |
72 | (defun volume-aux-markup-2 () (volume-aux-markup "2")) | |
73 | ||
74 | (defun volume-index-markup-I () (volume-index-markup "I")) | |
75 | (defun volume-index-markup-II () (volume-index-markup "II")) | |
76 | ||
77 | (defun volume-numbers-toc-markup-I () (volume-numbers-toc-markup "I")) | |
78 | (defun volume-numbers-toc-markup-II () (volume-numbers-toc-markup "II")) | |
ab5796a9 MB |
79 | |
80 | ;;; arch-tag: 848955fe-e9cf-45e7-a2f1-570ef156d6a5 |