From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: inline src_R also in latex src block Date: Wed, 11 Jan 2012 09:41:40 +0100 Message-ID: <87aa5uocl7.fsf@med.uni-goettingen.de> References: <4efdfe43.c9330e0a.78cb.ffff9b12@mx.google.com> <87pqf2c6q7.fsf@gmx.com> <4f0c2d36.812f0e0a.303f.738e@mx.google.com> <877h0z7lwp.fsf@med.uni-goettingen.de> <4f0cc7e9.e4030e0a.7250.4f65@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:52565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rktl5-0007Ro-FM for emacs-orgmode@gnu.org; Wed, 11 Jan 2012 03:42:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rktkz-0006HY-It for emacs-orgmode@gnu.org; Wed, 11 Jan 2012 03:42:11 -0500 Received: from lo.gmane.org ([80.91.229.12]:35287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rktkz-0006HO-5T for emacs-orgmode@gnu.org; Wed, 11 Jan 2012 03:42:05 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Rktkx-0006nS-R8 for emacs-orgmode@gnu.org; Wed, 11 Jan 2012 09:42:03 +0100 Received: from genepi110.genepi.med.uni-goettingen.de ([134.76.140.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Jan 2012 09:42:03 +0100 Received: from andreas.leha by genepi110.genepi.med.uni-goettingen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Jan 2012 09:42:03 +0100 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@gnu.org Michael Bach writes: > Andreas Leha writes: > >> would this noweb-based approach work for you: >> >> #+name: inner_test >> #+begin_src R >> 4 + 4 >> #+end_src >> >> #+name: test >> #+begin_src latex :noweb yes >> \begin{equation} >> <> >> \end{equation} >> #+end_src >> > > Yes, that works. Thanks for your thoughts on this, Andreas. > > I am just thinking of another benefit: Is it correct that I can use > caching with this approach? So that the call to <> does > not evaluate the `inner_test' block but instead takes its results > directly from the cached `#+results[6099...]: inner_test' block? This > would be speedier than src_R usage... yes, that should work. Try to export the following several times. The first number should not change. (note: maybe you'd have to execute the inner_test_cached once on your system) #+name: inner_test_cached #+begin_src R :cache yes :exports none rnorm(1) #+end_src #+results[dbeb7280be41fdc949815808cf601a6d01a400bb]: inner_test_cached : 1.12399967834262 #+name: inner_test_not_cached #+begin_src R :exports none rnorm(1) #+end_src #+results: inner_test_not_cached : -0.562660468468834 #+name: test #+begin_src latex :noweb yes \begin{equation} <> != <> \end{equation} #+end_src Cheers, Andreas