emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [patch] ox-latex.el to allow customization of verbatim environme


From: Nicolas Goaziou
Subject: Re: [O] [patch] ox-latex.el to allow customization of verbatim environments (e.g., to use fancyvrb)
Date: Sun, 14 Apr 2013 21:26:26 +0200

Eric Schulte <address@hidden> writes:

> Please see the attached patch, I'd love for this to be applied.

You can use a filter function that will replace default "verbatim" with
whatever you want:

#+begin_src emacs-lisp
(defun my-latex-custom-verbatim (element backend info)
  (when (org-export-derived-backend-p backend 'latex)
    (replace-regexp-in-string
     "\\`\\\\begin{\\(verbatim\\)}" "Verbatim"
     (replace-regexp-in-string
      "\\\\end{\\(verbatim\\)}\n*\\'" "Verbatim" element nil nil 1)
     nil nil 1)))

(add-to-list 'org-export-filter-example-block-functions
             'my-latex-custom-verbatim)
(add-to-list 'org-export-filter-fixed-width-functions
             'my-latex-custom-verbatim)
(add-to-list 'org-export-filter-quote-section-functions
             'my-latex-custom-verbatim)
(add-to-list 'org-export-filter-src-block-functions
             'my-latex-custom-verbatim)
(add-to-list 'org-export-filter-table-functions
             'my-latex-custom-verbatim)
#+end_src

I'm not sure a new variable is needed here. After all, that's what
filters are for.


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]