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]
> \label{tbl:refyear}
> \caption{Separation outcomes (death or any type of discharge) by
> reference year.}
> <<tbl-refyear()>>
> \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!
> 

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.

HTH,

Chuck


Reply via email to