X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=texi%2Ftexi2latex.el;h=237e8ad02b4dd4b2141aa9d3dc3c5c0850fabdbb;hb=bb58610dc0061148843df9cebd2a912a813238e2;hp=a53e6f5edfd2c45929fd34b1df7f75dd0c05a817;hpb=3738187cad20787b5b99c4061256e30e19ee721a;p=elisp%2Fgnus.git- diff --git a/texi/texi2latex.el b/texi/texi2latex.el index a53e6f5..237e8ad 100644 --- a/texi/texi2latex.el +++ b/texi/texi2latex.el @@ -71,6 +71,7 @@ (latexi-translate-string "@code{\\264}" "@code{\\gnusbackslash{}264}") (latexi-translate-string "@samp{\\Deleted}" "@samp{\\gnusbackslash{}Deleted}") (latexi-translate-string "@samp{\\Seen}" "@samp{\\gnusbackslash{}Seen}") + (latexi-translate-string "@file{c:\\myhome}" "@file{c:\\gnusbackslash{}myhome}") ; (while (re-search-forward "{\"[^\"]*\\(\\\\\\)[^\"]*\"}\\\\" nil t) ; (replace-match "\\verb+\\\\+ " t t)) (while (not (zerop (decf times))) @@ -94,12 +95,12 @@ (progn (end-of-line) (point)))) (if (equal arg "@head") (insert "\\gnusinteresting"))) - ((member command '("setfilename" + ((member command '("setfilename" "set" "synindex" "setchapternewpage" "summarycontents" "bye" "top" "iftex" "cartouche" "iflatex" "finalout" "vskip" - "dircategory")) + "dircategory" "group" "syncodeindex")) (latexi-strip-line)) ((member command '("menu" "tex" "ifinfo" "ignore" "ifnottex" "direntry")) @@ -108,6 +109,18 @@ (if as-a-chapter (latexi-switch-line (format "sub%s" command) arg) (latexi-switch-line command arg))) + ((member command '("heading")) + (if as-a-chapter + (latexi-switch-line "subsection*" arg) + (latexi-switch-line "section*" arg))) + ((member command '("subheading")) + (if as-a-chapter + (latexi-switch-line "subsubsection*" arg) + (latexi-switch-line "subsection*" arg))) + ((member command '("subsubheading")) + (if as-a-chapter + (latexi-switch-line "subsubsubsection*" arg) + (latexi-switch-line "subsubsection*" arg))) ((member command '("chapter")) (if (string-match "Index" arg) (latexi-strip-line) @@ -130,6 +143,8 @@ (insert "\\\\")) ((equal command "sp") (replace-match "" t t)) + ((member command '("deffn" "defvar" "defun")) + (replace-match "" t t)) ((equal command "node") (latexi-strip-line) (unless (string-match "Index" arg) @@ -140,7 +155,7 @@ ) ((member command '("titlepage")) (latexi-begin-command command)) - ((member command '("lisp" "example")) + ((member command '("lisp" "example" "smallexample" "display")) (latexi-strip-line) (insert (format "\\begin{verbatim}\n")) (setq verbatim (point))) @@ -156,7 +171,7 @@ ((equal arg "quotation") (latexi-strip-line) (insert (format "\\end{verse}\n"))) - ((member arg '("lisp" "example")) + ((member arg '("lisp" "example" "smallexample" "display")) (latexi-strip-line) (save-excursion (save-restriction @@ -177,7 +192,9 @@ (setq item-string (pop item-stack)) (latexi-strip-line) (insert (format "\\end{%s}\n" arg))) - ((member arg '("iflatex" "iftex" "cartouche")) + ((member arg '("iflatex" "iftex" "cartouche" "group")) + (latexi-strip-line)) + ((member arg '("deffn" "defvar" "defun")) (latexi-strip-line)) (t (error "Unknown end arg: %s" arg)))) @@ -241,7 +258,8 @@ ;; "\\begin{theindex}\\input{gnus.%s}\\end{theindex}\n" arg)) ) (t - (error "Unknown command (line %d): %s" + (error "Unknown command (file %s line %d): %s" + file (save-excursion (widen) (1+ (count-lines (point-min) (progn @@ -255,13 +273,15 @@ (latexi-strip-line)) ((member command '("ref" "xref" "pxref")) (latexi-exchange-command (concat "gnus" command) arg)) - ((member command '("sc" "file" "dfn" "emph" "kbd" "uref" + ((member command '("sc" "file" "dfn" "emph" "kbd" "key" "uref" "code" "samp" "var" "strong" "i" - "result")) + "result" "email" "env" "r")) (goto-char (match-beginning 0)) (delete-char 1) (insert "\\gnus")) - ((member command '("copyright" "footnote")) + ((member command '("acronym")) + (latexi-exchange-command (concat "gnus" command) (downcase arg))) + ((member command '("copyright" "footnote" "TeX")) (goto-char (match-beginning 0)) (delete-char 1) (insert "\\")) @@ -274,7 +294,8 @@ (delete-char 2) (insert "duppat{}")) (t - (error "Unknown command (line %d): %s" + (error "Unknown command (file %s line %d): %s" + file (save-excursion (widen) (1+ (count-lines (point-min) (progn