# Align inside enumerate

Is it possible to align \items content inside enumerateenvironment?

My expected output is:

Which I got manually, (adjusting with \hspace)

Aligning formulas inside enumerate

Equations inside enumerate aligned on item's number

don't respond my question because they try to use align inside the \items

Neither Enumerate inside align

MWE

\documentclass{article}
\usepackage{enumitem}

\begin{document}
\begin{enumerate}
\item $X$ integrable $\Longrightarrow E[X|\mathcal{A}_1]$ integrable y $E[E[X|\mathcal{A}_1]]=E[X]$
\item $\mathcal{A}_1=\{\emptyset,\Omega\} \Longrightarrow E[X|\mathcal{A}_1](\omega)=E[X],\ \forall \omega\in\Omega$
\item $\mathcal{A}_1=\mathcal{A}\Longrightarrow E[X|\mathcal{A}_1]=X \ c.s.[P_1]$
\end{enumerate}
\end{document}

• Probably the only thing you can do here is to make boxes of the same size to wrap the part before \Longrightarrow. Do be honest, I don't see the point in aligning here. Nov 29 '21 at 12:19

Assuming this is not the only such display in your document, you might use eqparbox facilities.

\documentclass{article}
\usepackage{enumitem}
\usepackage{eqparbox}

\newcounter{mathenum}

\newenvironment{mathenum}
{\begin{enumerate}\stepcounter{mathenum}}
{\end{enumerate}}
\newcommand{\mathenumitem}[3]{%
\item
\eqmakebox[@@\themathenum @[email protected]][l]{#1}%
${}\Longrightarrow{}$%
\eqmakebox[@@\themathenum @[email protected]][l]{#2}%
}

\begin{document}

\begin{mathenum}
\mathenumitem{$X$ integrable}
{$E[X|\mathcal{A}_1]$ integrable y $E[E[X|\mathcal{A}_1]]=E[X]$}
{}
\mathenumitem{$\mathcal{A}_1=\{\emptyset,\Omega\}$}
{$E[X|\mathcal{A}_1](\omega)=E[X],\ \forall \omega\in\Omega$}
{}
\mathenumitem{$\mathcal{A}_1=\mathcal{A}$}
{$E[X|\mathcal{A}_1]=X$}
{c.s.$[P_1]$}
\end{mathenum}

\end{document}


A slightly different version where the central symbol (which is supposed to be an arrow) can vary:

\documentclass{article}
\usepackage{enumitem}
\usepackage{eqparbox}

\newcounter{mathenum}

\newenvironment{mathenum}
{\begin{enumerate}\stepcounter{mathenum}}
{\end{enumerate}}
\newcommand{\mathenumitem}[4]{%
\item
\eqmakebox[@@\themathenum @[email protected]][l]{#1}%
\eqmakebox[@@\themathenum @[email protected]][c]{${}#2{}$}%
\eqmakebox[@@\themathenum @[email protected]][l]{#3}%
}

\begin{document}

\begin{mathenum}
\mathenumitem{$X$ integrable}
{\Longrightarrow}
{$E[X|\mathcal{A}_1]$ integrable y $E[E[X|\mathcal{A}_1]]=E[X]$}
{}
\mathenumitem{$\mathcal{A}_1=\{\emptyset,\Omega\}$}
{\Longleftrightarrow}
{$E[X|\mathcal{A}_1](\omega)=E[X],\ \forall \omega\in\Omega$}
{}
\mathenumitem{$\mathcal{A}_1=\mathcal{A}$}
{\Longleftarrow}
{$E[X|\mathcal{A}_1]=X$}
{c.s.$[P_1]$}
\end{mathenum}

\end{document}


• The newenvironment you defined is so useful. Is it possible to have different symbols in each line? For example, Longright arrow in the first one, and iff in the second one Nov 30 '21 at 11:27
• @Á.Iborra Add other arguments along the same lines. You will probably need another label for \eqmakebox. I added a sketch. Nov 30 '21 at 11:44
• First time using \eqmakebox, do you know why can't I nest mathenum into tcolorbox theorem? Nov 30 '21 at 15:29
• @Á.Iborra This warrants a new question with the details. My crystal ball is under maintainance. ;-) Nov 30 '21 at 15:34
• It worked well, typo mistake. Your answer was so clear that I asked again before looking for fails. Thank you for the details Nov 30 '21 at 15:46

I wouldn't persist with use of enumerate. Numbers can be writen for example in alignat* examle encapsulated in fleqn environment defined in the nccmath package:

\documentclass{article}
\usepackage{nccmath}
%---------------- Show page layout. Don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
\begin{fleqn}
\begin{alignat*}{3}
&1.\ X \text{ integrable}\hspace{-11em}
&\quad&   \Longrightarrow E[X|\mathcal{A}_1] \text{ integrable y }
E[E[X|\mathcal{A}_1]]=E[X]                      \\
&2.\ \mathcal{A}_1 =\{\emptyset,\Omega\}
&&   \Longrightarrow E[X|\mathcal{A}_1](\omega)=E[X],\ \forall \omega\in\Omega
\\
&3.\ \mathcal{A}_1 =\mathcal{A}
&&   \Longrightarrow E[X|\mathcal{A}_1]=X \ c.s.[P_1]        \tag{$c.s.[P_1]$}
\end{alignat*}
\end{fleqn}
\end{document}


(red lines indicate text borders)