From: Christophe Pouzat <christophe.pouzat@gmail.com>
To: Ista Zahn <istazahn@gmail.com>
Cc: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: latex export R code syntax highlighting with minted
Date: Fri, 16 Mar 2012 22:13:38 +0100 [thread overview]
Message-ID: <87y5r0xn99.fsf@xtof-netbook.home> (raw)
In-Reply-To: <CA+vqiLFEeYqy9gL4sfMCR+Fs77SVUS=v_s5Q8p9=kHhC==gkSw@mail.gmail.com> (Ista Zahn's message of "Fri, 16 Mar 2012 16:36:38 -0400")
Ista Zahn <istazahn@gmail.com> writes:
> Hi all,
>
> I'm having trouble modifying the example at
> http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-12-3
> to highlight R code blocks. The trouble seems to be that org-mode
> identifies R blocks using uppercase R, while pygments looks for
> lowercase r.
>
> For example, org exports
>
> \begin{minted}{R}
> 2+2
> \end{minted}
>
> but pygments doesn't know how to highlight R. If I change to
>
> \begin{minted}{r}
> 2+2
> \end{minted}
>
> (note the lower case r) then it works, but of course I don't want to
> have to perform a find-and-replace every time.
>
> Do you know how to either a) make org-mode identify R blocks with a
> lowercase r, or b) make pygments recognize uppercase R, or c) some
> other solution I've overlooked?
>
> Thanks!
> Ista
>
>
Hi Ista,
Put the following expression:
(add-to-list 'org-export-latex-minted-langs '(R "r"))
in an emacs-lisp code block at the beginning of your org file (or in the
*scratch* buffer) and evaluate it.
Christophe
--
Président, Nicolas Sarkozy représente une sorte de triomphe bouffon de l'égalitarisme français ; pour la première fois de notre histoire, nous avons un chef de l'État qui se comporte comme s'il ne valait pas mieux que les citoyens. C'est en réalité toujours le cas, mais cette vérité doit être cachée pour que les institutions et le système social tournent de façon, si ce n'est harmonieuse, du moins raisonnable.
E. Todd, Après la démocratie.
--
Christophe Pouzat
MAP5 - Mathématiques Appliquées à Paris 5
CNRS UMR 8145
45, rue des Saints-Pères
75006 PARIS
France
tel: +33142863828
mobile: +33662941034
web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html
next prev parent reply other threads:[~2012-03-16 21:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-16 20:36 latex export R code syntax highlighting with minted Ista Zahn
2012-03-16 21:13 ` Christophe Pouzat [this message]
2012-03-16 21:39 ` Ista Zahn
2012-03-16 21:47 ` Nick Dokos
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=87y5r0xn99.fsf@xtof-netbook.home \
--to=christophe.pouzat@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=istazahn@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).