emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] org-babel issue with source blocks and latex block


From: Kieran Healy
Subject: [Orgmode] org-babel issue with source blocks and latex block
Date: Tue, 15 Feb 2011 12:56:24 -0500

Hi, 

I have org-babel set up to use minted to format code blocks and it's terrific. 
I was wondering whether I could also get it to wrap the results it outputs 
using minted instead of verbatim environments (it seems not right now) when I 
noticed the following strange behavior. Here's a minimal example. This org file 
exports to latex as expected, with the src block in a minted environment and 
the results block as a verbatim environment: (As I say, wanting the results 
block wrapped by minted was what prompted this issue ...)

Org-mode file:
--------------------------------------------------------------------------------------------------
#+TITLE: Working with Org-Babel
#+AUTHOR: Kieran Healy
#+OPTIONS: toc:nil num:nil

** An Example

#+source: r-example-1
#+begin_src R :exports both
  2 + 1 + (5-2) * 5
#+end_src

The end.
--------------------------------------------------------------------------------------------------

Relevant bit of Latex file output:
--------------------------------------------------------------------------------------------------
\begin{document}

\title{Working with Org-Babel}
\author{Kieran Healy}
\date{15 February 2011}
\maketitle

\section*{An Example}
\label{sec-1}

\begin{minted}[]{R}
2 + 1 + (5-2) * 5
\end{minted}

\begin{verbatim}
 18
\end{verbatim}

The end.

\end{document}
--------------------------------------------------------------------------------------------------

But now if I insert a latex-specific section, which causes org-mode no trouble 
in the normal course of things, R is not called and the export only includes 
the source block and not the results:

Org-mode file:
--------------------------------------------------------------------------------------------------
#+TITLE: Working with Org-Babel
#+AUTHOR: Kieran Healy
#+OPTIONS: toc:nil num:nil

#+BEGIN_LaTeX
Anything can go here. 
#+END_LaTeX

** An Example

#+source: r-example-1
#+begin_src R :exports both
  2 + 1 + (5-2) * 5
#+end_src

The end.
--------------------------------------------------------------------------------------------------

Latex output:
--------------------------------------------------------------------------------------------------
\begin{document}

\title{Working with Org-Babel}
\author{Kieran Healy}
\date{15 February 2011}
\maketitle

Anything can go here. 

\section*{An Example}
\label{sec-1}

\begin{minted}[]{R}
2 + 1 + (5-2) * 5
\end{minted}

The end.

\end{document}
--------------------------------------------------------------------------------------------------

Is this behavior expected? 

Kieran

--
Kieran Healy :: http://www.kieranhealy.org










reply via email to

[Prev in Thread] Current Thread [Next in Thread]