16

How to make the first line of aligned equations sit in the same baseline as the bullet and make the equation left justified?

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{itemize}
    \item $3!=3\times2\times1=6$
    \item $\tfrac{5!}{3!}=\tfrac{5\times4\times3!}{3!}=5\times4=20$
    \item \begin{align*}
                    \frac{n!}{(n-2)!}   &=\frac{n\times(n-1)\times(n-2)!}{(n-2)!}\\
                                                        &=n\times(n-1)\\
                                                        &=n^2-n
                \end{align*}
\end{itemize}
\end{document}

1 Answer 1

17

the aligned environment works just fine, with the [t] option to get the bullet on the first line:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{itemize}
    \item $3!=3\times2\times1=6$
    \item $\tfrac{5!}{3!}=\tfrac{5\times4\times3!}{3!}=5\times4=20$    
    \item $\!\begin{aligned}[t]
                    \frac{n!}{(n-2)!}   &=\frac{n\times(n-1)\times(n-2)!}{(n-2)!}\\
                                                        &=n\times(n-1)\\
                                                        &=n^2-n
                \end{aligned}$
\end{itemize}

\end{document}

output of example code

edit: added a negative thin space \! just before the aligned block to counteract the thin space \, built into the beginning of aligned. for some background, see the question Why is there a \, space at the beginning of the “aligned” environment?.

5
  • I think you need to insert \! between $ and \begin{aligned} to remove the unnecessary white space. Apr 14, 2013 at 17:47
  • @Ohmyghost: Thanks for the good question. I just had a minor related question. Suppose in addition to what you desire in the problem, one also would like to make sure the equal signs appearing first in each bullet point are vertically aligned, how can we go about this please? (in other words inter-bullet alignment, so to speak) Sep 21, 2014 at 13:59
  • @AbhimanyuArora: I don't understand. Sorry. Please show me the sample by your handwriting. Sep 21, 2014 at 14:07
  • 1
    @AbhimanyuArora -- you could use \widthof on the pre-equal-sign parts of the first two as described in this answer. you'd have to flush those parts to the right in the box with \hfil, otherwise they'd be centered in the box. Sep 21, 2014 at 14:31
  • That's elegant, barbara!. @Ohmyghost, just the vertical alignment of = signs of equations in two different bullet points above. Thanks both. Sep 21, 2014 at 15:35

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.