Liviu Andronic
2012-Aug-29 10:56 UTC
[R] latex \subfloat{} incompatible with sweave/knitr code
Dear all Are LaTeX \subfloat{} commands incompatible with Sweave code? I cannot get the following code to compile properly: \begin{table} \subfloat[asdfa]{<<>>2+2 @ } \caption{asdf} \end{table} If I replace the Sweave chunk with a random string or a table, the compilation works fine. Any ideas what happens? I hit the same trouble when running the code chunks through knitr. Regards Liviu -- Do you know how to read? http://www.alienetworks.com/srtest.cfm http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
Steve Lianoglou
2012-Aug-29 11:34 UTC
[R] latex \subfloat{} incompatible with sweave/knitr code
Hi, On Wed, Aug 29, 2012 at 6:56 AM, Liviu Andronic <landronimirc at gmail.com> wrote:> Dear all > Are LaTeX \subfloat{} commands incompatible with Sweave code? I cannot > get the following code to compile properly: > \begin{table} > \subfloat[asdfa]{<<>>> 2+2 > @ > > } > > \caption{asdf} > > \end{table} > > > If I replace the Sweave chunk with a random string or a table, the > compilation works fine. Any ideas what happens? I hit the same trouble > when running the code chunks through knitr.This isn't exactly what you want, but I'm using kintr and building and saving my figures in the their own "chunks" then just inlining the path to the generated figure in the \subloat{..}. Things are working fine, eg. my default settings are to suppress chunk echo/output, generate pdf figures, and fig.path='figs/gen-' so: <<someFig>> plot(1:10, 1:10, ...) @ \begin{figure}[...] ... \sublfoat[some][caption]{ \includegraphics[...]{figs/gen-someFig.pdf} } ... \end{figure} does the trick for me. HTH, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact