当我写很多地图时会出现对齐问题

当我写很多地图时会出现对齐问题

当我写很多地图时,地图的对齐并不好。

\documentclass{article}
\usepackage{amsmath,amssymb,amsthm,mathtools,xcolor,enumitem}

\usepackage[hmargin=3cm,vmargin=3cm]{geometry}
\usepackage{pzccal }
\usepackage{mathrsfs}
\usepackage{tikz-cd}
\tikzcdset{scale cd/.style={every label/.append style={scale=#1},
        cells={nodes={scale=#1}}}}
\usepackage{graphicx}
\usepackage{mdframed}
\everymath{\color{blue}}
\apptocmd{\[}{\color{blue}}{}{}
\usepackage[breakable]{tcolorbox}

\newcommand{\function}[5][]{     % Function
    \ifx &#1&
    \begin{array}{rcl}
        \displaystyle #2 & \longrightarrow & \displaystyle #3 \\
        \displaystyle #4 & \longmapsto     & \displaystyle #5
    \end{array}
    \else
    \begin{array}{ccrcl}
        \displaystyle #1 & : & \displaystyle #2 & \longrightarrow & \displaystyle #3 \\[10.5pt]
        &   & \displaystyle #4 & \longmapsto     & \displaystyle #5
    \end{array}
    \fi
}

\newcommand{\functions}[7][]{    % Functions
    \ifx &#1&
    \begin{array}{rcl}
        \displaystyle #2 & \longrightarrow & \displaystyle #3 \\
        \displaystyle #4 & \longmapsto     & \displaystyle #5 \\
        \displaystyle #6 & \longmapsto     & \displaystyle #7
    \end{array}
    \else
    \begin{array}{ccrcl}
        \displaystyle #1 & : & \displaystyle #2 & \longrightarrow & \displaystyle #3 \\
        &   & \displaystyle #4 & \longmapsto     & \displaystyle #5 \\
        &   & \displaystyle #6 & \longmapsto     & \displaystyle #7
    \end{array}
    \fi
}
\begin{document}
\begin{tcolorbox}[colback=blue!5,colframe=blue!35!black]
    alors les applications:
    
\[
\function[f]{\widetilde{\mathscr{X}}}{\widetilde{\mathscr{A}}}{X}{A=\mathcal{O}_{X}(X)}
\]
    
\[
\function[f^{-1}]{\widetilde{\mathscr{A}}}{\widetilde{\mathscr{X}}}{A}{X=Zar(K\mid A)}
\]
    
\[
\function[g]{\widetilde{\mathscr{A}}}{\widetilde{\mathscr{W}}}{A}{W=\{R\in Zar(K\mid A)\mid R\text{ est un point fermé de } Zar(K\mid A)\}}
\]
    
\[
\function[g^{-1}]{\widetilde{\mathscr{W}}}{\widetilde{\mathscr{A}}}{W}{\mathcal{O}_{W}(W)}\]
    
\[
\function[h]{\widetilde{\mathscr{W}}}{\widetilde{\mathscr{X}}}{W }{X=\{R\in Zar(K)\mid \overline{(R)}\cap W=\emptyset\}}
\]
    
\[
\function[h^{-1}]{\widetilde{\mathscr{X}}}{\widetilde{\mathscr{W}}}{X}{W=\{\text{L'ensemble des points fermé de } X\}}
\]
    
sont des bijections,chaque application est l'inverse d'autre application en ligne.
    
\end{tcolorbox}
\end{document}

它看起来像这样:

结果

答案1

我假设您追求的是这样的(到目前为止,从您的问题中还不清楚这一点):

在此处输入图片描述

  • 我估计使用您的函数几乎不可能获得上述结果。
  • tcolorbox在我看来,直接用代码来表达其内容中的数学术语会更加清楚:
\documentclass{article}
\usepackage[hmargin=3cm,vmargin=3cm]{geometry}

\usepackage{xcolor}
\usepackage{pzccal}
\usepackage{mathrsfs}
\usepackage{amssymb,amsthm,
            mathtools}
\DeclareMathOperator{\zar}{Zar}
\everymath{\color{blue}}

\usepackage{enumitem}
\usepackage{graphicx}

\usepackage{mdframed}
\apptocmd{\[}{\color{blue}}{}{}
\usepackage[breakable]{tcolorbox}

\begin{document}
    \begin{tcolorbox}[colback=blue!5,colframe=blue!35!black]
alors les applications:

\begin{alignat*}{3}
f:      &\quad &    \widetilde{\mathscr{X}}
                    &   \to     \widetilde{\mathscr{A}}     \\
        &       &   X
                    & \mapsto   A = \mathcal{O}_{X}(X)      \\[1ex]
f^{-1}: &       &    \widetilde{\mathscr{X}}
                &   \to \widetilde{\mathscr{A}}             \\
        &       &   A
                    & \mapsto   X = \zar(K\mid A)           \\[1ex]
g:      &       &   \widetilde{\mathscr{A}}                
                    &   \to     \widetilde{\mathscr{W}}     \\
        &       &   A   
                    &   \mapsto W=\{R\in \zar(K\mid A)
                                    \mid R\text{ est un point fermé de } 
                                    \zar(K\mid A)\}         \\[1ex]
g^{-1}: &       &    \widetilde{\mathscr{W}}
                    &   \to \widetilde{\mathscr{A}}         \\
        &       &   A   
                    &   \mapsto \mathcal{O}_{W}(W)          \\[1ex]
h:      &       &   \widetilde{\mathscr{W}}
                    &   \to     \widetilde{\mathscr{X}}     \\
        &       &   W   
                    &   \mapsto X=\{R\in \zar(K)\mid \overline{(R)}
                                    \cap W=\emptyset\}      \\[1ex]
h^{-1}: &       &    \widetilde{\mathscr{X}}
                    &   \to \widetilde{\mathscr{W}}         \\
        &       &   X
                    &   W = \{\text{L'ensemble des points fermé de } X\}
\end{alignat*}

sont des bijections,chaque application est l'inverse d'autre application en ligne.
    \end{tcolorbox}
\end{document}

相关内容