0

Help with alignat

Can someone please write this up using the alignat command. It should be aligned at the implies sign and the equals sign, with all terms aligned towards the equal sign.

4

with aligned and alignat:

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}
\[
\begin{aligned}
            &   &   \frac{a}{b} & = 0.5         \\
\implies    &   &   a           & = 0.5b        \\
\implies    &   &   ka          & = 0.5kb       \\
\implies    &   &   k^2a^2      &  =0.25k^2 b^2
\end{aligned}
\]

or

\[
\begin{aligned}
            &\quad  &   \frac{a}{b} & = 0.5         \\
\implies    &       &   a           & = 0.5b        \\
\implies    &       &   ka          & = 0.5kb       \\
\implies    &       &   k^2a^2      &  =0.25k^2 b^2
\end{aligned}
\]

or

\begin{alignat*}{3}
            &\quad  &  \frac{a}{b} & = 0.5         \\
\implies    &       &   a          & = 0.5b        \\
\implies    &       &   ka         & = 0.5kb       \\
\implies    &       &   k^2a^2     & = 0.25k^2 b^2
\end{alignat*}

\end{document}

enter image description here

2
\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{2}
&&\dfrac{a}{b} &= 0.5\\
\implies&&a &= 0.5b\\
\implies&&ka &=0.5kb\\
\implies&\quad&k^2a^2 &= 0.25k^2 b^2
\end{alignat*}
\end{document}

enter image description here

It can also be easily done with a TABstack or an aligned block.

\documentclass[12pt]{article}
\usepackage{tabstackengine,amsmath}
\TABstackMath
\setstackgap{S}{8pt}
\begin{document}
\[
\alignShortstack{
&&\dfrac{a}{b} =& 0.5\\
\implies&&a =& 0.5b\\
\implies&&ka =&0.5kb\\
\implies&&k^2a^2 =& 0.25k^2 b^2
}
\]

\[
\begin{aligned}
&&\dfrac{a}{b} &= 0.5\\
\implies&&a &= 0.5b\\
\implies&&ka &=0.5kb\\
\implies&&k^2a^2 &= 0.25k^2 b^2
\end{aligned}
\]

\end{document}

enter image description here

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.