emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Mikhail Titov" <mlt@gmx.us>
To: "'Thomas S. Dye'" <tsd@tsdye.com>, 'Jeff Rush' <jrush@taupro.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Unable to Style RESULTS Blocks
Date: Mon, 21 May 2012 13:28:54 -0500	[thread overview]
Message-ID: <007e01cd377f$95ee2940$c1ca7bc0$@us> (raw)
In-Reply-To: <m1ipfpmn5t.fsf@tsdye.com>

> -----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/

  reply	other threads:[~2012-05-21 18:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21 17:36 Unable to Style RESULTS Blocks Jeff Rush
2012-05-21 17:58 ` Thomas S. Dye
2012-05-21 18:28   ` Mikhail Titov [this message]
2012-05-21 21:39     ` Thomas S. Dye
2012-05-21 22:17       ` Mikhail Titov

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='007e01cd377f$95ee2940$c1ca7bc0$@us' \
    --to=mlt@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    --cc=jrush@taupro.com \
    --cc=tsd@tsdye.com \
    /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).