6
\textbf{Question 2}

    a) 
    \begin{align*}
    P(a<\mu<b|\mathbf{y}) & = P(a<\mu|\mathbf{y}<b) \\
    & = \int_{a}^b p(\mu|\mathbf{y}) d\mu  \ \ \text{where} \ \ p(\mu|\mathbf{y}) \ \ \text{is a Student \textit{t} pdf.} \\
    & = \int_{\mu} I_{(a<\mu|\mathbf{y}<b)} p(\mu|\mathbf{y}) d\mu
    \end{align*}
    \begin{align*}
    \text{where} \ \ I_{(a<\mu|\mathbf{y}<b)} = \begin{cases} 1 & \text{if} \ a<\mu|\mathbf{y}<b \\ 0 & \text{otherwise}  \end{cases}
    \end{align*}

produces:

enter image description here

But I want it to look like:

enter image description here

ie, the first line of the align starts on the same line as a)

How can I adjust the code to do this?

3
  • 2
    Possible duplictate of tex.stackexchange.com/questions/58141/…
    – Ruben
    Aug 25 '13 at 18:48
  • 2
    Off-topic hint: don't use | to denote the "given" or "conditional on" symbol. There's a command called \mid that inserts a vertical bar, but with thin spaces on either end. I think you'll like the resulting look.
    – Mico
    Aug 25 '13 at 19:39
  • @Mico Thanks for that, I will start using it from now on :)
    – TrueTears
    Aug 25 '13 at 20:07
6

I believe you may want the aligned environment

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{enumerate}
    \item 
    $\begin{aligned}[t]
        P(a<\mu<b|\mathbf{y}) & = P(a<\mu|\mathbf{y}<b)                                                                                             \\
                              & = \int_{a}^b p(\mu|\mathbf{y}) d\mu  \ \ \text{where} \ \ p(\mu|\mathbf{y}) \ \ \text{is a Student \textit{t} pdf.} \\
                              & = \int_{\mu} I_{(a<\mu|\mathbf{y}<b)} p(\mu|\mathbf{y}) d\mu                                                        
    \end{aligned}$
\end{enumerate}
\end{document}
4
  • to the mods: would you prefer me to delete this and post it as an answer to Ruben's link?
    – cmhughes
    Aug 25 '13 at 19:10
  • Can you explain what [t] in \begin{aligned}[t] means? May 26 '20 at 19:33
  • I think of it as "top aligned", but texdoc amsmath will give you definitive
    – cmhughes
    May 26 '20 at 20:27
  • How can we created the same with number equation
    – Jai Kumar
    May 27 '20 at 5:37

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.