emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>,
	Nicolas Goaziou <n.goaziou@gmail.com>
Subject: Re: [patch] ox-latex.el to allow customization of verbatim environments (e.g., to use fancyvrb)
Date: Sun, 14 Apr 2013 18:25:19 -0600	[thread overview]
Message-ID: <87obdgip9y.fsf@gmail.com> (raw)
In-Reply-To: 87bo9gpudv.fsf@bzg.ath.cx

Bastien <bzg@gnu.org> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> I'm not sure a new variable is needed here. After all, that's what
>> filters are for.
>
> Filters are for advanced Emacs users, not normal Emacs users.
>
> A "normal" Emacs users is someone who knows how to set an option
> but who doesn't know how to write a function.
>
> This is always a trade-off: if something is badly needed by users,
> let's have an option.  If something is needed only for a few users,
> let's encourage someone to share her/his filter(s)*.
>
> I don't really have an opinion here: my impression is that the
> filter is correct in this case.
>

Yea, a filter seems appropriate here to me as well.  I hadn't thought of
this option when proposing the patch.

>
> * Btw, maybe we should consider gathering filters in some unique
> place, so that users can search and find them easily?  Either a
> new directory in Worg or a new repository on the server?  This
> is powerful enough to deserve a separate place IMO.

Here's my fancyvrb filter for when such a place is created.

    (defun org-latex-filter-fancyvrb (text backend info)
      "Convert begin/end{verbatim} to begin/end{Verbatim}.
    Allows use of the fancyvrb latex package."
      (when (or (org-export-derived-backend-p backend 'beamer)
                (org-export-derived-backend-p backend 'latex))
        (replace-regexp-in-string
         "\\\\\\(begin\\|end\\){verbatim}"
         "\\\\\\1{Verbatim}"
         text)))

    (add-to-list 'org-export-filter-final-output-functions
                 'org-latex-filter-fancyvrb)

Cheers,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

  parent reply	other threads:[~2013-04-15  0:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-14 17:48 [patch] ox-latex.el to allow customization of verbatim environments (e.g., to use fancyvrb) Eric Schulte
2013-04-14 19:26 ` Nicolas Goaziou
2013-04-14 23:25   ` Bastien
2013-04-15  0:07     ` Thomas S. Dye
2013-04-15  0:25     ` Eric Schulte [this message]
2013-04-15  5:40       ` Nicolas Goaziou
2013-04-14 20:02 ` Daimrod

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87obdgip9y.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).