以下是一些代码:
\documentclass{article}
\usepackage{enumitem}
\usepackage{pgfplots}
\usepackage{amsmath}
\begin{document}
\begin{itemize}[label=$\bullet$]
\item Example1
\begin{tabular}[t]{l}
\begin{tabular}{@{}c@{}}$A \cap (B \cap C)=(A \cap B)\cap C$ \\ $A \cup (B \cup C)=(A \cup B)\cup C$\end{tabular}
\end{tabular}
\item Example2
\begin{tabular}[t]{l}
\begin{tabular}{@{}c@{}}$A \cap (A\cup B) = A$ \\ $A \cup (A\cap B) = A$\end{tabular}
\end{tabular}
\item Example3
\begin{tabular}[t]{l}
\begin{tabular}{@{}c@{}}$A \cap (B \cup C)=(A \cap B)\cup (A \cap B)$ \\ $A \cup (B \cap C)=(A \cup B)\cap (A \cup B)$\end{tabular}
\end{tabular}
\end{itemize}
\end{document}
但我得到的输出是:
我怎样才能将这些方程式拖到右侧,同时又使它们在等号处对齐?像这样:
答案1
一个(据我所知不是很为人所知的)很好的特性是你可以在里面\intertext
放一些东西;只有第一个必须在环境之外。\item
\item
align
\documentclass{article}
\usepackage{enumitem,mathtools}
% Just to see the baseline
\newcommand*{\foo}{\rlap{\vrule width 5cm height 0pt depth 0.2pt}}
\begin{document}
\begin{itemize}[label=\textbullet]
\abovedisplayskip=-\baselineskip
\item Example1\foo
\begin{align*}
A \cap (B \cap C) &=(A \cap B)\cap C \\
A \cup (B \cup C) &=(A \cup B)\cup C
\intertext{\item Example2\foo}
A \cap (A \cup B) &= A \\
A \cup (A \cap B) &= A
\intertext{\item Example3\foo}
A \cap (B \cup C) &= (A \cap B) \cup (A \cap B) \\
A \cup (B \cap C) &= (A \cup B) \cap (A \cup B)
\end{align*}
\end{itemize}
\end{document}
为了使公式的基线与\item
I 的基线对齐,设置\abovedisplayskip
为。但是,-\baselineskip
为了在 的各种出现之后也能正常工作,我们需要包,该包的扩展确实会稍微改变 的定义。没有(即只有)结果将是\intertext
mathtools
amsmath
\intertext
mathtools
amsmath