R文档中数学方程的下标

时间:2022-02-22 21:24:19

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

我正在尝试将一个等式插入到R文档中,以便:

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

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

但它确实如我所料,其中x是p的下标。

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

有人知道R文档中的原因或如何下标p?

2 个解决方案

#1


10  

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:

下标只能在文档的pdf版本中正确呈现,据我所知,HTML版本只是ASCII版本。要为pdf提供等式的乳胶版本以及html帮助的简化等式,可以使用\ deqn {<< latex >>} {<< plain >>}的两个参数。请参阅`geigen包的文档中的示例,以获得两个示例:

\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)}

#2


0  

You can do

你可以做

\ifelse{html}{\out{p_<sub>x</sub>(1)=Pr(y=1|x)}}{\eqn{p_x(1)=Pr(y=1|x)}}

#1


10  

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:

下标只能在文档的pdf版本中正确呈现,据我所知,HTML版本只是ASCII版本。要为pdf提供等式的乳胶版本以及html帮助的简化等式,可以使用\ deqn {<< latex >>} {<< plain >>}的两个参数。请参阅`geigen包的文档中的示例,以获得两个示例:

\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)}

#2


0  

You can do

你可以做

\ifelse{html}{\out{p_<sub>x</sub>(1)=Pr(y=1|x)}}{\eqn{p_x(1)=Pr(y=1|x)}}