無間距多重對齊

無間距多重對齊

輸入這樣的方程式的最佳方法是什麼? 在此輸入影像描述

(垂直紅線表示三個不同的對齊軸。)

我已經嘗試過以下方法:

\begin{alignat*}{3}
    \phi: Z^{X \times Y} &\to (Z^Y)^X\\
                   f     &\mapsto \phi(f): X &&\to Z^Y\\
                                           x &&\mapsto \phi(f)(x): Y &&&\to Z\\ 
                                                                    y &&&\mapsto \phi(f)(x)(y) = f(x,y)
\end{alignat*}

但效果並不好。

答案1

這是 withalignat和一個小技巧mathtools。頂部圖的共域太寬,因此我們抑制其寬度以保持對齊。

\documentclass{article}
\usepackage{amsmath,mathtools}
\begin{document}
\begin{alignat*}{3}
\phi\colon Z^{X \times Y} &\to \mathrlap{(Z^Y)^X}\\
                    f     &\mapsto \phi(f)\colon &X &\to Z^Y\\
                          &                      &x &\mapsto \phi(f)(x)\colon &Y &\to Z\\ 
                          &                      &  &                         &y &\mapsto \phi(f)(x)(y) = f(x,y)
\end{alignat*}
\end{document}

在此輸入影像描述

答案2

如果暴力是可以接受的...

\documentclass{article}

\begin{document}

\[\arraycolsep0.1667em
\begin{array}{rlll}
 \phi: Z^{X \times Y} &\to (Z^Y)^X&&\\ 
f &\mapsto \phi(f): X &\to Z^Y&\\ 
&\multicolumn{1}{r}{x} &\mapsto \phi(f)(x): Y &\to Z\\ 
&&\multicolumn{1}{r}{y} &\mapsto \phi(f)(x)(y) = f(x,y) 
\end{array}
\]

\end{document} 

在此輸入影像描述

相關內容