Cross reference and caption figure not working The Next CEO of Stack Overflow

How to show a landlord what we have in savings?

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

Ising model simulation

Avoiding the "not like other girls" trope?

What day is it again?

Incomplete cube

How can a day be of 24 hours?

Airship steam engine room - problems and conflict

Early programmable calculators with RS-232

How can I separate the number from the unit in argument?

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

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

My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?

Is it OK to decorate a log book cover?

How do I keep Mac Emacs from trapping M-`?

Raspberry pi 3 B with Ubuntu 18.04 server arm64: what pi version

How should I connect my cat5 cable to connectors having an orange-green line?

How to implement Comparable so it is consistent with identity-equality

Gauss' Posthumous Publications?

What difference does it make matching a word with/without a trailing whitespace?

Free fall ellipse or parabola?

Is a distribution that is normal, but highly skewed, considered Gaussian?

How do I secure a TV wall mount?

Is a linearly independent set whose span is dense a Schauder basis?



Cross reference and caption figure not working



The Next CEO of Stack Overflow










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 = "labelfig: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 = "\labelfig: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 = "labelfig: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 = "\labelfig: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 = "labelfig: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 = "\labelfig: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 = "labelfig: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 = "\labelfig: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 1 min 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%2fcross-reference-and-caption-figure-not-working%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%2fcross-reference-and-caption-figure-not-working%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

          Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

          Lioubotyn Sommaire Géographie | Histoire | Population | Notes et références | Liens externes | Menu de navigationlubotin.kharkov.uamodifier« Recensements et estimations de la population depuis 1897 »« Office des statistiques d'Ukraine : population au 1er janvier 2010, 2011 et 2012 »« Office des statistiques d'Ukraine : population au 1er janvier 2011, 2012 et 2013 »Informations officiellesCartes topographiquesCarte routièrem

          Mpande kaSenzangakhona Biographie | Références | Menu de navigationmodifierMpande kaSenzangakhonavoir la liste des auteursm