我正在尝试将我的案例与对齐环境中的其他行对齐,但到目前为止还没有成功。你能告诉我如何对齐所有这些行吗:
这是我的代码:
\documentclass[11pt]{article}
\usepackage[framemethod=default]{mdframed}
\usepackage{mathtools}
\usepackage[most]{tcolorbox}
\tcbset{myformula/.style={
arc=0pt,
outer arc=0pt,
colback=blue!10,
colframe=green,
boxrule=0.8pt,
left=2pt,
right=2pt,
highlight math style={
arc=0pt,
outer arc=0pt,
colback=green,
colframe=red.
}
}
}
\begin{document}
\begin{tcolorbox}[ams align, myformula]
Q(z) & = a_{n}z^{n} + a_{n-1}z^{n-1} + \dots + a_{2}z^{2} + a_{1}z^{1} + a_{0} = 0
\intertext{The conditions for stability are}\\
Q(1) & > 0
\intertext{and:}
\begin{dcases}
Q(-1) & > 0 \quad \text{if $n$ is even}\\
Q(-1) & < 0\quad \text{if $n$ is odd}
\end{dcases}
\end{tcolorbox}
\end{document}
答案1
\begin{tcolorbox}[ams align, myformula]
& Q(z) = a_{n}z^{n} + a_{n-1}z^{n-1} + \dots + a_{2}z^{2} + a_{1}z^{1} + a_{0} =
0
\intertext{The conditions for stability are}
& Q(1) > 0
\intertext{and:}
& \begin{dcases}
Q(-1) & > 0 \quad \text{if $n$ is even}\\
Q(-1) & < 0\quad \text{if $n$ is odd}
\end{dcases}
\end{tcolorbox}
答案2
嗯,不是那么轻微的(:-)改进赫伯特的回答:
\documentclass[11pt]{article}
\usepackage[framemethod=default]{mdframed}
\usepackage{mathtools}
\usepackage[most]{tcolorbox}
\tcbset{myformula/.style={
arc=0pt,
outer arc=0pt,
colback=blue!10,
colframe=green,
boxrule=0.8pt,
left=2pt,
right=2pt,
highlight math style={
arc=0pt,
outer arc=0pt,
colback=green,
colframe=red.
}
}
}
\begin{document}
\begin{tcolorbox}[ams align, myformula]
& Q(z) = a_{n}z^{n} + a_{n-1}z^{n-1} + \dots + a_{2}z^{2} + a_{1}z^{1} + a_{0}
= 0
\intertext{The conditions for stability are}
& Q(1) > 0
\intertext{and:}
& \begin{dcases*}
Q(-1) > 0, & if $n$ is even;\\
Q(-1) < 0, & if $n$ is odd.
\end{dcases*}
\end{tcolorbox}
\end{document}
输出为: