如何在函数映射中对齐这些对象

如何在函数映射中对齐这些对象

我正在尝试编写一个三组之间的函数映射。我想在第二个环境中保持第一个“数组”环境的对齐,因为我希望最后两行箭头的尖端和尾部与前一个箭头的尖端和尾部对齐。同样,变量“I”和“h”应该接触我在此屏幕截图中绘制的红线:

在此处输入图片描述

梅威瑟:

\documentclass{article}

\usepackage{newpxtext}
\usepackage{newpxmath}

\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{stmaryrd}

\makeatletter
 \newcommand{\xmapsfrom}[2][]{%
    \ext@arrow3095\leftarrowfill@{#1}{#2}\mapsfromchar
}
\makeatother

\begin{document}
 \[
  \begin{array}{c}
   \begin{array}{ccccc}
    \{\text{Ideali massimali di $\mathcal{A}$}\} & \longleftrightarrow & \{\text{Ultrafiltri di $\mathcal{A}$}\} & \longleftrightarrow & S(\mathcal{A}) \\
    I & \longmapsto & \{x \in A \colon x^\mathbf{c} \in I\} && \\
    \{x \in A \colon x^\mathbf{c} \in F\} & \longmapsfrom & F & \longmapsto & h_F \\
    && \{x \in A \colon h(x) = 1\} & \longmapsfrom & h
   \end{array} \\
   \begin{array}{ccc}
    I & \xmapsto{\hphantom{aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}} & h_I \\
    \{x \in A \colon h(x) = 0\} & \xmapsfrom{\hphantom{aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}} & h
   \end{array}
  \end{array}
 \]
\end{document}

答案1

您可以使用单一array环境并将长箭头放置在三个中央列中\multicolumn

\documentclass[11pt]{article}

\usepackage{newpxtext}
\usepackage{newpxmath}

\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{stmaryrd}

\makeatletter
 \newcommand{\xmapsfrom}[2][]{%
    \ext@arrow3095\leftarrowfill@{#1}{#2}\mapsfromchar
}
\makeatother

\begin{document}
  \[
   \begin{array}{ccccc}
    \{\text{Ideali massimali di $\mathcal{A}$}\} & \longleftrightarrow & \{\text{Ultrafiltri di $\mathcal{A}$}\} & \longleftrightarrow & S(\mathcal{A}) \\
    I & \longmapsto & \{x \in A \colon x^\mathbf{c} \in I\} && \\
    \{x \in A \colon x^\mathbf{c} \in F\} & \longmapsfrom & F & \longmapsto & h_F \\
    && \{x \in A \colon h(x) = 1\} & \longmapsfrom & h \\
    I & \multicolumn{3}{c}{\xmapsto{\hspace{12.5em}}} & h_I \\
    \{x \in A \colon h(x) = 0\} & \multicolumn{3}{c}{\xmapsfrom{\hspace{12.5em}}} & h
   \end{array}
 \]
\end{document}

array由于单列环境(c其中放置实际值)没有用处array,因此我将其删除。此外,根据@Davislor在评论中的建议,我将 都更改\hphantom{aa...aa}\hspace{12.5em}

答案2

alignat*和 的解决方案eqparbox

\documentclass{article}

\usepackage{newpxtext}
\usepackage{newpxmath}
\usepackage{mathtools}
\usepackage{stmaryrd}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$\displaystyle#2$}}

\makeatletter
 \newcommand{\xmapsfrom}[2][]{%
 \ext@arrow3095\leftarrowfill@{#1}{#2}\mapsfromchar
}
\makeatother

\begin{document}

 \begin{alignat*}{3}
  \eqmathbox[S]{\{\text{Ideali massimali di }\mathcal{A}\}} & \longleftrightarrow \eqmathbox[M]{\{\text{Ultrafiltri di $\mathcal{A}$}\}} \longleftrightarrow{} && \eqmathbox[D]{S(\mathcal{A})} \\
  \eqmathbox[S]{ I} & \xmapsto{\phantom{\longleftrightarrow}} \eqmathbox[M]{\{x \in A \colon x^\mathbf{c} \in I\}} && \\
   \eqmathbox[S]{ \{x \in A \colon x^\mathbf{c} \in F\}} & \xmapsfrom{\phantom{\longleftrightarrow}} \eqmathbox[M]{F} \xmapsto{\phantom{\longleftrightarrow}} & & \eqmathbox[D]{h_F} \\
  &\phantom{{}\longleftrightarrow{}}\eqmathbox[M]{\{x \in A \colon h(x) = 1\}}\xmapsfrom{\phantom{\longleftrightarrow}} && \eqmathbox[D]{h} \\
    \eqmathbox[S]{I} & \xmapsto{\hphantom{\displaystyle{\longleftrightarrow}\eqmathbox[M]{}{\longleftrightarrow}}} & & \eqmathbox[D]{h_I} \\
    \eqmathbox[S]{\{x \in A \colon h(x) = 0\}} & \xmapsfrom{\hphantom{\displaystyle{\longleftrightarrow}\eqmathbox[M]{}{\longleftrightarrow}}} & & \eqmathbox[D]{h}
 \end{alignat*}

\end{document} 

在此处输入图片描述

相关内容