[Tex/LaTex] knitr Caption figure without number

knitr

I am looking for a way to caption my figures without numbering them (like \caption*{}). I am not sure how to do this in knitr.

The following example shows my first attempt:

<<label, include=TRUE, fig.pos='htb', fig.align='center', 
fig.cap='nice figure', fig.width=6, fig.height=3, tidy=TRUE>>=

plot(1:10, 1:10)
@

Thanks!

Best Answer

For anyone stumbling on this. This works specifically for knitr as follows, using the working example provided:

\documentclass{article}
\usepackage{caption}
\begin{document}

\captionsetup{labelformat=empty}
<<label, include=TRUE, fig.pos='htb', fig.align='center', fig.cap='nice figure', fig.width=6, fig.height=3, tidy=TRUE>>=
plot(1:10, 1:10)
@
\captionsetup{labelformat=default}

\end{document}