1

I have done plenty of research, and I haven't found a solution that suits what I'm looking for (this closed question by needs for clarity is what I'm looking for). I want to center-align multiple steps of a math solving equation aligned by their first character. Something like:

\begin{frame}{Convergence [Lecture 2.5]}
Law of Large Numbers (LLN)

[ & \text{If } X_1, X_2, .., X_n \text{ are } \iid \text{ and } E[X_i]=\mu \text{ then:} \ & \overline{X}n=\frac{1}{n}\sum{i=1}^{n}X_i \ & \overline{X}_n \xrightarrow{d} \mu \text{ (strong LLN)} & \overline{X}_n \xrightarrow{P} \mu \text{ (weak LLN)}]

\end{frame}

Where this equation as a whole is centered but aligned to &. I was using $$ but I found that wasn't a good practice as it was deprecated. Also, I found that [\\..\\] was a good practice to write equations so I'm using that form, and I'm trying to find a way to use it with & to align (example), but it seems to only work with \begin{align} where I prefer to use [\\..\\] because is more compact. Another way I tried is using [\\..\\] for each line of the equation, but it seems illogic the alineation would work as they are separated "displays of equations".

Any suggestions?

PS: I'm aiming to write latex following efficient good practices, if you find something in my equation that should be better or more efficient, please feel free to post with the answer to the problem.

Mico
  • 506,678
Chris
  • 291
  • While \[ ...\] is "more compact", as you put it, than \begin{align*}...\end{align*}, it does not allow you to use & symbols to perform an alignment of the type you appear to envisage. – Mico Jun 19 '21 at 07:27
  • you can't "prefer \[ "as that is for single lined equations. You can have a mult-lined construct within it such as a matrix or \begin{aligned} but \\ at the top level in \[ is simply user error. – David Carlisle Jun 19 '21 at 08:32
  • 2
    also since you ask about good practice never leave a blank line in the source before a displayed equation, it generates a spurious white paragraph above it. – David Carlisle Jun 19 '21 at 08:34

1 Answers1

2

Something like this?

enter image description here

Observe that I wouldn't make the definition of the sample mean part of the result of the theorem itself. Using alignat* instead of align* makes it easier to fine-tune the distance between the math statements on the left and the explanatory material on the left, while providing a second alignment point within each row.

\documentclass{beamer}
\DeclareMathOperator{\E}{E} % expectations operator
\begin{document}

\begin{frame}[t]{Convergence [Lecture 2.5]} \begin{theorem}[Laws of Large Numbers, LLNs]

Assume that $X_1, X_2, \dots, X_n$ are iid and that $\E[X]=\mu$.

Put $\overline{X}n=\frac{1}{n}\sum{i=1}^{n}X_i$. Then \begin{alignat}{2} &\overline{X}_n \xrightarrow{d} \mu &\qquad&\textup{strong LLN}\ &\overline{X}_n \xrightarrow{P} \mu && \textup{weak LLN} \end{alignat} \end{theorem} \end{frame}

\end{document}

Mico
  • 506,678