From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: =?UTF-8?B?aGVhZGVyIGFyZ3VtZW50cywgaW5oZXJpdGFuY2UsIGFuZCBub3dl?= =?UTF-8?B?YiBleHBhbnNpb24gV2FzOiDCq01hY3JvwrsgZXhwYW5zaW9uIGluIHNvdXJj?= =?UTF-8?B?ZSBibG9ja3M7IGNvZGUtc2hhcmluZyBiZXR3ZWVuIGJsb2Nrcw==?= Date: Fri, 19 Sep 2014 12:59:56 +0200 Message-ID: References: <87bnqdqb7i.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUw0l-0008GD-1m for emacs-orgmode@gnu.org; Fri, 19 Sep 2014 07:06:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUw0e-0003qZ-OM for emacs-orgmode@gnu.org; Fri, 19 Sep 2014 07:05:59 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:52276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUw0e-0003pw-GJ for emacs-orgmode@gnu.org; Fri, 19 Sep 2014 07:05:52 -0400 Received: by mail-wi0-f178.google.com with SMTP id ho1so2762722wib.17 for ; Fri, 19 Sep 2014 04:05:46 -0700 (PDT) In-Reply-To: (Andreas Kiermeier's message of "Fri, 19 Sep 2014 19:49:15 +0930") 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: Andreas Kiermeier Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Andreas Kiermeier writes: > Thanks Rainer, > > but unfortunately this isn't working. I'm sure I'm doing something > wrong ... somewhere. > > In case this makes any difference I have in the document header: > > #+PROPERTY: header-args:R :session *R* > #+PROPERTY: header-args :results output graphics :exports results > > I've now changed the source block header to ":exports none :eval no" > but now there really is nothing in the output. > > In fact, the corresponding .tex file now contains: > > \begin{table}[h] > \label{tbl:refyear} > \caption{Separation outcomes (death or any type of discharge) by > reference year.} > nil > \end{table} > > and in the *Message* buffer I now have: > > Evaluation of this R code-block (tbl-refyear) is disabled. > org-babel-exp processing... > Evaluation of this R code-block (tbl-refyear) is disabled. > executing Latex code block... > > So, this source block really doesn't evaluated at all. This boils down to the question I asked earlier about header-args and +header args, inheritance of header arguments and this in contrast to normal header args.=20=20 Based on this discussion, I thought that the header arguments count *where the code is executed* and not where it is defined - well - surprise for me. You could try and put the code block with the definition of the code into a subtree where you set ,---- | :PROPERTIES: | :headser-args+: eval no | :END: `---- This might work? Rainer > > Thanks > > Andreas > > On 19 September 2014 18:34, Rainer M Krug wrote: >> Andreas Kiermeier writes: >> >>> I don't think you need the ":noweb yes" as part of the setup_fu >>> header, as this block is not pulling in other materials. >>> >>> Having used this type of setup only over the last couple of days, I've >>> come up with another question. It appears that the setup_fu is >>> executed twice ... once as it's own source block (though by itself not >>> need) and once as part of the second noweb block. This isn't a problem >>> if the execution time is small, but I'm trying to create a summary >>> table in Latex format from 2 million records - so the time is >>> considerable. >>> >> >> Check out the :eval header argument: if you use >> >> ,---- >> | #+BEGIN_SRC R :eval never :exports none >> `---- >> >> this block is never executed - this should work. There are also other >> values for :eval. From the help: >> >> ,---- >> | 14.8.2.25 `:eval' >> | ................. >> | >> | The `:eval' header argument can be used to limit the evaluation of >> | specific code blocks. The `:eval' header argument can be useful for >> | protecting against the evaluation of dangerous code blocks or to ensure >> | that evaluation will require a query regardless of the value of the >> | `org-confirm-babel-evaluate' variable. The possible values of `:eval' >> | and their effects are shown below. >> | >> | `never or no' >> | The code block will not be evaluated under any circumstances. >> | >> | `query' >> | Evaluation of the code block will require a query. >> | >> | `never-export or no-export' >> | The code block will not be evaluated during export but may still >> | be called interactively. >> | >> | `query-export' >> | Evaluation of the code block during export will require a query. >> | >> | If this header argument is not set then evaluation is determined by >> | the value of the `org-confirm-babel-evaluate' variable see *Note Code >> | evaluation security::. >> `---- >> >> Cheers, >> >> Rainer >> >> >>> My two blocks (with some code removed for simplicity) are as follow: >>> >>> #+NAME: tbl-refyear >>> #+BEGIN_SRC R :results silent :exports none >>> latex(tabular( )) >>> #+END_SRC >>> >>> #+BEGIN_SRC latex :noweb yes >>> \begin{table}[h] >>> \label{tbl:refyear} >>> \caption{Separation outcomes (death or any type of discharge) by >>> reference year.} >>> <> >>> \end{table} >>> #+END_SRC >>> >>> I've tried :cache yes as part of the tbl-refyear source block, but >>> that didn't stop if from being run twice. Am I missing a suitable >>> header argument? >>> >>> This is the only way I could find to wrap the latex table (which has >>> some complex formatting and hence why I've used it over just producing >>> a table) in a float with a caption (though I still can't properly >>> reference the label when I export to a PDF file). >>> >>> Any thought would be greatly appreciated. TIA! >>> >>> Andreas > > =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJUHAywAAoJENvXNx4PUvmCOVkH/2gP1mOcsDMgemh4w8PmN+fb CBks0eW43jPlFj3eCtrfh8F7sIDAJ04uq8gIKlLtR1MzzvOjVuNCBkMsQ/RrmfJM F7FYYhyQvaiyUfvpFYVEUEqjtSxarNVuC0poaAuJKtotzWenHV72mYc2rKsTZ0nP isi9V7IW48jY3+MFPItkffRZ9lMslEc/ZZ1fQxEaFcUYxKLiqUV/S5qKhS/F2+on TNu/SMRnFHvcCpuB7glKbzOPGzWYA8b523atG2BexZSxQ5JC6yyaskCpWLBKLDt+ 2Uue7OcPP5D/FCzSRx5QYGUWIaTZiKK5VbMcYmJvo0euVXhDZAMyc4ZqWk6fw5U= =HP05 -----END PGP SIGNATURE----- --=-=-=--