emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Calling a source block with raw results
@ 2015-01-04 19:56 Xavier Garrido
  2015-01-04 20:29 ` Thomas S. Dye
  0 siblings, 1 reply; 3+ messages in thread
From: Xavier Garrido @ 2015-01-04 19:56 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

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

end of thread, other threads:[~2015-01-04 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-04 19:56 Calling a source block with raw results Xavier Garrido
2015-01-04 20:29 ` Thomas S. Dye
2015-01-04 20:47   ` Xavier Garrido

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