how to cite in Rmarkdown chunk caption without using bookdown?












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.










share|improve this question

























  • 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















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.










share|improve this question

























  • 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












0








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.










share|improve this question
















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.







latex r-markdown caption citations






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '18 at 18:33







Sergio Cavaleiro Costa

















asked Nov 20 '18 at 16:30









Sergio Cavaleiro CostaSergio Cavaleiro Costa

196




196













  • 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





















  • 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



















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





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





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





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







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






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53397413%2fhow-to-cite-in-rmarkdown-chunk-caption-without-using-bookdown%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53397413%2fhow-to-cite-in-rmarkdown-chunk-caption-without-using-bookdown%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

SQL update select statement

'app-layout' is not a known element: how to share Component with different Modules