所以我希望有一些左对齐的文本和它旁边的数组。但是,当我尝试时,数组略高于文本(下面添加的图片)。即使\aligned
不起作用。如果这与问题相关,文本位于证明环境中。我已经包含了证明环境
\declaretheoremstyle[
spaceabove=0pt,
spacebelow=1pt,
headfont=\it,
bodyfont=\normalfont,
postheadspace=6pt,
qed=\qedsymbol,
headpunct=
]{mypf}
\declaretheorem[numbered=no, name=Proof, style=mypf]{pf}
\begin{pf}
\textbf{N2} (\textit{Positive homogeneity}) $||\lambda v||=d(\lambda v,\lambda 0)=|\lambda | d(v,0)=|\lambda | \cdot||v||.$ \vspace{0.1cm} \\
$\begin{aligned}
\left.\textbf{N3 } (\textit{Triangle inequality})
\right. \begin{array}{lll}
||v+w||=d(v+w,0)&\leq &d(v+w,w) + d(w,0) \\
&=& ||v||+||w||
\end{array}
\end{aligned}
\end{pf}
答案1
我不会array
在aligned
环境中嵌套环境。使用单个aligned
环境就足够了。
对于下面的截图,我还用 替换了所有 的实例|...|
,并用 替换\abs{...}
了所有 的实例,其中和是借助包的指令定义的宏。还请注意环境定位说明符的使用,它允许将 QED 符号放在底行。最后,我创建了一个名为 的宏来指示“距离指示器”;采用这种方式可以改善和之间的间距。|| ... ||
\norm{...}
\abs
\norm
\DeclarePairedDelimiter
mathtools
[b]
aligned
\dist
\abs{\lambda}
d(v,0)
\documentclass{article}
\usepackage{mathtools}
\DeclareMathOperator{\dist}{\mathit{d}}
\DeclarePairedDelimiter\abs\lvert\rvert
\DeclarePairedDelimiter\norm\lVert\rVert
\usepackage{amsthm,thmtools}
\declaretheoremstyle[
spaceabove=0pt,
spacebelow=1pt,
headfont=\it,
bodyfont=\normalfont,
postheadspace=6pt,
qed=\qedsymbol,
headpunct=
]{mypf}
\declaretheorem[numbered=no, name=Proof, style=mypf]{pf}
\begin{document}
\begin{pf}
\textbf{N2} (\textit{Positive homogeneity})
$\norm{\lambda v}=\dist(\lambda v,\lambda 0)
= \abs{\lambda} \dist(v,0)
= \abs{\lambda}\cdot\norm{v}.$
\medskip\noindent
\hspace{3.15em}%
$\begin{aligned}[b]
\text{\textbf{N3} (\textit{Triangle inequality}) }
\norm{v+w}&= \dist(v+w,0) \\
&\leq \dist(v+w,w) + \dist(w,0) \\
&= \norm{v}+\norm{w}\,.
\end{aligned}$
\end{pf}
\end{document}
答案2
我建议使用这种变体布局,基于alignedat{3}
两条线路的单一布局。它使用 \mathrlap
来自的命令mathtools
:
\documentclass{article}
\usepackage{mathtools, amssymb}
\usepackage{amsthm, thmtools}
\declaretheoremstyle[
spaceabove=0pt,
spacebelow=1pt,
headfont=\itshape,
bodyfont=\normalfont,
postheadspace=6pt,
qed=\qedsymbol,
headpunct=
]{mypf}
\declaretheorem[numbered=no, name=Proof, style=mypf]{pf}
\begin{document}
\begin{pf}\!: \\[1ex]
$ \begin{alignedat}[b]{3}
& \textbf{N2}\ (\textit{Positive homogeneity})& \|\lambda v\|&=d(\lambda v,\lambda 0)\mathrlap{=|\lambda| d(v,0)=|\lambda | \cdot\|v\|. }\\[1ex]
& \textbf{N3 }(\textit{Triangle inequality}) & \|v+w\| & =d(v+w,0) & & \leq d(v+w,w) + \mathrlap{d(w,0)} \\
& & & & & = \|v\|+\|w\|
\end{alignedat} $
\end{pf}
\end{document}