1

What is the proper way to typeset in LaTeX, in display-mode, a series of equivalences and definitions of unequal lengths of sets ?

Consider for this the following code that I used for a series of equivalences

$$
\begin{array}{rcl}
y_{0}=\frac{\pm\sqrt{1-z^{2}}}{z} & \Longleftrightarrow & y_{0}z=\pm\sqrt{1-z^{2}}\\
 & \Longleftrightarrow & y_{0}^{2}z^{2}=1-z^{2}\\
 & \Longleftrightarrow & (1+y_{0})z^{2}=1\\
 & \Longleftrightarrow & z=\pm\frac{1}{1+y_{0}^{2}}.
\end{array}
$$

and the following code I used for definitions of unequal lengths of sets:

\begin{alignat*}{1}
D_{1} & :=C_{a}\cap\left\{ (x,y,z)\in D_{2}:x>0\right\} \ \text{and}\\
D_{2} & :=\left\{ (x,y,z)\in D_{1}:x<0\right\} .
\end{alignat*}

(Ignore the mathematical non-sense.) Are the environments I used as well as their alignments the proper ones for this ?

l7ll7
  • 2,267

2 Answers2

2

I'd use align* environment.

\begin{align*}
y_{0}=\frac{\pm\sqrt{1-z^{2}}}{z} &\Longleftrightarrow  y_{0}z=\pm\sqrt{1-z^{2}}\\
                                  &\Longleftrightarrow  y_{0}^{2}z^{2}=1-z^{2}\\
                                  &\Longleftrightarrow  (1+y_{0})z^{2}=1\\
                                  &\Longleftrightarrow  z=\pm\frac{1}{1+y_{0}^{2}}.
\end{align*}

\begin{align*}
D_{1} & :=C_{a}\cap\left\{ (x,y,z)\in D_{2}:x>0\right\} \text{ and}\\
D_{2} & :=\left\{ (x,y,z)\in D_{1}:x<0\right\} .
\end{align*}

enter image description here

ps. \left\{ \right\} is not necessary in your case. Simply use \{ \} or some variant \bigl\{ \bigr\} or \Bigl\{ \Bigr\}.

Sigur
  • 37,330
  • Thanks for your answer. Can you please highlight though why it's better to use the align* environment over the array environment (i.e. why align* is the proper environment in this case) and what the difference to the alignat* is ? I compared your and my version and regarding the former, with the align* environment everything is display in normal size (where array seems to display it in text size), which seems to me to be more a matter of taste than typographical convention and regarding the latter I couldn't see any difference. – l7ll7 Aug 22 '15 at 14:00
  • As the name suggests, array is to mathematical arrays. In your case, you want to align a set of equations. – Sigur Aug 22 '15 at 14:40
  • This explanation is only terminological, can you give me an explanation that refers to what these definitions do ? You haven't yet specified why align* is better than alignat*. – l7ll7 Aug 24 '15 at 05:42
  • 1
    @user10324 align* and alignat* are two different (but related) constructions. See http://texdoc.net/texmf-dist/doc/latex/amsmath/amsldoc.pdf – daleif Aug 24 '15 at 09:37
  • @daleif Could you be a bit more specific ? I browsed fast through your document, but couldn't find a paragraph that concisely relates to the differences/similarities of these two commands. – l7ll7 Aug 30 '15 at 14:09
  • 1
    The main difference is when one is using more than one alignment column. Then align adds space between the alignment columns, alignat does not. The later also need you to explicitly specify how many alignment columns there will be. In that document, look at the images. Not everything is explained in words. – daleif Aug 30 '15 at 14:13
  • 1
    Since most people only one one alignment column, align is faster to type, and does not require you to specify an argument to the env – daleif Aug 30 '15 at 14:15
2

You have another possibility with the mathtools package: it defines an \ArrowBetweenLines command which places by default an \Updownarrow between the lines of an alignat environment, on the left. There is a starred version which places it on the right.

It accepts as an optional argument the symbol that will be used, and I took advantage of this feature to define a \TextBetweenLines command, that I used in the second example in the O.P.'s question:

\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} 

enter image description here

Bernard
  • 271,350
  • This is an interesting, alternative way for typesetting, but unfortunately I can't use, as I have rather rigid guidelines to follow. – l7ll7 Aug 24 '15 at 05:44