Rmd — bookend:pdf_document2 — Latex — Cross reference and caption figure not working The...

Is it reasonable to ask other researchers to send me their previous grant applications?

Could you use a laser beam as a modulated carrier wave for radio signal?

Is it possible to create a QR code using text?

What did the word "leisure" mean in late 18th Century usage?

Is it possible to make a 9x9 table fit within the default margins?

"Eavesdropping" vs "Listen in on"

Gauss' Posthumous Publications?

Can this transistor (2n2222) take 6V on emitter-base? Am I reading datasheet incorrectly?

MT "will strike" & LXX "will watch carefully" (Gen 3:15)?

Man transported from Alternate World into ours by a Neutrino Detector

Read/write a pipe-delimited file line by line with some simple text manipulation

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

What is the difference between 'contrib' and 'non-free' packages repositories?

Create custom note boxes

Could a dragon use its wings to swim?

How exploitable/balanced is this homebrew spell: Spell Permanency?

How can I replace x-axis labels with pre-determined symbols?

Finitely generated matrix groups whose eigenvalues are all algebraic

How can I prove that a state of equilibrium is unstable?

What day is it again?

logical reads on global temp table, but not on session-level temp table

Free fall ellipse or parabola?

Airship steam engine room - problems and conflict

Can a PhD from a non-TU9 German university become a professor in a TU9 university?



Rmd — bookend:pdf_document2 — Latex — Cross reference and caption figure not working



The Next CEO of Stack Overflowref not working with achemsoFigure caption and reference formattingmemoir does not generate figure cross referenceCannot cross-reference figure after using captionofCross reference figure appears as “??”Caption in figure and cross-reference them properlyCross-reference referenced page in captionIncorrect Figure reference numbering and how to reference a figure that doesn't have a captionNot displaying 'Figure' cross referenceCross reference of Table, Figure etc












0















Can anyone help me understand how to write my header so that the figure caption and cross reference works?



I am practicing making captions and cross references to a simple plot in my Rmd file. I understand that to do so, I should add to my header: "output: bookend::pdf_document2" and "fig_caption = yes". Then, to a chunk called myfigure, I should add "fig.cap = "label{fig:myfigure} My caption". To cross reference this figure I should write in the text "@ref(fig:myfigure)". My code is below. It won't knit because the formatting of the header is wrong.



---
title: "knit"
author: "Chase Hommeyer"
date: "4/1/2019"
output: bookdown::pdf_document2
toc: true
fig_caption: yes
---

```{r myfigure, fig.cap = "\label{fig:myfigure} My caption"}
plot(pressure)
```

My plot is called @ref(fig:myfigure).


Then, I tried deleting the whitespace before toc and fig_caption, and it knit, but no caption appeared, and the text literally printed "@ref(fig:myfigure)" instead of a cross reference. The header I tried is here:
---
title: "knit"
author: "Chase Hommeyer"
date: "4/1/2019"
output: bookdown::pdf_document2
toc: true
fig_caption: yes
---



I also tried adding "pdf_document:" to the header, but the same issue of no caption and the cross reference being literally "@ref(fig:myfigure)". This header I tried is here:



 ---
title: "knit"
author: "Chase Hommeyer"
date: "4/1/2019"
output: bookdown::pdf_document2
pdf_document:
toc: true
fig_caption: yes
---


Can anyone help me understand how to write my header so that it works?










share|improve this question







New contributor




chase171 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    Can anyone help me understand how to write my header so that the figure caption and cross reference works?



    I am practicing making captions and cross references to a simple plot in my Rmd file. I understand that to do so, I should add to my header: "output: bookend::pdf_document2" and "fig_caption = yes". Then, to a chunk called myfigure, I should add "fig.cap = "label{fig:myfigure} My caption". To cross reference this figure I should write in the text "@ref(fig:myfigure)". My code is below. It won't knit because the formatting of the header is wrong.



    ---
    title: "knit"
    author: "Chase Hommeyer"
    date: "4/1/2019"
    output: bookdown::pdf_document2
    toc: true
    fig_caption: yes
    ---

    ```{r myfigure, fig.cap = "\label{fig:myfigure} My caption"}
    plot(pressure)
    ```

    My plot is called @ref(fig:myfigure).


    Then, I tried deleting the whitespace before toc and fig_caption, and it knit, but no caption appeared, and the text literally printed "@ref(fig:myfigure)" instead of a cross reference. The header I tried is here:
    ---
    title: "knit"
    author: "Chase Hommeyer"
    date: "4/1/2019"
    output: bookdown::pdf_document2
    toc: true
    fig_caption: yes
    ---



    I also tried adding "pdf_document:" to the header, but the same issue of no caption and the cross reference being literally "@ref(fig:myfigure)". This header I tried is here:



     ---
    title: "knit"
    author: "Chase Hommeyer"
    date: "4/1/2019"
    output: bookdown::pdf_document2
    pdf_document:
    toc: true
    fig_caption: yes
    ---


    Can anyone help me understand how to write my header so that it works?










    share|improve this question







    New contributor




    chase171 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      Can anyone help me understand how to write my header so that the figure caption and cross reference works?



      I am practicing making captions and cross references to a simple plot in my Rmd file. I understand that to do so, I should add to my header: "output: bookend::pdf_document2" and "fig_caption = yes". Then, to a chunk called myfigure, I should add "fig.cap = "label{fig:myfigure} My caption". To cross reference this figure I should write in the text "@ref(fig:myfigure)". My code is below. It won't knit because the formatting of the header is wrong.



      ---
      title: "knit"
      author: "Chase Hommeyer"
      date: "4/1/2019"
      output: bookdown::pdf_document2
      toc: true
      fig_caption: yes
      ---

      ```{r myfigure, fig.cap = "\label{fig:myfigure} My caption"}
      plot(pressure)
      ```

      My plot is called @ref(fig:myfigure).


      Then, I tried deleting the whitespace before toc and fig_caption, and it knit, but no caption appeared, and the text literally printed "@ref(fig:myfigure)" instead of a cross reference. The header I tried is here:
      ---
      title: "knit"
      author: "Chase Hommeyer"
      date: "4/1/2019"
      output: bookdown::pdf_document2
      toc: true
      fig_caption: yes
      ---



      I also tried adding "pdf_document:" to the header, but the same issue of no caption and the cross reference being literally "@ref(fig:myfigure)". This header I tried is here:



       ---
      title: "knit"
      author: "Chase Hommeyer"
      date: "4/1/2019"
      output: bookdown::pdf_document2
      pdf_document:
      toc: true
      fig_caption: yes
      ---


      Can anyone help me understand how to write my header so that it works?










      share|improve this question







      New contributor




      chase171 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Can anyone help me understand how to write my header so that the figure caption and cross reference works?



      I am practicing making captions and cross references to a simple plot in my Rmd file. I understand that to do so, I should add to my header: "output: bookend::pdf_document2" and "fig_caption = yes". Then, to a chunk called myfigure, I should add "fig.cap = "label{fig:myfigure} My caption". To cross reference this figure I should write in the text "@ref(fig:myfigure)". My code is below. It won't knit because the formatting of the header is wrong.



      ---
      title: "knit"
      author: "Chase Hommeyer"
      date: "4/1/2019"
      output: bookdown::pdf_document2
      toc: true
      fig_caption: yes
      ---

      ```{r myfigure, fig.cap = "\label{fig:myfigure} My caption"}
      plot(pressure)
      ```

      My plot is called @ref(fig:myfigure).


      Then, I tried deleting the whitespace before toc and fig_caption, and it knit, but no caption appeared, and the text literally printed "@ref(fig:myfigure)" instead of a cross reference. The header I tried is here:
      ---
      title: "knit"
      author: "Chase Hommeyer"
      date: "4/1/2019"
      output: bookdown::pdf_document2
      toc: true
      fig_caption: yes
      ---



      I also tried adding "pdf_document:" to the header, but the same issue of no caption and the cross reference being literally "@ref(fig:myfigure)". This header I tried is here:



       ---
      title: "knit"
      author: "Chase Hommeyer"
      date: "4/1/2019"
      output: bookdown::pdf_document2
      pdf_document:
      toc: true
      fig_caption: yes
      ---


      Can anyone help me understand how to write my header so that it works?







      cross-referencing captions markdown






      share|improve this question







      New contributor




      chase171 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      chase171 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      chase171 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 17 mins ago









      chase171chase171

      1




      1




      New contributor




      chase171 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      chase171 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      chase171 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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
          });


          }
          });






          chase171 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482686%2frmd-bookendpdf-document2-latex-cross-reference-and-caption-figure-not%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








          chase171 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          chase171 is a new contributor. Be nice, and check out our Code of Conduct.













          chase171 is a new contributor. Be nice, and check out our Code of Conduct.












          chase171 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • 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%2ftex.stackexchange.com%2fquestions%2f482686%2frmd-bookendpdf-document2-latex-cross-reference-and-caption-figure-not%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

          Can't compile dgruyter and caption packagesLaTeX templates/packages for writing a patent specificationLatex...

          Schneeberg (Smreczany) Bibliografia | Menu...

          Hans Bellmer Spis treści Życiorys | Upamiętnienie | Przypisy | Bibliografia | Linki zewnętrzne |...