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?
Use \mathbf{g} for bold in math mode.
Bold text. To make a text bold use \textbf command: Some of the \textbf{greatest} discoveries in science were made by accident.
\mathcal{R} will give ℝ. This gives sans serif letters in math mode. This will give text italic letters.
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" ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With