emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Org-Babel] Export environments for shell results?
@ 2010-10-06 15:04 Sébastien Vauban
  2010-10-06 15:26 ` Dan Davison
  0 siblings, 1 reply; 5+ messages in thread
From: Sébastien Vauban @ 2010-10-06 15:04 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

#+TITLE: Org-Babel export environments for shell results

* Example

** Medium output

#+srcname: is-converted-to-listings
#+begin_src sh :results output :exports both
grep autoload ~/Downloads/emacs/site-lisp/org-mode/lisp/ob.el | cut -d "#" -f 4
#+end_src

#+results: is-converted-to-listings
#+begin_example
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
#+end_example

gets translated (in LaTeX) to:

#+begin_src latex
\begin{lstlisting}
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
autoload
\end{lstlisting}
#+end_src

** Short output

... while

#+srcname: is-converted-to-verbatim
#+begin_src sh :results output :exports both
grep autoload ~/Downloads/emacs/site-lisp/org-mode/lisp/ob.el | cut -d "#" -f 4 | head -n 3
#+end_src

#+results: is-converted-to-verbatim
: autoload
: autoload
: autoload

gets translated (in LaTeX) to:

#+begin_src latex
\begin{verbatim}
 autoload
 autoload
 autoload
\end{verbatim}
#+end_src

with a leading space (that you don't see when running the command in the
shell).

The only difference is the shell command is adding =head -n 3=.

* Questions

1. Why that difference of behavior?

2. What's the determining factor for switching between =verbatim= and
   =lstlisting= environments?

3. Why is there a leading space in the =verbatim= environment?

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2010-10-07 15:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-06 15:04 [Org-Babel] Export environments for shell results? Sébastien Vauban
2010-10-06 15:26 ` Dan Davison
2010-10-07 13:35   ` Sébastien Vauban
2010-10-07 14:37     ` Dan Davison
2010-10-07 15:00     ` [BUG] latex export of verbatim environments Dan Davison

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