xaringanthemer | Give your xaringan slides some style | Data Visualization library
kandi X-RAY | xaringanthemer Summary
kandi X-RAY | xaringanthemer Summary
Give your xaringan slides some style with xaringanthemer within your slides.Rmd file without (much) CSS.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of xaringanthemer
xaringanthemer Key Features
xaringanthemer Examples and Code Snippets
Community Discussions
Trending Discussions on xaringanthemer
QUESTION
Take the following minimal example. The numbering of the list restarts to 1 in slide 2, when I wanted that the list of slide 2 started with 2. I tried, after intensive Google search, a suggestion given at R Markdown Presentation: How to continue a numbered list across a slide? (see slide 3 and slide 4, below), but with no luck. Thanks!
...ANSWER
Answered 2022-Jan-08 at 19:27Mr. Paul, hello :)
You should remove a redundant tag
- , when using
Code:
QUESTION
My work's standard presentation format is Google Slides in a ratio 16:9, with width set to 10 inches. But I hate having to manually input plots etc so originally mimicked it using Beamer, but am now trying to use xaringan
for all the modern html features.
My problem comes in that I cannot easily get any consistency in font sizes between displaying presentations on screen and printing them. To elaborate. Let's say I have some text in Google Slides that is designed at 12pt (16px). When I measure the size of the text when displaying in presentation mode, this is consistent with the size of the same text when downloaded as a pdf (and then put in presentation mode - using Sumatra). Ok I know this is a weird thing to do but it highlights the point that Google Slides must be doing lots of background stuff to make these consistent - and the fact I can't get the same consistency with xaringan
is - maybe - highlighting a problem. Maybe - I think actually it's probably more correct as I assume it's adjusting to the size / res of my monitor (14 in, 1920 x 1080).
Anyway. If I do the same in xaringan
, using the example code below, then (provided I add in the css @page
code to force the pdf printing to be the correct physical size) then the font size in the pdf that results matches the font size in the pdf produced by Google. Great! Everything is consistent here and I can print my xaringan
slides the same as my Google Slides - e.g. for sharing with customers who point blank refuse to use Google and just want a pdf emailed. I know.
My problem comes that, the font size when viewing the xaringan
html slides in full screen mode is only about 75 % of the "correct" pdf size. This is a problem because - ok I can fudge the font sizes up a bit so displaying on screen looks equivalent to Google Slides - but then the fonts in the pdf are all too big. So there's no easy way to make it so that I can use the same .Rmd file for online presenting and sending as a pdf in a way that all font sizes look the same as if I had used Google all along (unless I only present the pdf, but then might as well revert to Beamer).
I guess the reason for all this is some way font sizes are handled in the background but maybe it's a bug? If not, is there a way to force this consistent font sizing between screen and pdf?
tl;dr Google Slides seems to have consistent font sizes between viewing on a screen and pdf - but xaringan seems not to.
Here's an example Rmd. You can see that the resulting pdf (when viewed in presentation mode) has noticeably bigger font sizes than the html file in presentation mode. In Google Slides, these fonts would all be the same size. I'm using xaringanthemer
for ease.
ANSWER
Answered 2020-Nov-03 at 14:21Ok, so there is a fudge around this - although I'm still not entirely happy I understand why xaringan
does this. I actually think it's something to do with remark.js
itself and the way it seems to handle full screen - or maybe the way browsers do (the problem is manifest with all I've tried) - as it seems to do it for "normal" remark.js presentations, too.
Anyway, it's rather simple, if you use the @media
rule to modify font sizes when viewing on screen. There are a number of ways to do it depended how "automated" you want the scaling. The important point is to make sure you only ever set the base html font size in any non-relative unit, and define everything else relative to that using rem
- that way everything else scales appropriately. Otherwise you'll have to manually change everything else, e.g. all h1
etc.
The first two methods seem equivalent, but I'm new to all this so maybe not, either reset the html
font directly:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xaringanthemer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page