From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christophe Pouzat Subject: Re: latex export R code syntax highlighting with minted Date: Fri, 16 Mar 2012 22:13:38 +0100 Message-ID: <87y5r0xn99.fsf@xtof-netbook.home> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8eT6-0008FD-Dp for emacs-orgmode@gnu.org; Fri, 16 Mar 2012 17:13:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8eT4-0000dw-AS for emacs-orgmode@gnu.org; Fri, 16 Mar 2012 17:13:48 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:46975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8eT4-0000c5-1S for emacs-orgmode@gnu.org; Fri, 16 Mar 2012 17:13:46 -0400 Received: by werj55 with SMTP id j55so5585426wer.0 for ; Fri, 16 Mar 2012 14:13:43 -0700 (PDT) In-Reply-To: (Ista Zahn's message of "Fri, 16 Mar 2012 16:36:38 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ista Zahn Cc: emacs-orgmode Mailinglist Ista Zahn 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"))=20=20 in an emacs-lisp code block at the beginning of your org file (or in the *scratch* buffer) and evaluate it. Christophe =20=20 --=20 Pr=C3=A9sident, Nicolas Sarkozy repr=C3=A9sente une sorte de triomphe bouff= on de l'=C3=A9galitarisme fran=C3=A7ais=C2=A0; pour la premi=C3=A8re fois d= e notre histoire, nous avons un chef de l'=C3=89tat qui se comporte comme s= 'il ne valait pas mieux que les citoyens. C'est en r=C3=A9alit=C3=A9 toujou= rs le cas, mais cette v=C3=A9rit=C3=A9 doit =C3=AAtre cach=C3=A9e pour que = les institutions et le syst=C3=A8me social tournent de fa=C3=A7on, si ce n'= est harmonieuse, du moins raisonnable. E. Todd, Apr=C3=A8s la d=C3=A9mocratie.=20 -- Christophe Pouzat MAP5 - Math=C3=A9matiques Appliqu=C3=A9es =C3=A0 Paris 5 CNRS UMR 8145 45, rue des Saints-P=C3=A8res 75006 PARIS France tel: +33142863828 mobile: +33662941034 web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html