Jupyter笔记本乳胶

时间:2017-08-07 15:33:14

标签: math latex jupyter-notebook notation

我需要输入数学公式及其符号。该公式有效但符号格式不正确。你能帮帮我吗?谢谢。

$$
(x)\approx\frac{\phi\prime (x)\times(1-p\prime)\times p}
{\phi\prime(x)\times(1-p\prime)\times p +(1-\phi\prime(x)\times 
p\prime\times(1-p)}\\
$$


$$p$$: notation1
$$p\prime$$: notation2
$$\phi$$: notation3
$$\phi\prime$$: notation4

1 个答案:

答案 0 :(得分:1)

您正在使用强制围绕等式的新线的$$。使用单个$创建内联表达式,这是您想要的。所以将代码更改为:

$$
(x)\approx\frac{\phi\prime (x)\times(1-p\prime)\times p}
{\phi\prime(x)\times(1-p\prime)\times p +(1-\phi\prime(x)\times 
p\prime\times(1-p)}\\
$$


$p$: notation1

$p\prime$: notation2

$\phi$: notation3

$\phi\prime$: notation4

或者,为了更好地打破线条,您可以使用<br/>标记

$$
(x)\approx\frac{\phi\prime (x)\times(1-p\prime)\times p}
{\phi\prime(x)\times(1-p\prime)\times p +(1-\phi\prime(x)\times 
p\prime\times(1-p)}\\
$$


$p$: notation1<br/>
$p\prime$: notation2<br/>
$\phi$: notation3<br/>
$\phi\prime$: notation4<br/>

您还提到了右对齐 - 为此,您需要使用div并对齐它,如下所示:

$$
(x)\approx\frac{\phi\prime (x)\times(1-p\prime)\times p}
{\phi\prime(x)\times(1-p\prime)\times p +(1-\phi\prime(x)\times 
p\prime\times(1-p)}\\
$$

<div align="right">
$p$: notation1<br/>
$p\prime$: notation2<br/>
$\phi$: notation3<br/>
$\phi\prime$: notation4<br/>
</div>

请注意,后两种解决方案只能在实时笔记本中使用,我假设HTML输出(Markdown也可以使用)。如果您计划之后转换为latex / pdf,那么您将需要第一个解决方案或下面的解决方案:

$$
(x)\approx\frac{\phi\prime (x)\times(1-p\prime)\times p}
{\phi\prime(x)\times(1-p\prime)\times p +(1-\phi\prime(x)\times 
p\prime\times(1-p)}\\
$$

$\begin{align}
p: notation1
\newline
p\prime: notation2
\newline
\phi: notation3
\newline
\phi\prime: notation4
\end{align}
$

使用此解决方案,您可以左对齐(在$环境中使用单align)或居中对齐(在$$环境中使用align)但我不要以为你可以正确对齐。加上这种方式notation s是数学字体而不是常规字体,这可能是不可取的。