From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: Unable to Style RESULTS Blocks Date: Mon, 21 May 2012 11:39:48 -1000 Message-ID: References: <4FBA7D38.4020505@taupro.com> <007e01cd377f$95ee2940$c1ca7bc0$@us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWaKg-0002EA-8K for emacs-orgmode@gnu.org; Mon, 21 May 2012 17:40:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWaKc-0002re-Cq for emacs-orgmode@gnu.org; Mon, 21 May 2012 17:40:01 -0400 Received: from oproxy7-pub.bluehost.com ([67.222.55.9]:44026) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SWaKc-0002qm-36 for emacs-orgmode@gnu.org; Mon, 21 May 2012 17:39:58 -0400 In-Reply-To: <007e01cd377f$95ee2940$c1ca7bc0$@us> (Mikhail Titov's message of "Mon, 21 May 2012 13:28:54 -0500") 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: Mikhail Titov Cc: emacs-orgmode@gnu.org, 'Jeff Rush' "Mikhail Titov" writes: >> -----Original Message----- >> From: emacs-orgmode-bounces+mlt=gmx.us@gnu.org [mailto:emacs-orgmode- >> bounces+mlt=gmx.us@gnu.org] On Behalf Of Thomas S. Dye >> Sent: Monday, May 21, 2012 12:58 PM >> To: Jeff Rush >> Cc: emacs-orgmode@gnu.org >> Subject: Re: [O] Unable to Style RESULTS Blocks >> >> > Using org-babel, I cannot figure out how to make the export of the >> > results of execution appear in LaTeX as a shaded box, like I see on so >> > many of the org-mode websites. >> > >> > #+name: example >> > #+BEGIN_SRC python -n :results output :exports both >> > print "Hello World" >> > #+END_SRC >> > >> > #+results: example >> > : Hello World >> > >> > The results are exported as: >> > >> > \begin{verbatim} >> > Hello World >> > \end{verbatim} >> > >> > which lacks any shading/borders. The org-mode documentation at: >> > >> > http://orgmode.org/worg/org-tutorials/org-latex-export.html >> > >> > shows this example but the example expects the results to be wrapped in >> > a 'results' environment instead of the 'verbatim' environment I'm > seeing. >> > >> > #+LaTeX_HEADER: \usepackage{framed} >> > #+LaTeX_HEADER: \usepackage{xcolor} >> > #+LaTeX_HEADER: \definecolor{shadecolor}{gray}{.95} >> > #+LaTeX_HEADER: \newenvironment{results}{\begin{shaded}}{\end{shaded}} >> > >> > I'm running org-mode 7.8.03 under Linux, and I've defined my own LaTeX >> > document class to format the other parts of my document. I am new to >> > LaTeX though. I just expected the formatting of source and results to >> > be a well-solved problem w/good looking defaults in org-mode. >> > >> > -Jeff >> >> You can wrap a results block any way you like with the :wrap header >> argument, e.g., >> >> #+name: example >> #+BEGIN_SRC python -n :results output :exports both :wrap results >> print "Hello World" >> #+END_SRC >> >> #+RESULTS: example >> #+BEGIN_results >> Hello World >> #+END_results >> >> Or, >> >> #+name: example >> #+BEGIN_SRC python -n :results output :exports both :wrap foo >> print "Hello World" >> #+END_SRC >> >> #+RESULTS: example >> #+BEGIN_foo >> Hello World >> #+END_foo >> >> If you have loaded org-special-blocks, then >> >> #+LaTeX_HEADER: \usepackage{framed} >> #+LaTeX_HEADER: \usepackage{xcolor} >> #+LaTeX_HEADER: \definecolor{shadecolor}{gray}{.95} >> #+LaTeX_HEADER: \newenvironment{results}{\begin{shaded}}{\end{shaded}} >> #+LaTeX_HEADER: \newenvironment{foo}{\begin{framed}}{\end{framed}} > > Or even better, use LaTeX package "minted" [1]. Install all the stuff > including pigments and add to you dot emacs the following > > (setq org-export-latex-listings 'minted) > > [1] http://code.google.com/p/minted/ In my experience, minted marks up exported source code blocks. I haven't seen it do the same for results blocks, but would be interested to learn if this is possible and how to make it work. All the best, Tom -- Thomas S. Dye http://www.tsdye.com