From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: [BABEL] syntax highlighting in LaTeX output? Date: Fri, 9 Jul 2010 13:00:13 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1416167215==" Return-path: Received: from [140.186.70.92] (port=35085 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXBJZ-0008Cy-9e for emacs-orgmode@gnu.org; Fri, 09 Jul 2010 07:00:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OXBJX-00008a-Bm for emacs-orgmode@gnu.org; Fri, 09 Jul 2010 07:00:17 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:60302) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXBJX-00008P-2U for emacs-orgmode@gnu.org; Fri, 09 Jul 2010 07:00:15 -0400 Received: by wyj26 with SMTP id 26so1593246wyj.0 for ; Fri, 09 Jul 2010 04:00:13 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --===============1416167215== Content-Type: multipart/alternative; boundary=0016367fb707b166e1048af24ef3 --0016367fb707b166e1048af24ef3 Content-Type: text/plain; charset=ISO-8859-1 Hi when I export to html, I get nice syntax highlighting in my source code (R), but when I export to pdf (via LaTeX), the source code is in normal verbatim, as it is in a verbatim environment. Is there any way to put it into a lstlisting environment, and probably even put the language from the source block in? In this way, one could get syntax highlighting in the pdf? An example: #+begin_src R :exports code x <- log(1:10) #+end_src is at the moment in the LaTeX output: \begin{verbatim} x <- log(1:10) \end{verbatim} Suggested output would be:\begin{lstlisting}[language=R] x <- log(1:10) \begin{lstlisting} Cheers, Rainer -- NEW GERMAN FAX NUMBER!!! Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Cell: +27 - (0)83 9479 042 Fax: +27 - (0)86 516 2782 Fax: +49 - (0)321 2125 2244 email: Rainer@krugs.de Skype: RMkrug Google: R.M.Krug@gmail.com --0016367fb707b166e1048af24ef3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi

when I export to html, I get nice syntax h= ighlighting in my source code (R), but when I export to pdf (via LaTeX), th= e source code is in normal verbatim, as it is in a verbatim environment.

Is there any way to put it into a=A0lstlisting=A0enviro= nment, and probably even put the language from the source block in? In this= way, one could get syntax highlighting in the pdf?

An example:

#+begin_src R =A0:exp= orts code
=A0=A0x <- log(1:10)
#+end_src

is at the moment in the LaTeX output:=A0

\begin{verbatim}
x <- log(1:10)
\end{verbatim}

Suggested output would be:\begin{lstlisting}[language=3DR]
x <- log(1:10)
\begin{lstlisting}

Cheers,

Rainer


-- =
NEW GERMAN FAX NUMBER!!!

Rainer M. Krug, PhD (Conservation Ecolo= gy, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
O= ffice Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue=
Stellenbosch
South Africa

Cell:=A0 =A0 =A0 =A0 =A0=A0 +27 - (= 0)83 9479 042
Fax:=A0 =A0 =A0 =A0 =A0 =A0 +27 - (0)86 516 2782
Fax:=A0 =A0 =A0 =A0 =A0= =A0 +49 - (0)321 2125 2244
email:=A0 =A0 =A0 =A0 =A0 Rainer@krugs.de

Skype:=A0 =A0 =A0 =A0 =A0 RMkru= g
Google:=A0 =A0 =A0 =A0=A0 R.M.Kr= ug@gmail.com

--0016367fb707b166e1048af24ef3-- --===============1416167215== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1416167215==--