You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the readme was transferred to an R markdown document to make formatting of code easier, adding the logo as an image file in the .Rmd body resulted in a huge image which could not be justified, despite attempting to alter settings in the R setup chunk.
Attempts to include the image by creating a base-64 encoded html version and using css code in the body of the R markdown did not display the image once the .md file was pushed to Github.
Solution:
The css code to fetch the image can simply be added directly to the title of the R markdown document in the YAML header, as shown below. When the file is knit to github_document, the logo appears in the correct size and alignment, and also appears correctly in Github (see branch):
---
title: "godataR: easier wrangling with the Go.Data API <img src='inst/images/godataR_logo.png' align='centre' height='20%' width='20%'/>"
date: "`r format(Sys.time(), '%d %B %Y')`"
output: github_document
---
I have changed the alignment to centre (which for some reason appears left-justified, but on its own below the main title and above the date, whereas align='right' or align='left' allows the text to flow around the image to the left or right of it, respectively. There are no options that put the logo on the same level as the title (but I think this is just because the title itself is too long for most page widths to display it this way). I think it looks neater this way, but feel free @sarahollis and @jamesfuller-cdc to change it to right-aligned and see what you think.
Here is how it looks now:
The text was updated successfully, but these errors were encountered:
Reported by:
@sarahollis
Problem statement:
When the readme was transferred to an R markdown document to make formatting of code easier, adding the logo as an image file in the .Rmd body resulted in a huge image which could not be justified, despite attempting to alter settings in the R setup chunk.
Attempts to include the image by creating a base-64 encoded html version and using css code in the body of the R markdown did not display the image once the
.md
file was pushed to Github.Solution:
The css code to fetch the image can simply be added directly to the title of the R markdown document in the YAML header, as shown below. When the file is
knit to github_document
, the logo appears in the correct size and alignment, and also appears correctly in Github (see branch):I have changed the alignment to centre (which for some reason appears left-justified, but on its own below the main title and above the date, whereas
align='right'
oralign='left'
allows the text to flow around the image to the left or right of it, respectively. There are no options that put the logo on the same level as the title (but I think this is just because the title itself is too long for most page widths to display it this way). I think it looks neater this way, but feel free @sarahollis and @jamesfuller-cdc to change it to right-aligned and see what you think.Here is how it looks now:

The text was updated successfully, but these errors were encountered: