乳胶中丢失美元插入错误

时间:2019-01-09 11:45:48

标签: latex

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{graphicx}

\usepackage{tikz}
\tikzset{
treenode/.style = {shape=rectangle, rounded corners,
    draw, align=center,
    top color=white, bottom color=blue!20},
root/.style     = {treenode, font=\Large, bottom color=red!30},
env/.style      = {treenode, font=\ttfamily\normalsize},
dummy/.style    = {circle,draw}
}
\begin{document}    
\begin{tikzpicture}
[
grow                    = right,
sibling distance        = 6em,
level distance          = 8em,
edge from parent/.style = {draw, -latex},
every node/.style       = {font=\footnotesize},
sloped
]
\node [root] {$Gamble (G)$}
child { node [env] {$\mu$ $-$ h}
    edge from parent node [below] {1-p = P(T)} }
child { node [env] {$\mu$ $+$ h}
    edge from parent node [above] {p = P(H)} };
\end{tikzpicture}
\\
\underline{Payoff of G}
\\X $=$ 
\begin{cases}
    ($\mu$ + h) wp p
    \\($\mu$ - h) wp (1-p)
\end{cases}
\end{document}

我在“开始用例”部分收到丢失的美元插入错误。我尝试从“ mu”中删除美元符号,但是没有成功。我该如何纠正?

1 个答案:

答案 0 :(得分:0)

您必须在嵌入式数学模式下包装整个块

\underline{Payoff of G}
\\$X =                       % inline Math mode starts here
\begin{cases}
    (\mu + h) wp p           % '$' in those lines aren't necessary
    \\(\mu - h) wp (1-p)
\end{cases}$                 % inline math mode ends here

这使missing dollar错误/警告消失了。