X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;ds=sidebyside;f=texi%2Ftexi2latex.el;h=a53e6f5edfd2c45929fd34b1df7f75dd0c05a817;hb=4580f46d043579616c032b60930d809661783c7c;hp=568e8d95be850f20c82054e185cfcde34a8edd25;hpb=30a53c1d7e64f14130f9ef4d28a86b180b895f67;p=gnus diff --git a/texi/texi2latex.el b/texi/texi2latex.el index 568e8d95b..a53e6f5ed 100644 --- a/texi/texi2latex.el +++ b/texi/texi2latex.el @@ -35,9 +35,12 @@ "Translate." (interactive) (latexi-translate-file "gnus") - (latexi-translate-file "gnus-faq")) + (latexi-translate-file "gnus-faq") + (latexi-translate-file "message" t) + (latexi-translate-file "emacs-mime" t) + (latexi-translate-file "sieve" t)) -(defun latexi-translate-file (file) +(defun latexi-translate-file (file &optional as-a-chapter) "Translate file a LaTeX file." (let ((item-string "") (item-stack nil) @@ -102,15 +105,24 @@ "ifnottex" "direntry")) (latexi-discard-until command)) ((member command '("subsection" "subsubsection")) - (latexi-switch-line command arg)) + (if as-a-chapter + (latexi-switch-line (format "sub%s" command) arg) + (latexi-switch-line command arg))) ((member command '("chapter")) - (latexi-switch-line - (format - "gnus%s{\\epsfig{figure=ps/new-herd-%d.ps,scale=.5}}" - command (incf chapter)) - arg)) + (if (string-match "Index" arg) + (latexi-strip-line) + (if as-a-chapter + (latexi-switch-line "gnussection" arg) + (latexi-switch-line + (format + "gnus%s{%s}" command + (format "\\epsfig{figure=ps/new-herd-%d,scale=.5}" + (if (> (incf chapter) 9) 9 chapter))) + arg)))) ((member command '("section")) - (latexi-switch-line (format "gnus%s" command) arg)) + (if as-a-chapter + (latexi-switch-line "subsection" arg) + (latexi-switch-line (format "gnus%s" command) arg))) ((member command '("cindex" "findex" "kindex" "vindex")) (latexi-index-command command arg)) ((member command '("*")) @@ -120,7 +132,8 @@ (replace-match "" t t)) ((equal command "node") (latexi-strip-line) - (insert (format "\\label{%s}\n" arg))) + (unless (string-match "Index" arg) + (insert (format "\\label{%s}\n" arg)))) ((equal command "contents") (latexi-strip-line) ;;(insert (format "\\tableofcontents\n" arg)) @@ -196,7 +209,9 @@ (insert "duppat{}")) ((equal command "settitle") (latexi-strip-line) - (insert (format "\\newcommand{\\gnustitlename}{%s}\n" arg))) + (if (not as-a-chapter) + (insert + (format "\\newcommand{\\gnustitlename}{%s}\n" arg)))) ((equal command "title") (latexi-strip-line) (insert (format "\\gnustitlename{%s}\n" arg))) @@ -213,7 +228,9 @@ (delete-char 1)) ((equal command "include") (latexi-strip-line) - (insert "\\input{gnus-faq.latexi}\n")) + (string-match "\\.texi" arg) + (insert (format "\\input{%s.latexi}\n" + (substring arg 0 (match-beginning 0))))) ((equal command "noindent") (latexi-strip-line) (insert "\\noindent\n"))