Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

[Cross-posted from SO]

I am trying to create a chunk hook that can produce a \floatfoot{} as part of the output from a chunk.

Hopefully the following example makes clear what I am trying to achieve:

1. .Rnw file

Here is the knitr file.

\title{Learn Moar knitr!}
\author{Foo Bar}


<<label=plotWithNotes, fig.lp='fig:', fig.cap='This is a figure'>>=
plot(rnorm(100), rbinom(n = 100, size = 1, prob = 0.5))


2. LaTeX chunk

\includegraphics[width=\maxwidth]{figure/plotWithNotes} \caption[This is a figure]{This is a figure\label{fig:plotWithNotes}}

3. floatfoot

The markup \floatfoot{} provided by the floatrow package produces a footnote to the graph, and to show its use, I modify the LaTeX chunk above.

\includegraphics[width=\maxwidth]{figure/plotWithNotes} \caption[This is a figure]{This is a figure\label{fig:plotWithNotes}}
\floatfoot{\emph{Note:} This is a footer to the plot and contains some information about the plot.}

Is there any way I can generate the text inside floatfoot above using a chunk option?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.