X-Git-Url: https://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=texi%2Ftexi2latex.el;h=91ccda6e27c2b66f88032d3c922315a9e1787768;hp=93923c61a15e7cd4cb9fd2bd2bdc0249ace573e6;hb=c9a393eeb329a99695566342a9f03b8a30000898;hpb=ad439c4cad4e90fc4ade9d7954d8eee461a12d29 diff --git a/texi/texi2latex.el b/texi/texi2latex.el index 93923c61a..91ccda6e2 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, 2008 Lars Magne Ingebrigtsen (require 'cl) @@ -39,7 +39,9 @@ (latexi-translate-file "message" t) (latexi-translate-file "emacs-mime" t) (latexi-translate-file "sieve" t) - (latexi-translate-file "pgg" 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." @@ -62,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{}") @@ -101,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")) @@ -242,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)) @@ -384,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)))