1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-21 06:55:35 +00:00

ox-texinfo: Fix verse block export

* lisp/ox-texinfo.el (org-texinfo-verse-block): Generate somewhat
  meaningful Texinfo code instead of LaTeX.
This commit is contained in:
Nicolas Goaziou 2014-08-04 15:21:51 +02:00
parent 3b1d2811a8
commit 3e018d0afd

View File

@ -1609,20 +1609,7 @@ channel."
"Transcode a VERSE-BLOCK element from Org to Texinfo.
CONTENTS is verse block contents. INFO is a plist holding
contextual information."
;; In a verse environment, add a line break to each newline
;; character and change each white space at beginning of a line
;; into a space of 1 em. Also change each blank line with
;; a vertical space of 1 em.
(progn
(setq contents (replace-regexp-in-string
"^ *\\\\\\\\$" "\\\\vspace*{1em}"
(replace-regexp-in-string
"\\(\\\\\\\\\\)?[ \t]*\n" " \\\\\\\\\n" contents)))
(while (string-match "^[ \t]+" contents)
(let ((new-str (format "\\hspace*{%dem}"
(length (match-string 0 contents)))))
(setq contents (replace-match new-str nil t contents))))
(format "\\begin{verse}\n%s\\end{verse}" contents)))
(format "@display\n%s@end display" contents))
;;; Interactive functions