6

I frequently see two-line alignments where the first line specifies the domain and codomain of maps and the second line describes how the maps act on elements, for example in the following sequence:

How do I create such alignments? Specifically, how do I put the element right under the center of the group it's in? I know that it is possible to do this with \phantom, but in this case it's a bit cumbersome. Are there better solutions?

Sorry for the imprecise title; I haven't found a compact way to describe it. Thanks in advance!

5 Answers 5

7

I'd use array for that.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ \begin{array}{c *{4}{@{$\;$}c} }
0 \to \Omega^*(M) \to & \Omega^*(U) \oplus \Omega^*(V) & \to     & \Omega^*(U \cap V) & \to 0 \\
                      & (\omega,\tau)                  & \mapsto & \tau - \omega      &
\end{array} \]
\end{document}

2
  • Better yet, \begin{array}{c *{4}{@{$\;$}c}} to get the standard spacing around relation symbols.
    – egreg
    May 4, 2020 at 10:08
  • @egreg Thanks! I was not sure what was the exact correct spacing.
    – Vincent
    May 4, 2020 at 15:00
7

An increasing number of mathematicians and physicists typeset these exact sequences with tikz-cd.

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[column sep=1em,row sep=0.5ex]
0\arrow[r] &\Omega^*(M) \arrow[r] &
\Omega^*(U)\oplus\Omega^*(V) \arrow[r]&\Omega^*(U\cap V) 
\arrow[r] & 0 \\
& & (\omega, \tau) \arrow[r,mapsto] & \tau-\omega & 
\end{tikzcd}
\end{document}

enter image description here

4

You can still use align, just you need to insert the items in the second line into a box the same width as their corresponding elements above. makebox with widthof from calc package can do this for you.

\documentclass{article}
\usepackage{amsmath}
\usepackage{calc}
\begin{document}

\newcommand{\sameas}[2]{\makebox[\widthof{$#1$}]{$#2$}}

\begin{align*}
0\to \Omega^*(M) \to \Omega^*(U)\oplus\Omega^*(V) &\mapsto \Omega^*(U\cap V) \to 0 \\
\sameas{\Omega^*(U)\oplus\Omega^*(V)}{(\omega,\tau)} &\to \sameas{\Omega^*(U\cap V)}{\tau-\omega}
\end{align*}

\end{document}

enter image description here

3

Here's a way with stacks

\documentclass{article}
\usepackage{amsmath,stackengine,amssymb}
\stackMath
\begin{document}
\begin{equation}
\renewcommand\stacktype{L}
0\rightarrow \Omega^*(M)
\rightarrow \stackunder{\Omega^*(U)\oplus\Omega^*(V)}{\scriptstyle(\omega, \tau)}
\mathrel{\stackunder{\rightarrow}{\scriptstyle\mapsto}}
\stackunder{\Omega^*(U\cap V)}{\scriptstyle\tau-\omega}
\rightarrow 0
\end{equation}
\end{document}

enter image description here

If I was mistaken about the second line being in \scriptstyle,

\documentclass{article}
\usepackage{amsmath,stackengine,amssymb}
\stackMath
\begin{document}
\begin{equation}
\renewcommand\stacktype{L}
0\rightarrow \Omega^*(M)
\rightarrow \stackunder{\Omega^*(U)\oplus\Omega^*(V)}{(\omega, \tau)}
\mathrel{\stackunder{\rightarrow}{\mapsto}}
\stackunder{\Omega^*(U\cap V)}{\tau-\omega}
\rightarrow 0
\end{equation}
\end{document}

enter image description here

Alternately, one could use a TABstack:

\documentclass{article}
\usepackage{amsmath,tabstackengine,amssymb}
\TABstackMath
\begin{document}
\begin{equation}
\TABbinary
\Matrixstack{
0\rightarrow \Omega^*(M) \rightarrow 
&\Omega^*(U)\oplus\Omega^*(V)
&\rightarrow
&\Omega^*(U\cap V)
&\rightarrow 0\\
{}
&(\omega, \tau)
&\mapsto
&\tau-\omega
&{}
}
\end{equation}
\end{document}

to get the same result

enter image description here

2

You can do it with standard tools, if the heights of the items are not large.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\haselement}[2]{\begin{array}[t]{@{}c@{}}#1\\[0.5ex]#2\end{array}}
\newcommand{\tomapsto}{\mathrel{\haselement{\to}{\mapsto}}}

\begin{document}

\[
0 \to \Omega^*(M) \to
\haselement{\Omega^*(U) \oplus \Omega^*(V)}{(\omega,\tau)}
\tomapsto
\haselement{\Omega^*(U \cap V)}{\tau-\omega}
\to 0
\]

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .