emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Unable to Style RESULTS Blocks
@ 2012-05-21 17:36 Jeff Rush
  2012-05-21 17:58 ` Thomas S. Dye
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Rush @ 2012-05-21 17:36 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to Style RESULTS Blocks
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas S. Dye @ 2012-05-21 17:58 UTC (permalink / raw)
  To: Jeff Rush; +Cc: emacs-orgmode

Aloha Jeff,

Jeff Rush <jrush@taupro.com> writes:

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

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to Style RESULTS Blocks
  2012-05-21 17:58 ` Thomas S. Dye
@ 2012-05-21 18:28   ` Mikhail Titov
  2012-05-21 21:39     ` Thomas S. Dye
  0 siblings, 1 reply; 5+ messages in thread
From: Mikhail Titov @ 2012-05-21 18:28 UTC (permalink / raw)
  To: 'Thomas S. Dye', 'Jeff Rush'; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to Style RESULTS Blocks
  2012-05-21 18:28   ` Mikhail Titov
@ 2012-05-21 21:39     ` Thomas S. Dye
  2012-05-21 22:17       ` Mikhail Titov
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas S. Dye @ 2012-05-21 21:39 UTC (permalink / raw)
  To: Mikhail Titov; +Cc: emacs-orgmode, 'Jeff Rush'

"Mikhail Titov" <mlt@gmx.us> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to Style RESULTS Blocks
  2012-05-21 21:39     ` Thomas S. Dye
@ 2012-05-21 22:17       ` Mikhail Titov
  0 siblings, 0 replies; 5+ messages in thread
From: Mikhail Titov @ 2012-05-21 22:17 UTC (permalink / raw)
  To: 'Thomas S. Dye'; +Cc: emacs-orgmode, 'Jeff Rush'

> -----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 4:40 PM
> To: Mikhail Titov
> Cc: emacs-orgmode@gnu.org; 'Jeff Rush'
> Subject: Re: [O] Unable to Style RESULTS Blocks
> 
> >
> > 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.

My apologies. After reading your reply, I've realized that I misread the
question. I thought it was about the background in block source export
result.

M.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-21 22:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-05-21 21:39     ` Thomas S. Dye
2012-05-21 22:17       ` Mikhail Titov

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).