0

I am currently doing my thesis in Rmarkdown, and I have some citation I need in figure captions. I found a similar question in this page, yet the answer refers to the bookdown. In my case, I am using a .bib file.

My issue is that I have the thesis almost all written and the change to bookdown will probably bring errors which will be hard to debug now.

I have in the chunk:

{r yPlus, echo=FALSE, fig.cap="\\label{fig:yPlus}Tipo de escoamento dado pela distânica à parede (adaptado de \\cite{Versteeg:2007aa}).", fig.align="center"}

but when I run the Rmarkdown, I get [?] in the citation. I have tried citep as well, but it raises an error.

Is there a way to work around this issue without many complications? I am not very comfortable with all this yet.

Thank you all for the help.

  • You can change to `bookdown` with minimal interruption by using `bookdown::pdf_document2` instead of `pdf_document` as output format. I would give this a try first. – Ralf Stubner Nov 20 '18 at 20:07
  • Thank you, Ralf, for the suggestion. I have tried to perform the change, but it has started raising errors. I am afraid it will not be an easy change. – Sergio Cavaleiro Costa Nov 21 '18 at 10:24
  • Great that you found a solution. Care to add it as an answer instead of comment? – Ralf Stubner Nov 21 '18 at 12:01
  • I have made it figure out what was the problem. For further reference, I was referring to figures in the chunk using `fig.cap="\\label{foo} my caption"`. When I have passed all to the `r foo, fig.cap="my caption"` I made it work. Another issue I found was some of the labels were like `my_foo_label`, so the "_" were bring issues as well. Once again, thank you, @RalfStubner. – Sergio Cavaleiro Costa Nov 21 '18 at 12:05

0 Answers0