Cross-reference figures and tables

  • Cross-reference figures and tables

     David updated 4 weeks ago 2 Members · 6 Posts
  • peter.bonner

    Member
    October 30, 2020 at 10:47 am

    Another question!

    As far as I’m aware the only way to link to figures/tables within Markdown text is by using the bookdown::html_2 output and using \@ref(‘chunk figure caption’). I’m currently using the prettydoc html output because it’s nicer, but it doesn’t seem to support it. Does anyone know of an alternative way?

  • David

    Organizer
    October 30, 2020 at 3:20 pm

    I’m not sure about a way to do this using prettydoc, but you can do this using Distill. Would that work for you?

    • peter.bonner

      Member
      October 31, 2020 at 10:21 am

      That’s great thanks very much, looks like it does exactly the same. I’ll have a read of the documentation as well and see whether I like the template or not!

      • David

        Organizer
        November 1, 2020 at 1:38 pm

        Great! If you need a tutorial, Thomas Mock has one here. It’s on making a blog with distill, but many of the principles still apply even if you’re just making a single HTML document.

        • peter.bonner

          Member
          November 3, 2020 at 10:10 am

          From your experience how have you balanced style and functionality? For example, do you find that readers of a report would prefer it to be more aesthetically pleasing to read rather than have the small bonus of being able to link to figures/tables etc?

          • David

            Organizer
            November 3, 2020 at 10:15 am

            I think it really just depends on the purpose. For any reports with a public-facing component (see, for example, these ones I worked on that were just released), I spend a lot of time on aesthetics. If it’s an internal thing where exploring data is less important, I spend far less time.

            In office hours this Friday I’m going to make a pagedown template a) because I want to have one to use for quick reports, and b) because people keep asking me about this. You’ll have the code when I’m done, which you could adapt for your own purposes if a PDF-based template would be useful to you.

Log in to reply.

Original Post
0 of 0 posts June 2018
Now
The R for the Rest of Us community is live! Join regular office hours, ask questions in the forum, and more!