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

Salesforce opportunity stages

Simplify trigonometric expression using trigonometric identities

Is this a new Fibonacci Identity?

How to pronounce fünf in 45

Does Germany produce more waste than the US?

Calculate the Mean mean of two numbers

Direct Implications Between USA and UK in Event of No-Deal Brexit

How does a dynamic QR code work?

Can you teleport closer to a creature you are Frightened of?

How badly should I try to prevent a user from XSSing themselves?

Calculating discount not working

How do I secure a TV wall mount?

Incomplete cube

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

Compensation for working overtime on Saturdays

Ising model simulation

Create custom note boxes

Why was Sir Cadogan fired?

What day is it again?

Is the offspring between a demon and a celestial possible? If so what is it called and is it in a book somewhere?

Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?

Traveling with my 5 year old daughter (as the father) without the mother from Germany to Mexico

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

Airship steam engine room - problems and conflict



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







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







    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







      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







      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







      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



      share






      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 8 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

          El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

          Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...

          Castillo d'Acher Características Menú de navegación