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
I played around with this to also create a way for changing the size of HTML font:
def.chunk.hook <- knitr::knit_hooks$get("chunk")
knitr::knit_hooks$set(output = function(x, options) {
x <- def.chunk.hook(x, options)
if (!is.null(options$sizehtml)) {
paste0(
'<pre style = font-size:', options$sizehtml,'>', x, "</pre>")
} else {
x
}
})
It would be nice if there was a consistent way to change font size for both outputs with the same hook, but they use fundamentally different commands. What we could do is create our own scale of say 1 to 5, whereby:
1 = \tiny in Latex and rel(0.4) in HTML 2: \small in LaTeX and rel(0.7) in HTML 3: \normalsize in LaTeX and rel(1) in HTML
and so on
I haven't had enough time to examine your code to see how to format a PR for this, but I may get time over the weekend if you don't have time to work on the idea.
The text was updated successfully, but these errors were encountered:
This sounds like a cool idea. I won't get a chance to work on it until Sunday at the earliest so if you do get a chance then feel free to submit a PR. Otherwise I'll take a look over the weekend :)
Based on this answer here, we can change the font size of code chunks using hooks:
I played around with this to also create a way for changing the size of HTML font:
It would be nice if there was a consistent way to change font size for both outputs with the same hook, but they use fundamentally different commands. What we could do is create our own scale of say 1 to 5, whereby:
1 = \tiny in Latex and rel(0.4) in HTML
2: \small in LaTeX and rel(0.7) in HTML
3: \normalsize in LaTeX and rel(1) in HTML
and so on
I haven't had enough time to examine your code to see how to format a PR for this, but I may get time over the weekend if you don't have time to work on the idea.
The text was updated successfully, but these errors were encountered: