1

The below is close to what I want, using alignat with 2 pairs of right-left-aligned columns:

  1. right-aligned \sigma and y
  2. left-aligned distribution names LogNormal and Normal
  3. empty right-aligned column
  4. left-aligned location parameters 0 and \beta_1 etc.

But the distribution names have different lengths (LogNormal vs Normal) so I would prefer to only start aligning the location parameters starting with the second line (\beta_1 etc.). I wonder if this is possible, since it essentially would mean changing the numbers of alignment columns across the rows, correct ?

\begin{alignat*}{2}
\sigma &\sim \text{LogNormal}(&&0, 1) \\
y &\sim \text{Normal}(&&\beta_1 \\
& &&+ \beta_2 \\
& &&+ \beta_3, \\
& && \sigma )
\end{alignat*}

enter image description here

vs what I want, which I can obtain in a super hacky way like:

\begin{align*}
\sigma &\sim \text{LogNormal}(0, 1) \\
y &\sim \text{Normal}(\beta_1 \\
& \hspace{1.7cm} + \beta_2 \\
& \hspace{1.7cm} + \beta_3, \\
& \hspace{1.7cm} \sigma )
\end{align*}

enter image description here

1 Answer 1

1

Use a nested aligned:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
\sigma &\sim \operatorname{LogNormal}(0, 1) \\
y &\sim \operatorname{Normal}(
  \begin{aligned}[t]
  & \beta_1 \\
  & + \beta_2 \\
  & + \beta_3, \\
  & \sigma )
  \end{aligned}
\end{align*}

\end{document}

enter image description here

Note \operatorname rather than \text.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .