Insert a logo in upper right corner of R markdown pdf document

后端 未结 5 1491
挽巷
挽巷 2020-12-01 03:21

I am getting started with R markdown and I would like to create a new report having our company image logo.png in the upper right corner of each page.

I

5条回答
  •  醉酒成梦
    2020-12-01 03:33

    For those using flexdashboardsee this addition to entry preamble text for logos and favicon, although its upper left not right:

    http://rmarkdown.rstudio.com/flexdashboard/using.html#logo__favicon

    so your start of the .Rmd file looks like this:

    ---
    title: "myappR"
    output:
      flexdashboard::flex_dashboard:
        logo: mylogo.png
        favicon: mylogo.png
        theme: bootstrap
    runtime: shiny
    ---
    

    I left my logo in the root directory with a simple name. And:

    • Kept logo height 48 pixels as this plays nicely with the theme,
    • Be careful of spaces and indents and,
    • Do not forget the ending : after flexdashboard.

提交回复
热议问题