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