[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Charles Berry
Subject: Re: [O] «Macro» expansion in source blocks; code-sharing between blocks
Date: Fri, 19 Sep 2014 02:59:15 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

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>  ))
> #+BEGIN_SRC latex :noweb yes
> \begin{table}[h]
> \label{tbl:refyear}
> \caption{Separation outcomes (death or any type of discharge) by
> reference year.}
> <<tbl-refyear()>>
> \end{table}
> 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!

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]