6

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.

Community
  • 1
  • 1
Worice
  • 3,847
  • 3
  • 28
  • 49
  • @42- Hi, are you sure the question is a duplicate? I edited the question to better explain my point. – Worice Apr 10 '16 at 16:28
  • No, I'm not sure. Is it then a duplicate of: http://stackoverflow.com/questions/3220371/how-to-change-font-size-on-part-of-the-page-in-latex? No... that didn't succeed. Probably not real Latex. Need to narrow the search to markdown methods. – IRTFM Apr 10 '16 at 17:42
  • What about: http://stackoverflow.com/questions/29274501/r-markdown-changing-font-size-and-font-type-in-html-output – IRTFM Apr 10 '16 at 17:44
  • I solved the problem. Math formulas are chunks of Latex code, hence I used `\Huge my_text` to change the font size. Thank you for your suggestion. Do you think that is better if I close the question? – Worice Apr 10 '16 at 17:48
  • 1
    I went on a search and found this page: http://www.martinkeefe.com/math/mathjax9 which I was going to use as the basis of an answer. You should instead write up an answer and then give yourself a check (after the appropriate waiting period) for a useful, correct answer. I'll add my upvote to your answer. – IRTFM Apr 10 '16 at 17:52

2 Answers2

24

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

Community
  • 1
  • 1
Worice
  • 3,847
  • 3
  • 28
  • 49
0

It also works for me as $$\Huge z = \frac{x}{y}$$

Andrii
  • 2,843
  • 27
  • 33