emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] latex export R code syntax highlighting with minted


From: Christophe Pouzat
Subject: Re: [O] latex export R code syntax highlighting with minted
Date: Fri, 16 Mar 2012 22:13:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

Ista Zahn <address@hidden> 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



reply via email to

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