From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Syntax highlighting of code blocks in beamer slides Date: Tue, 13 Mar 2012 09:58:54 -0400 Message-ID: <13145.1331647134@alphaville> References: <03D26DE9-9D6C-484E-B6F4-60D1FD7CEE35@nf.mpg.de> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7SFq-0006O9-9o for emacs-orgmode@gnu.org; Tue, 13 Mar 2012 09:59:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7SFg-0000tJ-8A for emacs-orgmode@gnu.org; Tue, 13 Mar 2012 09:59:09 -0400 Received: from g1t0026.austin.hp.com ([15.216.28.33]:37781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7SFg-0000np-1O for emacs-orgmode@gnu.org; Tue, 13 Mar 2012 09:59:00 -0400 In-Reply-To: Message from Alan Schmitt of "Tue, 13 Mar 2012 14:44:44 BST." 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: Alan Schmitt Cc: nicholas.dokos@hp.com, emacs-orgmode Mode Alan Schmitt wrote: > On 13 mars 2012, at 14:41, Stefan Vollmar wrote: > > > Hello, we want to create slides via beamer. This works fine except > > for source code listings (#begin_src python...#end_src) - if > > exported as HTML they have syntax-highlighting as expected, however, > > when exported as LaTeX the syntax-highlighting is lost. Is there a > > way to create beamer slides with source code snippets that have > > syntax-highlighting? > > I'm following this tutorial for this: > http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-12-3 > Yup, I followed the tutorial and set up minted some time ago and I have not looked back: I just tried the following --8<---------------cut here---------------start------------->8--- #+LaTeX_CLASS: beamer #+LaTeX_CLASS_OPTIONS: [presentation] #+BEAMER_FRAME_LEVEL: 1 #+BEAMER_HEADER_EXTRA: \usetheme{default}\usecolortheme{default} #+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra) #+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC * foo #+BEGIN_SRC python :exports code for x in range(100): print "x=%d , x^2=%d" % (x, x*x) #+END_SRC --8<---------------cut here---------------end--------------->8--- and I get a caleidoscope of colors. The TeX FAQ has some details about where to get minted and its dependencies (it requires an external Python script, called Pygments): http://www.tex.ac.uk/cgi-bin/texfaq2html?label=codelist Nick