所以我有以下代码
\begin{dmath}
P_1=\left\{\begin{matrix}
{P_E} + K(1 - {e^{ - rT}}) - S(1 - {e^{ - \delta T}})\\
- KI(0,T,S,{B_{11}},{b_{11}}, - 1,r)\\
+ SI(0,T,S,{B_{11}},{b_{11}},1,\delta )\;\text{if }\;S > {B_{11}}\\
K - S\quad \text{if } \;S \le {B_{11}}
\end{matrix}\right.
\end{dmath}
\begin{dmath}
P_2=\left\{\begin{matrix}
{P_E} + K(1 - {e^{ - rT}}) - S(1 - {e^{ - \delta T}})\\
- KI(0,T/2,S,{B_{21}},{b_{21}}, - 1,r)\\
+ SI(0,T/2,S,{B_{21}},{b_{21}},1,\delta )\\
- KI(T/2,T,S,{B_{21}},{b_{21}}, - 1,r)\\
+ SI(T/2,T,S,{B_{21}},{b_{21}},1,\delta )\quad \text{if }\;S > {B_{22}}\\
K - S\quad \text{if }\;S \le {B_{22}}.
\end{matrix}\right.
\end{dmath}
\begin{dmath}
P_3=\left\{\begin{matrix}
{P_E} + K(1 - {e^{ - rT}}) - S(1 - {e^{ - \delta T}})\\
- KI(0,T/3,S,{B_{33}},{b_3}, - 1,r)\\
+ SI(0,T/3,S,{B_{33}},{b_3},1,\delta )\\
- KI(T/3,2T/2,S,{B_{32}},{b_{32}}, - 1,r)\\
+ SI(T/3,2T/3,S,{B_{32}},{b_{32}},1,\delta )\\
- KI(2T/3,T,S,{B_{31}},{b_{31}}, - 1,r)\\
+ SI(2T/3,T,S,{B_{31}},{b_{31}},1,\delta )\quad \text{if }\;S > {B_{33}}\\
K - S\quad \text{if }\;S \le {B_{33}}.\\
\end{matrix}\right.
\end{dmath}
不幸的是,这会产生以下图片
答案1
我会使用包cases
中的环境amsmath
。我不知道你的matrix
环境dmath
来自哪里。
我认为您所体验到的额外间距是由于\left\{
。
例子:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\noindent
\begin{equation}
P_{1}=
\begin{cases}
P_E + K(1 - {e^{ - rT}}) - S(1 - {e^{ - \delta T}})\\
{}- KI(0,T,S,{B_{11}},{b_{11}}, - 1,r)\\
{}+ SI(0,T,S,{B_{11}},{b_{11}},1,\delta )\quad\text{if}\; S > {B_{11}}\\
K - S\quad \text{if}\; S \le {B_{11}}.
\end{cases}
\end{equation}
\begin{equation}
P_{2}=
\begin{cases}
P_E + K(1 - {e^{ - rT}}) - S(1 - {e^{ - \delta T}})\\
{}- KI(0,T/2,S,{B_{21}},{b_{21}}, - 1,r)\\
{}+ SI(0,T/2,S,{B_{21}},{b_{21}},1,\delta )\\
{}- KI(T/2,T,S,{B_{21}},{b_{21}}, - 1,r)\\
{}+ SI(T/2,T,S,{B_{21}},{b_{21}},1,\delta )\quad \text{if}\; S > {B_{22}}\\
K - S\quad \text{if}\; S \le {B_{22}}.
\end{cases}
\end{equation}
\begin{equation}
P_{3}=
\begin{cases}
P_E + K(1 - {e^{ - rT}}) - S(1 - {e^{ - \delta T}})\\
{}- KI(0,T/3,S,{B_{33}},{b_3}, - 1,r)\\
{}+ SI(0,T/3,S,{B_{33}},{b_3},1,\delta )\\
{}- KI(T/3,2T/2,S,{B_{32}},{b_{32}}, - 1,r)\\
{}+ SI(T/3,2T/3,S,{B_{32}},{b_{32}},1,\delta )\\
{}- KI(2T/3,T,S,{B_{31}},{b_{31}}, - 1,r)\\
{}+ SI(2T/3,T,S,{B_{31}},{b_{31}},1,\delta )\quad \text{if}\; S > {B_{33}}\\
K - S\quad \text{if}\; S \le {B_{33}}.
\end{cases}
\end{equation}
\end{document}
答案2
如果我正确理解了你的意图,你正在追求这样的事情:
代码:
% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly
% declare the paper format.
\usepackage[T1]{fontenc} % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
\usepackage{mathtools}
\begin{document}
It's always best to start with some text.
\begin{align}
P_{1} &=
\begin{cases*}
\begin{aligned}[b]
P_{E} &+ K(1 - e^{-rT}) - S(1 - e^{-\delta T})\\
& - KI(0,T,S,B_{11},b_{11},-1,r)\\
& + SI(0,T,S,B_{11},b_{11},1,\delta )
\end{aligned}
& if $S > B_{11}$, \\
K - S & if $S \le B_{11}$.
\end{cases*}
\\
P_{2} &=
\begin{cases*}
\begin{aligned}[b]
P_{E} &+ K(1 - e^{-rT}) - S(1 - e^{-\delta T})\\
& - KI(0,T/2,S,B_{21},b_{21},-1,r)\\
& + SI(0,T/2,S,B_{21},b_{21},1,\delta )\\
& - KI(T/2,T,S,B_{21},b_{21},-1,r)\\
& + SI(T/2,T,S,B_{21},b_{21},1,\delta )
\end{aligned}
& if $S > B_{22}$, \\
K - S & if $S \le B_{22}$.
\end{cases*}
\\
P_{3} &=
\begin{cases*}
\begin{aligned}
P_{E} &+ K(1 - e^{-rT}) - S(1 - e^{-\delta T})\\
& - KI(0,T/3,S,B_{33},b_{3},-1,r)\\
& + SI(0,T/3,S,B_{33},b_{3},1,\delta )\\
& - KI(T/3,2T/2,S,B_{32},b_{32},-1,r)\\
& + SI(T/3,2T/3,S,B_{32},b_{32},1,\delta )\\
& - KI(2T/3,T,S,B_{31},b_{31},-1,r)\\
& + SI(2T/3,T,S,B_{31},b_{31},1,\delta )
\end{aligned}
& if $S > B_{33}$, \\
K - S & if $S \le B_{33}$.
\end{cases*}
\end{align}
Text after the equations.
\end{document}
注意事项:
该
mathtools
包(也会自动加载amsmath
)提供了一个cases*
环境,该环境以文本模式(而不是数学模式)排版第二列。还有其他选择:请参阅包手册第 18 页mathtools
。我使用了一个
aligned
带有可选参数的环境[b]
来包装属于同一逻辑分支的长公式(我再说一遍,如果我理解正确的话)。我还去掉了很多多余的牙套。
作为一个“特征”(;-),最后一个等式通过示例展示了该
[b]
论点的用途……