Используя \eqmakebox[<tag>][<align>]
(из eqparbox
), вы можете поместить все элементы под одним и тем же <tag>
в коробку максимальной ширины вместе с индивидуальным <align>
при необходимости.Ниже у меня есть \eqmakebox[LHS][r]
, чтобы все элементы с тегом LHS
были r
выровнены по свету.Результатом является выравнивание вокруг =
.
![enter image description here](https://i.stack.imgur.com/uwOOJ.png)
\documentclass{article}
\usepackage{eqparbox}
\begin{document}
\begin{enumerate}
\item[Commutative] $ a + b = b + a $
\item[Associative] $a + (b + c) = (a + b) + c$
\item[Distributive] $ a(b + c) = ab + ac $
\end{enumerate}
\begin{enumerate}
\item[Commutative] $ \eqmakebox[LHS][r]{$a + b$} = b + a $
\item[Associative] $\eqmakebox[LHS][r]{$a + (b + c)$} = (a + b) + c$
\item[Distributive] $ \eqmakebox[LHS][r]{$a(b + c)$} = ab + ac $
\end{enumerate}
\end{document}
В качестве альтернативы вы можете измерить самый широкий элемент самостоятельно:
\newlength{\widestelement}
\settowidth{\widestelement}{$a + (b + c)$}
и затем используйте
\begin{enumerate}
\item[Commutative] $ \makebox[\widestelement][r]{$a + b$} = b + a $
\item[Associative] $\makebox[\widestelement][r]{$a + (b + c)$} = (a + b) + c$
\item[Distributive] $ \makebox[\widestelement][r]{$a(b + c)$} = ab + ac $
\end{enumerate}