![将对齐环境开头的单词发送到左侧](https://linux22.com/image/324845/%E5%B0%86%E5%AF%B9%E9%BD%90%E7%8E%AF%E5%A2%83%E5%BC%80%E5%A4%B4%E7%9A%84%E5%8D%95%E8%AF%8D%E5%8F%91%E9%80%81%E5%88%B0%E5%B7%A6%E4%BE%A7.png)
我想将方程式中的单词“Associativity”发送到此枚举环境的左侧,如下所示:
这是我的代码:
\documentclass{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\pagestyle{empty}
\newcommand\Item[1][]{%
\ifx\relax#1\relax \item \else \item[#1] \fi
\abovedisplayskip=0pt\abovedisplayshortskip=0pt~\vspace*{-\baselineskip}}
\begin{document}
\begin{enumerate}%[align=left,style=nextline,leftmargin=*,labelsep=\parindent,label=\textbf{(\alph*)}]
\Item
\begin{align*}
Associativity:\hspace{1cm}&\forall~\alpha,~\beta,\gamma~\epsilon~\digamma\\
(\alpha+\beta)+\gamma & = \alpha+(\beta +\gamma )\\
(\alpha\cdot\beta)\cdot\gamma & = \alpha\cdot(\beta \cdot\gamma )
\end{align*}
\end{enumerate}
\end{document}
答案1
另一个相当简单的解决方案:
\documentclass{article}
\usepackage{mathtools,amssymb}
\usepackage[margin=30mm,showframe]{geometry}
\begin{document}
\begin{enumerate}
\item
Associativity:\qquad $\begin{aligned}[t]
\forall~& \alpha,~\beta,\gamma~\epsilon~\digamma \\
(\alpha+\beta)+\gamma & = \alpha+(\beta +\gamma) \\
(\alpha\cdot\beta)\cdot\gamma & = \alpha\cdot(\beta\cdot\gamma)
\end{aligned}$
\end{enumerate}
\end{document}
这使:
因为需要mathtools
定义环境的包aligned
。不需要特殊项,上述解决方案适用于任何列表。
答案2
\Item
您可以在 之后和 之前放置单词“Associativity” \begin{align*}
。另外,请确保删除指令\hspace{1cm}
。
顺便说一句,我认为你应该写\in
的不是\epsilon
。
\documentclass{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\pagestyle{empty}
\newcommand\Item[1][]{%
\ifx\relax#1\relax \item \else \item[#1] \fi
\abovedisplayskip=0pt\abovedisplayshortskip=0pt~\vspace*{-\baselineskip}}
\begin{document}
\begin{enumerate}
\Item \emph{Associativity}:
\begin{align*}
&\forall~\alpha,~\beta,\gamma~\epsilon~\digamma\\
(\alpha+\beta)+\gamma & = \alpha+(\beta +\gamma )\\
(\alpha\cdot\beta)\cdot\gamma & = \alpha\cdot(\beta \cdot\gamma )
\end{align*}
\end{enumerate}
\end{document}
答案3
我会在以下环境下完成此操作alignedat
:
\documentclass{article}
\usepackage{mathtools,amsfonts,amssymb,amsthm}
\pagestyle{empty}
\newcommand\Item[1][]{%
\ifx\relax#1\relax \item \else \item[#1] \fi
\abovedisplayskip=0pt\abovedisplayshortskip=0pt~\vspace*{-\baselineskip}}
\begin{document}
\begin{enumerate}%
\Item Associativity:\quad
$\begin{alignedat}[t]{2}
& \forall~\alpha,~\beta,\gamma\in\digamma, & \quad (\alpha+\beta)+\gamma & = \alpha+(\beta +\gamma )\\
& & (\alpha\cdot\beta)\cdot\gamma & = \alpha\cdot(\beta \cdot\gamma )
\end{alignedat} $
\end{enumerate}
\end{document}