-1

I'm trying to left align the following equation so that it's on the same line as 3 (a).

\begin{enumerate}
\item 
\begin{align*}

|\gamma(t)| &= [\gamma(t) \cdot \gamma(t)]^{\frac{1}{2}}\\
&=[(cos(t)p + sin(t)v) \cdot (cos(t)p + sin(t)v)]^{\frac{1}{2}}\\
&=[cos^2(t)(p \cdot p) + sin^2(t)(v \cdot v) + 2cos(t)sin(t)(p \cdot v) ]^{\frac{1}{2}}

\end{align*}
\end{enumerate}

enter image description here

Edit: After the fix, this is the result I get: enter image description here

    \item
    \begin{enumerate}
        \item 
        $\begin{aligned}[t]
        |\gamma(t)| &= [\gamma(t) \cdot \gamma(t)]^{\frac{1}{2}}, \forall t \in \mathbb{R}\\
        &=[(\cos(t)p + \sin(t)v) \cdot (\cos(t)p + \sin(t)v)]^{\frac{1}{2}}\\
        &=[\cos^2(t)(p \cdot p) + \sin^2(t)(v \cdot v) + 2\cos(t)\sin(t)(p \cdot v) ]^{\frac{1}{2}}\\
        &=[\cos^2(t)(1) + \sin^2(t)(1) + 2\cos(t)\sin(t)(0) ]^{\frac{1}{2}}\\
        &=[\cos^2(t) + \sin^2(t)]^{\frac{1}{2}}\\
        &=1
        \end{aligned}$

        \item
        $\begin{aligned}
        |\gamma'(t)| &= [\gamma'(t) \cdot \gamma'(t)]^{\frac{1}{2}}, \forall t \in \mathbb{R}\\
        &=[(\cos(t)p + \sin(t)v)' \cdot (\cos(t)p + \sin(t)v)']^{\frac{1}{2}}\\
        &=[(-\sin(t)p + \cos(t)v) \cdot (-\sin(t)p + \cos(t)v)]^{\frac{1}{2}}\\
        &=[\sin^2(t)(p \cdot p) + \cos^2(t)(v \cdot v) - 2\cos(t)\sin(t)(p \cdot v) ]^{\frac{1}{2}}\\
        &=[\sin^2(t)(1) + \cos^2(t)(1) - 2\cos(t)\sin(t)(0) ]^{\frac{1}{2}}\\
        &=[\sin^2(t) + \cos^2(t)]^{\frac{1}{2}}\\
        &=1
        \end{aligned}$

3 Answers3

4

your question was asked so many times that it is for sure duplicate ... anyway, try the following:

\documentclass{article}
\usepackage{amsmath}
\usepackage{enumitem}

\begin{document}
\begin{enumerate}[label=(\alph*)]
\item   $\begin{aligned}[t] % "[t]" align the first line of `aligned` with
                            % item label text line
|\gamma(t)| & = [\gamma(t) \cdot \gamma(t)]^{\frac{1}{2}}\\
            & = [(\cos(t)p + \sin(t)v) \cdot (\cos(t)p + \sin(t)v)]^{\frac{1}{2}}\\
            & = [\cos^2(t)(p \cdot p) + \sin^2(t)(v \cdot v) 
                    + 2\cos(t)\sin(t)(p \cdot v) ]^{\frac{1}{2}}
        \end{aligned}$
\item   $\begin{aligned}[t] % <--- observe "[t]" 
|\gamma(t)| & = [\gamma(t) \cdot \gamma(t)]^{\frac{1}{2}}       \\
            & = [(\cos(t)p + \sin(t)v) \cdot (cos(t)p + \sin(t)v)]^{\frac{1}{2}}\\
            & = [\cos^2(t)(p \cdot p) + \sin^2(t)(v \cdot v)
                    + 2cos(t)\sin(t)(p \cdot v) ]^{\frac{1}{2}} \\
            & = [p^2\cos^2(t) + v^2\sin^2(t) 
                    + 2pv\cos(t)\sin(t)]^{\frac{1}{2}} 
        \end{aligned}$
\end{enumerate}
\end{document}

enter image description here

edit (i): now i notice that you use sin and cos as variables and not as math operators. now i correct this too.

edit (ii): to show the importance of option [t] (top align) i add another item to the list. in the comments in the program I also added a brief explanation.

Zarko
  • 296,517
  • @ArtificialStupidity, sorry i don't understand you comment. which white space? where it is? i'm really curious and like to learn more about this -). – Zarko Mar 10 '18 at 22:07
  • 1
    As far as I know, this problem has been solved and it is no more necessary to add \! – Bernard Mar 10 '18 at 22:07
  • @Bernard, i made some test and measurements and i didn't see any difference in equation placement nor find any spurious white space. – Zarko Mar 10 '18 at 22:10
  • @Zarko, That does solve the problem, however it creates another problem. For "item #2" it doesn't start at (b), it starts above (b). – adhankar Mar 11 '18 at 01:29
  • @adhankar: add [t] after the second \begin{aligned} (it means top alignment) as was done by Zarko. – user94293 Mar 11 '18 at 04:53
  • @adhankar, see edited answer. i hope that it is now more clear and understandable. – Zarko Mar 11 '18 at 09:31
  • @Zarko thanks for the help, really appreciate it. – adhankar Mar 11 '18 at 14:04
  • @adhankar, if answer solve your problem, you can accept it (by clicking on check mark at the top left side of answer) :-). – Zarko Mar 11 '18 at 17:07
0
\documentclass[preview,border=12pt,varwidth]{standalone}
\usepackage{mathtools}
\begin{document}
\begin{enumerate}
\item This is the setting you are interested in?\\
$\!
\begin{aligned}[t]
|\gamma(t)| &= [\gamma(t) \cdot \gamma(t)]^{\frac{1}{2}}\\
&=[(cos(t)p + sin(t)v) \cdot (cos(t)p + sin(t)v)]^{\frac{1}{2}}\\
&=[cos^2(t)(p \cdot p) + sin^2(t)(v \cdot v) + 2cos(t)sin(t)(p \cdot v) ]^{\frac{1}{2}}
\end{aligned}
$
\end{enumerate}
\end{document}

enter image description here

Edit:

Due to my laziness, I leave the code above as the current condition. As a result, I have to assume that sin used above is the product of s, i, and n. This assumption is also applied to the cos.

Display Name
  • 46,933
  • The need to insert \! at the start of an aligned environment went away sometime in 2016, I believe. And please write \sin and \cos, not sin and cos. – Mico Mar 11 '18 at 09:47
0

If you want to both center and number a mathematical expression, you have to insert a displayed equation, not an in-line one. A solution was proposed by Philippe Goutet in his answer to the question Vertical alignment of align* in enumerate.

Michel Fioc
  • 1,257
  • 9
  • 14