Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-19 Thread Eric S Fraga
On Friday, 19 Sep 2014 at 09:14, Andreas Kiermeier wrote: 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 maybe say :results none instead

Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-19 Thread Charles Berry
Andreas Kiermeier andreas.kiermeier at gmail.com writes: My two blocks (with some code removed for simplicity) are as follow: #+NAME: tbl-refyear #+BEGIN_SRC R :results silent :exports none latex(tabular( code remove )) #+END_SRC #+BEGIN_SRC latex :noweb yes \begin{table}[h]

Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-19 Thread Rainer M Krug
Andreas Kiermeier andreas.kierme...@gmail.com 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

Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-19 Thread Andreas Kiermeier
Hi Chuck On 19 September 2014 12:29, Charles Berry ccbe...@ucsd.edu wrote: Why not use library(xtable) and do it all in R? If you are not sure this is the right choice, I suggest you look at the help page for print.xtable - you have a lot of control over caption, label, positioning, etc. I

Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-19 Thread Andreas Kiermeier
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

[O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-18 Thread Tobias Getzner
Hello, I was wondering whether there exists some way of sharing literal code (or, possibly, code results) between subsequent code blocks. E.g., I was trying to create a document containing several tikz graphics, and I would like to share a number of style definitions between these. When I only

Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-18 Thread Tobias Getzner
On Thu, 18 Sep 2014 13:17:14 +, Tobias Getzner wrote: Are there any convenient inline-expansion methods I might have overlooked? To illustrate, I was wondering if any of the following is feasible somehow: * Semantic expansion #+name setup_fu #+begin_src sh :results raw echo 2

Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-18 Thread Eric S Fraga
On Thursday, 18 Sep 2014 at 13:26, Tobias Getzner wrote: On Thu, 18 Sep 2014 13:17:14 +, Tobias Getzner wrote: Are there any convenient inline-expansion methods I might have overlooked? To illustrate, I was wondering if any of the following is feasible somehow: Yes, and you almost got

Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-18 Thread Tobias Getzner
On Thu, 18 Sep 2014 15:01:37 +0100, Eric S Fraga wrote: Are there any convenient inline-expansion methods I might have overlooked? Org src blocks can reference other src blocks. Note the :noweb yes option and the use of Nice! And I see I get «semantic» expansion when I add call syntax

Re: [O] «Macro» expansion in source blocks; code-sharing between blocks

2014-09-18 Thread Andreas Kiermeier
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