emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Alan Schmitt <alan.schmitt@polytechnique.org>
Cc: nicholas.dokos@hp.com, emacs-orgmode Mode <emacs-orgmode@gnu.org>
Subject: Re: Syntax highlighting of code blocks in beamer slides
Date: Tue, 13 Mar 2012 09:58:54 -0400	[thread overview]
Message-ID: <13145.1331647134@alphaville> (raw)
In-Reply-To: Message from Alan Schmitt <alan.schmitt@polytechnique.org> of "Tue, 13 Mar 2012 14:44:44 BST." <C6F85F52-7651-4E82-97E1-3D0F3D489CA2@polytechnique.org>

Alan Schmitt <alan.schmitt@polytechnique.org> 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

  reply	other threads:[~2012-03-13 13:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 13:41 Syntax highlighting of code blocks in beamer slides Stefan Vollmar
2012-03-13 13:44 ` Alan Schmitt
2012-03-13 13:58   ` Nick Dokos [this message]
2012-03-14 12:12     ` Stefan Vollmar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13145.1331647134@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).