我想将公式按符号的中心对齐,而不是按开头对齐。更准确地说,我有以下内容:
\begin{align*}
A\subseteq B&\iff\forall a\in A:a\in B\\
A\subsetneq B&\iff\forall a\in A:a\in B\land\exists b\in B:b\notin A\\
A=B&\iff A\subseteq B\land B\subseteq A\\
A\cup B&=\{x|x\in A\lor x\in B\}\\
A\cap B&=\{x|x\in A\land x\in B\}\\
A\setminus B&=\{x|x\in A\land x\notin B\}\\
\mathcal P(A)&=\{B|B\subseteq A\}\\
\overline A&=\{x|x\notin A\}
\end{align*}
其结果是
然而,我想要这样的东西:
答案1
我不确定这是否是布局这些定义的最佳方式:符号太多了。无论如何,您可以将符号的一半添加到对齐点的左侧,另一半添加到对齐点的右侧。
\documentclass{article}
\usepackage{amsmath,amssymb}
\newcommand{\crel}[1]{%
\global\setbox1=\hbox{$#1$}%
\global\dimen1=0.5\wd1
\mathrel{\hbox to\dimen1{$#1$\hss}}&\mathrel{\mspace{-\thickmuskip}\hbox to\dimen1{}}%
}
\begin{document}
\[
\begin{aligned}
A\subseteq B \crel{\Longleftrightarrow} \forall a\in A:a\in B\\
A\subsetneq B \crel{\Longleftrightarrow} \forall a\in A:a\in B\land\exists b\in B:b\notin A\\
A=B \crel{\Longleftrightarrow} A\subseteq B\land B\subseteq A\\
A\cup B \crel{=} \{x \mid x\in A\lor x\in B\}\\
A\cap B \crel{=} \{x \mid x\in A\land x\in B\}\\
A\setminus B \crel{=} \{x \mid x\in A\land x\notin B\}\\
\mathcal{P}(A) \crel{=} \{B \mid B\subseteq A\}\\
\overline{A} \crel{=} \{x \mid x\notin A\}
\end{aligned}
\]
\end{document}
不同的布局:
\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
We present some definitions of symbols that are commonly used in set theory:
\begin{itemize}
\item $A\subseteq B$ means `for every $a\in A$, also $a\in B$';
\item $A\subsetneq B$ means `$A\subseteq B$, but $A\ne B$';
\item $A=B$ means `$A\subseteq B$ and $B\subseteq A$' (extensionality of sets);
\item $A\cup B=\{x \mid x\in A\lor x\in B\}$;
\item $A\cap B=\{x \mid x\in A\land x\in B\}$;
\item $A\setminus B=\{x \mid x\in A\land x\notin B\}$;
\item $\mathcal{P}(A)=\{B \mid B\subseteq A\}$;
\item $\overline{A}=\{x \mid x\notin A\}$.
\end{itemize}
Note that the last notation only makes sense when elements are restricted to belong to a
`universe' set that is usually clear from the context.
\end{document}
答案2
\documentclass{article}
\usepackage{amsmath,amssymb}
\sbox0{$\iff$}
\sbox2{$=$}
\newdimen\fudge
\setlength\fudge{0.5\dimexpr\wd0-\wd2\relax}
\begin{document}
\begin{align*}
A\subseteq B&\iff\forall a\in A:a\in B\\
A\subsetneq B&\iff\forall a\in A:a\in B\land\exists b\in B:b\notin A\\
A=B&\iff A\subseteq B\land B\subseteq A\\
A\cup B\kern-\fudge&\kern\fudge=\{x|x\in A\lor x\in B\}\\
A\cap B\kern-\fudge&\kern\fudge=\{x|x\in A\land x\in B\}\\
A\setminus B\kern-\fudge&\kern\fudge=\{x|x\in A\land x\notin B\}\\
\mathcal P(A)\kern-\fudge&\kern\fudge=\{B|B\subseteq A\}\\
\overline A\kern-\fudge&\kern\fudge=\{x|x\notin A\}
\end{align*}
\end{document}
答案3
表格解决方案:(在某些情况下可能有用,但我建议使用@egreg 的解决方案,因为那里的数学环境不是内联的)
\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
\begingroup
\setlength{\tabcolsep}{2pt}
\renewcommand{\arraystretch}{1.4}
\begin{tabular}{rcl}
$A \subseteq B $&$\iff$ &$\forall a\in A:a\in B$\\
$A \subsetneq B$&$\iff$& $\forall a\in A:a\in B\land\exists b\in
B:b \notin A$\\
$A=B$ &$\iff$ &$A\subseteq B\land B\subseteq A$\\
$A\cup B$ &$=$ & $\{x|x\in A\lor x\in B\}$\\
$A\cap B$& $=$ &$\{x|x\in A\land x\in B\}$\\
$A\setminus B$&$=$&$\{x|x\in A\land x\notin B\}$\\
$\mathcal P(A)$ &$=$ &$\{B|B\subseteq A\}$\\
$\overline A$&$=$&$\{x|x\notin A\}$
\end{tabular}
\endgroup
\end{document}
答案4
这是一个类似的解决方案@koleygr 的一个。主要区别在于使用array
环境而不是tabular
环境,允许省略$
环境内的 48 个 [!] 符号。该解决方案还处理了\iff
符号周围的间距,并使用\mid
而不是|
来表示条件。
\documentclass{article}
\usepackage{amssymb,array}
\newcolumntype{C}{>{{}}c<{{}}} % column type for relational and binary operators
\begin{document}
We present some definitions of symbols that are commonly used in set theory:\par
\begingroup % localize scope of the next two instructions
\setlength{\arraycolsep}{0pt}
\renewcommand{\arraystretch}{1.4}
$\begin{array}{rCl}
A \subseteq B &\iff& \forall a\in A:a\in B\\
A \subsetneq B&\iff& \forall a\in A:a\in B \land
\exists b\in B:b\notin A\\
A=B &\iff& A\subseteq B\land B\subseteq A\\
A\cup B &=& \{x\mid x\in A\lor x\in B\}\\
A\cap B &=& \{x\mid x\in A\land x\in B\}\\
A\setminus B &=& \{x\mid x\in A\land x\notin B\}\\
\mathcal{P}(A)&=& \{B\mid B\subseteq A\}\\
\overline A &=& \{x\mid x\notin A\}
\end{array}$
\endgroup
\end{document}