Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R documentation, how to set a character in bold font within math mode, within eqn or deqn?

Tags:

r

latex

rstudio

I want to set (x_1, x_2, \dots, x_n) in a bold font within R documentation. I wrote

\deqn(\bold{x}_1, \bold{x}_2, \ldots, \bold{x}_n),

but when Rstudio shows HTML preview of the documentation, x is not bold and \bold{x} is illustrated in HTML help page. The other latex math bold producer such as \boldsymbol, \mathbf, \boldmath were also unsuccessful.

So, What is the right command for setting a character in a bold within math mode?

Thank you,

P.S. When I applied \mathbf and \boldsymbol character x in pdf constructed documentation became bold, but how about the HTML help page?

like image 422
Ehsan Masoudi Avatar asked Feb 25 '13 05:02

Ehsan Masoudi


People also ask

How do you make something bold in math mode LaTeX?

Use \mathbf{g} for bold in math mode.

How do you bold a variable in LaTeX?

Bold text. To make a text bold use \textbf command: Some of the \textbf{greatest} discoveries in science were made by accident.

How do you italicize in math in LaTeX?

\mathcal{R} will give ℝ. This gives sans serif letters in math mode. This will give text italic letters.


1 Answers

Note: it is \deqn{ .. } but you've used '(...)'.

But then, the documentation (the "Writing R Extensions" manual that comes with every version of R and is also available on CRAN / r-project.org) explains that both \deqn and \eqn are for layouting pure LaTeX and possibly give (as 2nd argument) a text version of the corresponding formula.

Hence, \bold is not appropriate: It's Rd language instead of LaTeX. Did you try \mathbf{} .. as that is the (pure) LaTeX way ?

HTML is conceptually between LaTeX and simple text (= the two arguments of (d)eqn). Within R (and outside), there are efforts and experiments of better HTML rendering of such math equations. Do ask on R-help or R-devel (the mailing lists!) if you want to enquire about our plans about this ((I have not been involved in it)).

BTW: I strongly disagree with HW's opinion that you should not care about the PDF version of the reference manual. Mathematically minded authors and readers (with some experience) very much appreciate nice (formulas in) PDF versions of the help pages / reference manuals. Yes, it is a matter of taste, to a large extent. I do prefer carefully written and layouted reference material to those help pages that are only written because they are required by "R CMD check" ;-)

like image 130
Martin Mächler Avatar answered Sep 19 '22 08:09

Martin Mächler