3

So I wish to have some left-aligned text and an array next to it. However, when I try, the array is slightly above the text (picture added below). Even \aligned isn't working. The text is within a proof environment if that is pertinent to the question. I have included the proof environment

\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}

enter image description here

  • 4
    Probably try with \begin{array}[t] – leandriis Feb 9 at 20:20
  • 2
    Off-topic: Please change all instances of || to \lVert and \rVert, respectively. (You will need to load the amssymb package.) – Mico Feb 9 at 20:29
5

I wouldn't nest an array environment inside an aligned environment. Using a single aligned environment suffices.

For the following screenshot, I've also replaced all instances of |...| with \abs{...}, and all instances of || ... || with \norm{...}, where \abs and \norm are macros defined with the help of the \DeclarePairedDelimiter directive of the mathtools package. Note also the use of the [b] positioning specifier for the aligned environment, which allows placing the QED symbol in the bottom row. Finally, I've created a macro named \dist to indicate the "distance indicator"; taking this route improves the spacing between, say, \abs{\lambda} and d(v,0).

enter image description here

\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}
| improve this answer | |
3

I propose this variant layout, based on a single alignedat{3} for both lines. It uses the \mathrlap command from 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} 

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.