From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: export: inserting text between source and its results Date: Fri, 8 Jun 2012 09:48:34 +0200 Message-ID: <9F1FC8FF-6FCF-40F1-8881-E62D386160AF@polytechnique.org> Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sctvy-0007HV-4g for emacs-orgmode@gnu.org; Fri, 08 Jun 2012 03:48:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sctvw-0006af-BP for emacs-orgmode@gnu.org; Fri, 08 Jun 2012 03:48:37 -0400 Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:36341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sctvw-0006aa-5C for emacs-orgmode@gnu.org; Fri, 08 Jun 2012 03:48:36 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Mode Hello, I'm writing a presentation with some source code blocks. At the moment I = can easily evaluate them and have them display in a pretty way (using = the :results code flag). For instance, the following > Evaluating >=20 > #+name: with_example > #+begin_src js :results code output :exports both > var x =3D 1 > var f =3D function(o){ with(o){ return x } } > var o2 =3D { x : 2 } > var o3 =3D { x : 3 } > console.log(f({})) > console.log(f(o2)) > console.log(f(o3)) > #+end_src gives me something very nice in LaTeX > Evaluating >=20 > \begin{minted}[frame=3Dlines,fontsize=3D\scriptsize]{js} > var x =3D 1 > var f =3D function(o){ with(o){ return x } } > var o2 =3D { x : 2 } > var o3 =3D { x : 3 } > console.log(f({})) > console.log(f(o2)) > console.log(f(o3)) > \end{minted} >=20 > \begin{minted}[frame=3Dlines,fontsize=3D\scriptsize]{js} > 1 > 2 > 3 > \end{minted} > \end{frame} Now I would like to insert some text between the source part and the = result part. For this it seems that I need to use a "call", but then I = can't see how to get it to display nicely in a minted environment. Here = is what I tried: > Evaluating >=20 > #+name: with_example > #+begin_src js :results output :exports source > var x =3D 1 > var f =3D function(o){ with(o){ return x } } > var o2 =3D { x : 2 } > var o3 =3D { x : 3 } > console.log(f({})) > console.log(f(o2)) > console.log(f(o3)) > #+end_src >=20 > Results >=20 > #+call: with_example() :results code yields > Evaluating >=20 > \begin{minted}[frame=3Dlines,fontsize=3D\scriptsize]{js} > var x =3D 1 > var f =3D function(o){ with(o){ return x } } > var o2 =3D { x : 2 } > var o3 =3D { x : 3 } > console.log(f({})) > console.log(f(o2)) > console.log(f(o3)) > \end{minted} >=20 > Results >=20 > \begin{minted}[frame=3Dlines,fontsize=3D\scriptsize]{common-lisp} > "1\n2\n3\n" > \end{minted} > \end{frame} (It seems the ":results code" evaluates again the output of the call.) Any suggestion? Thanks a lot, Alan=