更改所有内联方程式的字体大小R降价 [英] Change font size for all inline equations R markdown
问题描述
我正在创建一个r-markdown文件,并使用knitr转换为HTML.当我内联诸如X_1,...,X_n \sim N(0,1)
的方程式时,它将被转换为HTML输出
I am creating a r-markdown file and using knitr to convert to HTML. When I inline an equation such as X_1,...,X_n \sim N(0,1)
it gets converted to HTML output as this
.
数学文本相对于纯文本字体而言过大.我可以使用\small X_1,...,X_n \sim N(0,1)
纠正单个方程式的问题.但是,我不想在整个文档中多次键入\small
.有人知道如何通过一次设置更改或修改来纠正此错误,以便将其应用于文档中的所有数学文本吗?
The math text is oversized relative to the plain text font. I can correct this for a single equation with \small X_1,...,X_n \sim N(0,1)
. However, I would prefer not to type \small
hundreds of times throughout a document. Does anyone know how to correct this with a single settings change or modification so it's applied to all math text in the document?
推荐答案
尝试在YAML之后添加以下CSS,或将其包含在外部CCS文档中. Pandoc自动将内联数学包装在类为math
的<span>
标记中.通过修改math
类,我们可以调整字体大小.
Try adding the following CSS after your YAML, or include it in an external CCS document. Pandoc automatically wraps inline math in <span>
tags with class math
. By modifying the math
class, we can adjust the font size.
<style>
.math {
font-size: small;
}
</style>
这篇关于更改所有内联方程式的字体大小R降价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!