最近,帮客户处理手写稿的时候,客户在公式之间加了双向箭头,表达关联的含义。一般情况下,两个公式的关系比较多的是推导与被推导的关系,通常在被推导公式前放一箭头,但是前后公式表达关联关系就出现了困难,甚而有时我们也想在公式之间加入文本,而不想让文本占据单独行,也有类似的应用场景。 例如如下效果: 实现这一效果采用mathtools宏包即可。上图的代码实现如下:
\documentclass{article}
\usepackage{mathtools}
\newcommand\TextBetweenLines[1]{\ArrowBetweenLines[\text{#1}]}
\begin{document}
\begin{alignat*}{2}
& & y_{0} & =\frac{\pm\sqrt{1-z^{2}}}{z} \\
\ArrowBetweenLines & & y_{0}z & =\pm\sqrt{1-z^{2}} \\
\ArrowBetweenLines & & y_{0}^{2}z^{2} & =1-z^{2}
\end{alignat*}
\begin{alignat*}{2}
y_{0}^{2}z^{2} & =1-z^{2} & & \\
\ArrowBetweenLines *(1+y_{0})z^{2} & =1 & & \\
\ArrowBetweenLines* z & =\pm\frac{1}{1+y_{0}^{2}}. & &
\end{alignat*}
\begin{alignat*}{2}
& & D_{1} & \coloneqq C_{a}\cap\left\{ (x,y,z)\in D_{2}:x>0\right\} \\
\TextBetweenLines{and} & & D_{2} & :=\left\{ (x,y,z)\in D_{1}:x<0\right\} .
\end{alignat*}
\end{document}
选自:http://tex.stackexchange.com/questions/262604/typesetting-displayed-equivalences-and-definitions-of-unequal-length
发表评论 取消回复