[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] [BABEL] syntax highlighting in LaTeX output?
From: |
Eric Schulte |
Subject: |
Re: [Orgmode] [BABEL] syntax highlighting in LaTeX output? |
Date: |
Fri, 09 Jul 2010 08:32:19 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
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 <address@hidden> 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