请看附图,我想重现这组方程,请问用哪个代码呢?
我尝试过类似的方法,但没有效果:
\begin{equation*}
\left\{ \,
\begin{multlined}
\phi_t + a \phi_x = 0.\\
\phi(x,0)=\phi_0(x)=\begin{cases}
\phi_L & \text{if } x<0,
\phi_R & \text{if } x>0,
\end{cases}
\end{multlined}
\right.
\end{equation*}
有什么简单的想法吗?
答案1
array
与列说明符一起使用{cc}
。
代码
\documentclass[a4paper]{article}
\usepackage[margin=1cm,papersize={10cm,4cm}]{geometry}
\usepackage{mathtools,amsmath}
\usepackage{multirow}
\pagestyle{empty}
\begin{document}
\begin{equation*}
\left.
\begin{array}{cc}
\mbox{PDE:} & \phi_t + a \phi_x = 0.\\
\mbox{IC:} &\phi(x,0)=\phi_0(x)=
\begin{cases}
\phi_L & \text{if } x<0,\\
\phi_R & \text{if } x>0,
\end{cases}
\end{array}
\right \}
\end{equation*}
\end{document}
答案2
这是使用堆栈的一种方法:
\documentclass{article}
\usepackage{tabstackengine,amsmath}
\begin{document}
\savestack{\mycase}{%
\ensurestackMath{\tabularCenterstack{ll}{
u_L & \text{if } x<0,\\
u_R & \text{if } x>0,
}}}
\[\left.
\raisebox{6pt}{\tabularstackanchor[12pt]{cc}{PDE: & $u_t + au_x = 0$}
{IC: & $u(x,0) = u_0(x) = \left\{\mycase\right.$}}
\right\}\]
\end{document}
答案3
gathered
使用和alignat
环境以及包的解决方案empheq
,带有选项overload
:
\documentclass[preview]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{fixltx2e}
\usepackage[overload]{empheq}
\begin{document}
\begin{alignat*}{2}[right = \empheqrbrace]
& \begin{gathered}
\mathrm{PDE:}\\[\baselineskip]
\mathrm{IC:}
\end{gathered}
& \quad &
\begin{gathered}
\phi_t + a \phi_x = 0.\\[\baselineskip]
\phi(x,0)=\phi_0(x)=\smash{\begin{cases}
\phi_L & \text{if } x<0,\\[1ex]
\phi_R & \text{if } x>0.
\end{cases}}
\end{gathered}\\[-1ex]
\end{alignat*}
\end{document}