答案1
环境有一个垂直位置的可选参数,例如:
\documentclass{article}
\usepackage{amsmath}
\providecommand*{\quatS}{QS}% some dummy
\providecommand*{\maps}{\rightarrow}% some dummy
\begin{document}
\begin{align}
f(x) : \quatS \quad &\maps \quad \quatS \\
x \quad &\mapsto \quad
\begin{aligned}[t]
&f(x) = \\
&g \circ h(x)
\end{aligned}
\end{align}
\end{document}
答案2
这是一种stackengine
方法。它似乎比aligned
替代方法(即“Q”、“f”和“g”对齐)的垂直对齐效果略好一些。
\documentclass{article}
\usepackage{amsmath,stackengine}
\stackMath
\providecommand*{\quatS}{QS}% some dummy
\providecommand*{\maps}{\rightarrow}% some dummy
\begin{document}
\begin{align}
f(x) : \quatS \quad &\maps \quad \quatS \\
x \quad &\mapsto \quad
\def\stackalignment{l}\def\stacktype{L}
\stackunder{
f(x) = }{
g \circ h(x)
}
\end{align}
\end{document}