-1

This question already has an answer here:

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

marked as duplicate by egreg align Mar 12 '18 at 12:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Use aligned in an inline equation. – Artificial Stupidity Mar 10 '18 at 21:50
  • 1
    Welcome to TeX SX! What is 3(a)? You should post a full compilable code. – Bernard Mar 10 '18 at 21:51
  • 1
    in any event, remove the blank lines. blank lines aren't permitted in math, either in-line or display. – barbara beeton Mar 10 '18 at 21:59
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.

  • 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 9:47
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.

  • @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 1:29
  • @adhankar: add [t] after the second \begin{aligned} (it means top alignment) as was done by Zarko. – user94293 Mar 11 '18 at 4:53
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.

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