From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [BABEL] syntax highlighting in LaTeX output? Date: Fri, 09 Jul 2010 08:32:19 -0700 Message-ID: <87wrt4hd6v.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=33708 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXFl6-0003RD-Im for emacs-orgmode@gnu.org; Fri, 09 Jul 2010 11:45:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OXFl5-0005AN-Fm for emacs-orgmode@gnu.org; Fri, 09 Jul 2010 11:45:00 -0400 Received: from mail-pw0-f41.google.com ([209.85.160.41]:38648) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXFl5-00057r-BM for emacs-orgmode@gnu.org; Fri, 09 Jul 2010 11:44:59 -0400 Received: by mail-pw0-f41.google.com with SMTP id 8so1972202pwi.0 for ; Fri, 09 Jul 2010 08:44:58 -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: Rainer M Krug Cc: emacs-orgmode Yes, set org-export-latex-listings to true. Cheers -- Eric ,----[org-export-latex-listings] | org-export-latex-listings is a variable defined in `org-latex.el'. | Its value is nil | | Documentation: | Non-nil means export source code using the listings package. | This package will fontify source code, possibly even with color. | If you want to use this, you also need to make LaTeX use the | listings package, and if you want to have color, the color | package. Just add these to `org-export-latex-packages-alist', | for example using customize, or with something like | | (require 'org-latex) | (add-to-list 'org-export-latex-packages-alist '("" "listings")) | (add-to-list 'org-export-latex-packages-alist '("" "color")) | | You can customize this variable. `---- Rainer M Krug writes: > 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