1 ;; Auxiliary functions for preparing a two volume manual.
3 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
4 ;; Free Software Foundation, Inc.
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
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
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.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this file. If not, see <http://www.gnu.org/licenses/>.
22 (defun volume-aux-markup (arg)
23 "Append `vol. NUMBER' to page number.
24 Apply to aux file that you save.
25 Then insert marked file into other volume's .aux file."
26 (interactive "sType volume number, 1 or 2: " )
27 (goto-char (point-min))
28 (while (search-forward "-pg" nil t
)
30 (delete-backward-char 1 nil
)
31 (insert ", vol.'tie" arg
"}")))
33 (defun volume-index-markup (arg)
34 "Prepend `NUMBER:' to page number. Use Roman Numeral.
35 Apply only to unsorted index file,
36 Then insert marked file into other volume's unsorted index file.
37 Then run texindex on that file and save."
39 "sType volume number, roman number I or II: " )
40 (goto-char (point-min))
41 (while (search-forward "\\entry" nil t
)
42 (search-forward "}{" (save-excursion (end-of-line) (point)) nil
)
45 (defun volume-numbers-toc-markup (arg)
47 "sType volume number, roman number I or II: " )
48 (goto-char (point-min))
49 (while (search-forward "chapentry" nil t
)
51 (search-backward "{" nil t
)
55 (defun volume-header-toc-markup ()
56 "Insert Volume I and Volume II text into .toc file.
57 NOTE: this auxiliary function is file specific.
58 This is for the *Elisp Ref Manual*."
60 (goto-char (point-min))
61 (insert "\\unnumbchapentry {Volume 1}{}\n\\unnumbchapentry {}{}\n")
62 (search-forward "\\unnumbchapentry {Index}")
65 "\\unnumbchapentry {}{}\n\\unnumbchapentry {}{}\n\\unnumbchapentry {}{}\n\\unnumbchapentry {}{}\n\\unnumbchapentry {Volume 2}{}\n\\unnumbchapentry {}{}\n"))
68 ;;; In batch mode, you cannot call functions with args; hence this kludge:
70 (defun volume-aux-markup-1 () (volume-aux-markup "1"))
71 (defun volume-aux-markup-2 () (volume-aux-markup "2"))
73 (defun volume-index-markup-I () (volume-index-markup "I"))
74 (defun volume-index-markup-II () (volume-index-markup "II"))
76 (defun volume-numbers-toc-markup-I () (volume-numbers-toc-markup "I"))
77 (defun volume-numbers-toc-markup-II () (volume-numbers-toc-markup "II"))