我想在枚举环境中对齐方程式,或者使用另一个环境获得类似的结果。以下是实际代码:
\documentclass{article}
\usepackage{amsthm}
\begin{document}
\begin{enumerate}
\item $\forall a,b \in K \qquad a + b \in K$
\item $\forall a,b \in K \qquad a \cdot b \in K$
\item $\forall a,b \in K \qquad a + b = b + a$
\item $\forall a,b,c \in K \qquad a + (b + c) = (a + b) + c$
\item $\exists n_{+} \in K \ \forall a \in K \qquad a + n_{+} = a$
\item $\forall a \in K \ \exists a_{+}' \in K \qquad a + a_{+}' = n_{+}$
\item $\forall a,b \in K \qquad a \cdot b = b \cdot a$
\item $\forall a,b,c \in K \qquad a \cdot (b \cdot c) = (a \cdot b) \cdot c$
\item $\forall a,b,c \in K \qquad a \cdot (b + c) = a \cdot b + a \cdot c$
\item $\exists n_{\cdot} \in K \ \forall a \in K\backslash\{n_{+}\} \qquad a \cdot n_{\cdot} = a$
\item $\forall a \in K\backslash\{n_{+}\} \ \exists a_{\cdot}' \in K \qquad a \cdot a_{\cdot}' = n_{\cdot}$
\end{enumerate}
\end{document}
我希望第二列中的方程式左对齐。
答案1
这里有一种方法可以做到这一点,tabular
它会自动编号
\documentclass{article}
\usepackage{array}
\newcounter{rowcount}
\setcounter{rowcount}{0}
\begin{document}
\begin{tabular}{@{\stepcounter{rowcount}\therowcount. }ll}
$\forall a,b \in K $ & $ a + b \in K$\\
$\forall a,b \in K $ & $ a \cdot b \in K$\\
$\forall a,b \in K $ & $ a + b = b + a$\\
$\forall a,b,c \in K $ & $ a + (b + c) = (a + b) + c$\\
$\exists n_{+} \in K \ \forall a \in K $ & $ a + n_{+} = a$\\
$\forall a \in K \ \exists a_{+}' \in K $ & $ a + a_{+}' = n_{+}$\\
$\forall a,b \in K $ & $ a \cdot b = b \cdot a$\\
$\forall a,b,c \in K $ & $ a \cdot (b \cdot c) = (a \cdot b) \cdot c$\\
$\forall a,b,c \in K $ & $ a \cdot (b + c) = a \cdot b + a \cdot c$\\
$\exists n_{\cdot} \in K \ \forall a \in K\backslash\{n_{+}\} $ & $ a \cdot n_{\cdot} = a$\\
$\forall a \in K\backslash\{n_{+}\} \ \exists a_{\cdot}' \in K $ & $ a \cdot a_{\cdot}' = n_{\cdot}$\\
\end{tabular}
\end{document}
我从这回答。
答案2
是否必须是一个enumerate
环境?使用array
环境是否可以接受?
\documentclass{article}
\usepackage{array}
\newcounter{mycount}
\newcolumntype{Z}{>{\refstepcounter{mycount}\themycount.}r}
\newcolumntype{L}{>{\displaystyle}l}
\newcolumntype{R}{>{\displaystyle}r}
\begin{document}
\[
\renewcommand{\arraystretch}{1.5}
\begin{array}{@{} Z R @{\qquad} L @{}}
& \forall a,b \in K & a + b \in K \\
& \forall a,b \in K & a \cdot b \in K \\
& \forall a,b \in K & a + b = b + a \\
& \forall a,b,c \in K & a + (b + c) = (a + b) + c \\
& \exists n_{+} \in K \ \forall a \in K & a + n_{+} = a \\
& \forall a \in K \ \exists a_{+}' \in K & a + a_{+}' = n_{+} \\
& \forall a,b \in K & a \cdot b = b \cdot a \\
& \forall a,b,c \in K & a \cdot (b \cdot c) = (a \cdot b) \cdot c \\
& \forall a,b,c \in K & a \cdot (b + c) = a \cdot b + a \cdot c \\
& \exists n_{\cdot} \in K \ \forall a \in K\setminus\{n_{+}\} & a \cdot n_{\cdot} = a \\
& \forall a \in K\setminus\{n_{+}\} \ \exists a_{\cdot}' \in K & a \cdot a_{\cdot}' = n_{\cdot}
\end{array}
\]
\end{document}
答案3
在这个简单的情况下,我经常使用multicol
包。这{2}
对应于两列的对齐。我用它\usepackage{geometry}
来获得两列之间的正确间距。
\documentclass{article}
\usepackage{amsthm}
\usepackage{multicol}
\usepackage{geometry}
\begin{document}
\begin{multicols}{2}
\begin{enumerate}
\item $\forall a,b \in K,\, a + b \in K$
\item $\forall a,b \in K \qquad a \cdot b \in K$
\item $\forall a,b \in K \qquad a + b = b + a$
\item $\forall a,b,c \in K \qquad a + (b + c) = (a + b) + c$
\item $\exists n_{+} \in K \ \forall a \in K \qquad a + n_{+} = a$
\item $\forall a \in K \ \exists a_{+}' \in K \qquad a + a_{+}' = n_{+}$
\item $\forall a,b \in K \qquad a \cdot b = b \cdot a$
\item $\forall a,b,c \in K \qquad a \cdot (b \cdot c) = (a \cdot b) \cdot c$
\item $\forall a,b,c \in K \qquad a \cdot (b + c) = a \cdot b + a \cdot c$
\item $\exists n_{\cdot} \in K \ \forall a \in K\backslash\{n_{+}\} \qquad a \cdot n_{\cdot} = a$
\item $\forall a \in K\backslash\{n_{+}\} \ \exists a_{\cdot}' \in K \qquad a \cdot a_{\cdot}' = n_{\cdot}$
\end{enumerate}
\end{multicols}
\end{document}
答案4
我已经使用以下方法处理了该问题:
\documentclass{article}
\usepackage{tabto}
\begin{document}
\TabPositions{0.4\linewidth}
\begin{enumerate}
\item $\forall a,b \in K$ \tab $a + b \in K$
\item $\forall a,b \in K$ \tab $a \cdot b \in K$
\item $\forall a,b \in K$ \tab $a + b = b + a$
\item $\forall a,b,c \in K$ \tab $a + (b + c) = (a + b) + c$
\item $\exists n_{+} \in K, \forall a \in K$ \tab $a + n_{+} = a$
\item $\forall a \in K, \exists a_{+}' \in K$ \tab $a + a_{+}' = n_{+}$
\item $\forall a,b \in K$ \tab $a \cdot b = b \cdot a$
\item $\forall a,b,c \in K$ \tab $a \cdot (b \cdot c) = (a \cdot b) \cdot c$
\item $\forall a,b,c \in K$ \tab $a \cdot (b + c) = a \cdot b + a \cdot c$
\item $\exists n_{\cdot} \in K, \forall a \in K\backslash\{n_{+}\}$ \tab $a \cdot n_{\cdot} = a$
\item $\forall a \in K\backslash\{n_{+}\}, \exists a_{\cdot}' \in K$ \tab $a \cdot a_{\cdot}' = n_{\cdot}$
\end{enumerate}
\end{document}
不过,Willoughby 提供的解决方案看起来更好。