X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=texi%2Ftexi2latex.el;h=586db1d719e84c987e73d6c5cbd7eed766c4e29b;hb=747e12ff1c149822165748232ac93d20e359c2ca;hp=a5e5a26a68ae3012f0b87dd906a936f97328a06c;hpb=04ba5250e9e47ebe40860a0902d4ef6405ca143f;p=elisp%2Fgnus.git- diff --git a/texi/texi2latex.el b/texi/texi2latex.el index a5e5a26..586db1d 100644 --- a/texi/texi2latex.el +++ b/texi/texi2latex.el @@ -1,5 +1,5 @@ ;;; texi2latex.el --- convert a texi file into a LaTeX file. -;; Copyright (C) 1996 Lars Magne Ingebrigtsen +;; Copyright (C) 1996, 2004 Lars Magne Ingebrigtsen (require 'cl) @@ -38,7 +38,10 @@ (latexi-translate-file "gnus-faq") (latexi-translate-file "message" t) (latexi-translate-file "emacs-mime" t) - (latexi-translate-file "sieve" t)) + (latexi-translate-file "sieve" t) + ;;(latexi-translate-file "pgg" t) + ;;(latexi-translate-file "sasl" t) + (latexi-translate-file "gnus-news" t)) (defun latexi-translate-file (file &optional as-a-chapter) "Translate file a LaTeX file." @@ -61,7 +64,18 @@ (erase-buffer) (insert-buffer-substring cur) (goto-char (point-min)) + (when (search-forward "@copying" nil t) + (latexi-copying)) + (while (search-forward "@insertcopying" nil t) + (delete-region (match-beginning 0) (match-end 0)) + (latexi-insertcopying)) + (goto-char (point-min)) (latexi-strip-line) + (latexi-translate-string "@'e" "\\'{e}") + (latexi-translate-string "@`a" "\\`{a}") + (latexi-translate-string "@,{c}" "\\c{c}") + (latexi-translate-string "@aa{}" "{\\aa}") + (latexi-translate-string "@\"{@dotless{i}}" "ï") (latexi-translate-string "%@{" "\\gnuspercent{}\\gnusbraceleft{}") (latexi-translate-string "%@}" "\\gnuspercent{}\\gnusbraceright{}") (latexi-translate-string "%1@{" "\\gnuspercent{}1\\gnusbraceright{}") @@ -100,7 +114,8 @@ "summarycontents" "bye" "top" "iftex" "cartouche" "iflatex" "finalout" "vskip" - "dircategory" "group" "syncodeindex")) + "dircategory" "group" "syncodeindex" + "documentencoding")) (latexi-strip-line)) ((member command '("menu" "tex" "ifinfo" "ignore" "ifnottex" "direntry")) @@ -241,7 +256,7 @@ (latexi-begin-command "verse")) ((equal command "page") (latexi-strip-line) - (insert (format "\\newpage\n" arg))) + (insert "\\newpage\n")) ((equal command "'s") (goto-char (match-beginning 0)) (delete-char 1)) @@ -383,4 +398,23 @@ "\\\\\n")) (insert "\\end{tabular}\n") (widen)))) - + +(defvar latexi-copying-text "" + "Text of the copyright notice and copying permissions.") + +(defun latexi-copying () + "Copy the copyright notice and copying permissions from the Texinfo file, +as indicated by the @copying ... @end copying command; +insert the text with the @insertcopying command." + (let ((beg (progn (beginning-of-line) (point))) + (end (progn (re-search-forward "^@end copying[ \t]*\n") (point)))) + (setq latexi-copying-text + (buffer-substring-no-properties + (save-excursion (goto-char beg) (forward-line 1) (point)) + (save-excursion (goto-char end) (forward-line -1) (point)))) + (delete-region beg end))) + +(defun latexi-insertcopying () + "Insert the copyright notice and copying permissions from the Texinfo file, +which are indicated by the @copying ... @end copying command." + (insert (concat "\n" latexi-copying-text)))