Change font size for all built-in R markdown equations

I am creating an r-markdown file and using knitr to convert to HTML. When I embed an equation such as X_1,...,X_n \sim N(0,1) , it is converted to HTML output, as it is

this .

The mathematical text is oversized with respect to the font of plain text. I can fix this for one equation with \small X_1,...,X_n \sim N(0,1) . However, I would prefer not to print \small hundreds of times in a document. Does anyone know how to fix this with a single change or modification of the settings so that it applies to all the math text in the document?

+5
source share
1 answer

Try adding the following CSS after YAML or include it in an external CCS document. Pandoc automatically wraps inline math in <span> tags with the math class. By changing the math class, we can adjust the font size.

 <style> .math { font-size: small; } </style> 
+3
source

Source: https://habr.com/ru/post/1274160/


All Articles