emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Xavier Garrido <xavier.garrido@gmail.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Calling a source block with raw results
Date: Sun, 04 Jan 2015 20:56:36 +0100	[thread overview]
Message-ID: <54A99AF4.2000809@gmail.com> (raw)

Dear Orgers,

The following shell function lists the files within a directory and for 
each file, write a org piece of code to include it.

#+NAME: org-figure-to-slide
#+HEADERS: :var title="Empty title"
#+HEADERS: :var dir="./figures" :var ext="*.pdf"
#+HEADERS: :var options=""
#+BEGIN_SRC sh
   if [ ! -d ${dir} ]; then
       echo "${dir} is not a directory !"
       exit 1
   fi
   for i in ${dir}/${ext}; do
       echo "* ${title}"
       if [ "${options}" != "" ]; then
           echo ":PROPERTIES:"
           echo ${options}
           echo ":END:"
       fi
       echo "#+BEGIN_CENTER"
       echo "#+ATTR_LATEX: :width \linewidth"
       echo "[[file:${i}]]"
       echo "#+END_CENTER"
   done
#+END_SRC

The basic use of such function is for a beamer presentation, each 
headline corresponds to a figure.

Since I am explicitly writing all the org code, I would like to call the 
function and gets a *raw* results by doing

#+CALL: org-figure-to-slide[:exports none :results raw]()

The problem is when executing the call line, the result is always embeds 
between #+begin_example/#+end_example code block given something like

  #+RESULTS:
#+begin_example
* Empty title
#+BEGIN_CENTER
#+ATTR_LATEX: :width \linewidth
[[file:./figures/timeline0.pdf]]
#+END_CENTER
* Empty title
#+BEGIN_CENTER
#+ATTR_LATEX: :width \linewidth
[[file:./figures/timeline1.pdf]]
#+END_CENTER
#+end_example

I want to remove the #+begin_example/#+end_example but I do not find any 
header arguments that achieve that (I have tested almost all of them). 
Moreover when I read =ob-core= code I do not understand why the function 
=org-babel-examplify-region= (responsible for the add of example block) 
is called since I set a raw results.

The only (bad) way I have found is to set the variable 
=org-babel-min-lines-for-block-output= to nil but then I get big 
troubles when exporting the result.

Can someone give some advice on how to get a pure raw results from a 
source block ?

Thanks a lot for your help,
Xavier

             reply	other threads:[~2015-01-04 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-04 19:56 Xavier Garrido [this message]
2015-01-04 20:29 ` Calling a source block with raw results Thomas S. Dye
2015-01-04 20:47   ` Xavier Garrido

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=54A99AF4.2000809@gmail.com \
    --to=xavier.garrido@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).