Search code examples
rlatexmathjaxrpres

Changing math formulas font size in RPres


How can I change the font size of the the math formulas in Rpres? [Editor's note: 'Rpres' is the file extension used by RStudio for its "Presentation" files. It's apparently been adopted by users as shorthand for that section of the IDE.] A similar problem is faced in Code box size and font size in RPres, but it does not solve the problem with math formulas, that are not part of a chunck of code separated from the text, but are a chunk of LaTeX code.

Please consider, for example, this section of a slide produced with the default setup:

The average height is 175cm, with a standard deviation of 10. 
The z-score for a student 163cm is given by the formula:

$$z = (x - \mu)/\sigma$$

where $x$ is the student of our interest, $\mu$ is the distribution mean of
the school and $\sigma$.

Returns:

enter image description here

Sure enough, the approach suggested in Code box size and font size in RPres does not affect the size of the math formulas.


Solution

  • Math formulas in RPres documents and Rmarkdown documents are LateX chunks of code embedded in the Rmarkdown document.

    Hence, the font size of a math formula or, more generally, of LaTeX text, can by modified with an argument ranging from \tiny to \HUGE:

    $$\Huge textblog.org$$
    

    will affect the size of the font according to:

    img1