Replies: 2 comments
-
Personally I go with ```{r}
#| dev: ragg_png
#| dev.args: { scaling: 0.5 }
...
``` ```{r}
#| dev: svglite
#| dev.args: { scaling: 0.5 }
...
``` |
Beta Was this translation helpful? Give feedback.
-
Bumping this because I think it'd be nice to have a tutorial somewhere to set the device parameters so that font sizes are consistent in a document (for HTML but also pdf, etc.). The basic workflow, which perhaps can be streamlined (I'm not sure how?) would be:
One strategy that could make this easier would be to include an optional |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm planning to set the
fig-width
in code chunks to match the intended container size in the HTML output page (body/page/margin, etc.), so that the font sizes appearing in plots can be more consistent with the main text (and with each other).You can see an example of inconsistent font sizes here: doc for margin figures, where the fonts are really small since the plotting device had a width substantially larger than the margin width in this output document.
One possible solution to this is to set the
fig-width
to the absolute size of the container. For example, if I set the grid layout to custom valuesand use those sizes (converted to inches for R devices),
it seems to mostly work (qmd input output preview, at least well enough for my purposes. I'm not after perfectly-identical sizes, but something close enough to not be too noticeable. Looking at the browser console, the layout grid isn't exactly the size I'd requested, for instance (887 vs 900))
I'm curious to hear what others are doing for this though – any tips to share?
Beta Was this translation helpful? Give feedback.
All reactions