Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subscript of math equation in R documentation

I'm trying to insert an equation in to an R documentation such that:

\deqn{p_{x}(1)=Pr(y=1|x)}

but it does come out as I expected where x is a subscript of p.

Does anybody know the reason OR how to subscript p in R documentation?

like image 767
David Z Avatar asked Apr 07 '14 17:04

David Z


People also ask

How do you write a subscript in R?

Subscripts and Superscripts To indicate a subscript, use the underscore _ character. To indicate a superscript, use a single caret character ^ . Note: this can be confusing, because the R Markdown language delimits superscripts with two carets.

What is the subscript of an equation?

Subscripts are those little numbers in the bottom right Sometimes equations may have variables with subscripts (tiny numbers just after the variable). This is especially the case in science subjects such as chemistry or physics.

What is a mathematical subscript?

A quantity displayed below the normal line of text (and generally in a smaller point size), as the " " in , is called a subscript. Subscripts are commonly used to indicate indices ( is the entry in the th row and th column of a matrix ), partial differentiation ( is an abbreviation for.


1 Answers

The subscript will only render properly in the pdf version of your documentation, the HTML version is ASCII only as far as I know. To provide both a latex version of your equation for the pdf as well as a simplified equation for the html help, you can use both arguments of \deqn{<<latex>>}{<<plain>>}. Take a look for example at the documentation of the `geigen package for a few examples of providing both:

\deqn{A x = \lambda Bx}{A*x = lambda B*x}
\deqn{(A,B) = (Q S Z^H, Q T Z^H)}{(A,B) = (Q*S*Z^H, Q*T*Z^H)}
like image 165
sebkopf Avatar answered Sep 28 '22 10:09

sebkopf