2

I am referring to this Suppress automatic figure numbering in pdf output with r markdown/knitr which I don't think was answered fully.

Essentially, I am using knitr::spin and rmarkdown to produce word, pdf and html documents.

For word, there appears to be no numbering when one puts in +fig.1, fig.cap = "Figure name" You only get an output Figure name in the caption. To solve that, I used captioner class. figs = captioner("Figure") That works fine for word

But I am not faced with rewriting the script for pdf document as the caption turns up as figure 1: figure 1: The name

I am using knitr::spin to actually generate the RMD document for forward outputs in word and pdf.

I am not sure I can use hooks in knitr::spin, as I have tried it as advertised but can't get it to work.

I also tried

header-includes: \usepackage{caption} \usepackage{float}

\captionsetup[table]{labelformat=empty} \captionsetup[figure]{labelformat=empty}

as suggested somehere to surpress the prefix for pdf but I get errors from pandoc. It uses pdf2latex.

I am not sure how one would query the output format in knitr::spin to actually produce different actions for different formats which could be a solution although cumbersome.

Thank you so much for your help from a novice.

Community
  • 1
  • 1
ipshi
  • 21
  • 2
  • I have explained why it is not a duplicate in the original question that you have referred to. In fact, the original question does not have a satisfactory answer. It can be reopened with the variation of the parameters that I describe in the current question or it can be answered here. – ipshi Jan 15 '17 at 08:58
  • the working environment is different. I don't use any latex and I am using knitr:spin directly. I asked the similar question in the one you said could be the answer and you advised me to open a new question. – ipshi Jan 15 '17 at 09:16
  • Anyone provide an answer yet? This still seems to be an open issue. Thanks. – ipshi Feb 17 '17 at 06:01

0 Answers0