对齐不正确,无法对齐多个点的多个方程

对齐不正确,无法对齐多个点的多个方程

我一直想要得到这样的东西:

示例 1

但是在 f_0 箭头下有另一个对齐点,如下所示 示例 2

我不需要像第二个例子那样干净,我只想让箭头对齐。然而代码:

\begin{align*}
0 \xleftarrow{f_{2}} Hom_{R}(R^{\oplus 2},R) \cong R^{\oplus 2} &\xleftarrow{f_{1}} Hom_{R}(R^{\oplus 3},R) \cong R^{\oplus 3} &\xleftarrow{f_{0}} Hom_{R}(R,R) \cong R \xleftarrow{g} 0 \\
&{} (x,y,x+y) &\leftarrow 1 \\
(1,y) &\leftarrow (1,0,0) \\
(1,-x) &\leftarrow (0,1,0) \\
(-1,0) &\leftarrow (0,0,1) \\
\end{align*}

一直将其与 g 箭头对齐,如下所示: 示例 3

我还希望 (x,y,x+y) <- 1 像其他块一样位于一个块中。编辑:由于我第一次没有说清楚,我希望从 1 到 (x,y,x+y) 的箭头与 f_0 箭头对齐,而不是与 g 箭头对齐。提前致谢!

答案1

我想要的结果仍然是交换图,但不幸的是,我不清楚第二行元素的位置。到目前为止,我猜你喜欢这样的结果:

在此处输入图片描述

\documentclass[margin=3.14159mm, preview]{standalone}
\usepackage{tikz-cd}

\begin{document}
    \begin{tikzcd}[column sep=2em,
                   row sep=0ex]
0   &   \ar[l,"f_{2} " ']  (R^{\oplus 2},R) \cong R^{\oplus 2} 
        &   \ar[l,"f_{1}" ']  \mathrm{Hom}_{R}(R^{\oplus 3},R) \cong R^{\oplus 3} 
                &   \ar[l,"f_{0}" '] \mathrm{Hom}_{R}(R,R) \cong R
                    &   \ar[l, "g" '] 0    \\
    &   &   (x,y,x+y) 
            &   &   \ar[ll] 1       \\
    &   (1,y) 
        &   \ar[l]  (1,0,0)
                &   &               \\
    &   (1,-x) 
        &   \ar[l]  (0,1,0) 
                &   &               \\ 
    &   (-1,0) 
        &   \ar[l]  (0,0,1) 
                &   &               \\ 
    \end{tikzcd}
\end{document}

附录:或者可能是如下形式:

在此处输入图片描述

如下来自与@Bernard 的讨论(非常感谢!):

\documentclass[margin=3.14159mm, preview]{standalone}
\usepackage{tikz-cd}

\begin{document}
    \begin{tikzcd}[column sep=2em,
                   row sep=0ex]
0   &   \ar[l,"f_{2} " ']  (R^{\oplus 2},R) \cong R^{\oplus 2}
        &   \ar[l,"f_{1}" ']  \mathrm{Hom}_{R}(R^{\oplus 3},R) \cong R^{\oplus 3}
                &   \ar[l,"f_{0}" '] \mathrm{Hom}_{R}(R,R) \cong R
                    &   \ar[l, "g" '] 0 \\
    &   &   (x,y,x+y)
            &   \ar[l] 1
                    &                   \\
    &   (1,y)
        &   \ar[l]  (1,0,0)
                &   &                   \\
    &   (1,-x)
        &   \ar[l]  (0,1,0)
                &   &                   \\
    &   (-1,0)
        &   \ar[l]  (0,0,1)
                &   &                   \\
    \end{tikzcd}
\end{document}

答案2

&像这样的东西(通过从代码的第 1 行和第 2 行各删除一个实例而获得)?

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\Hom}{Hom} % optional
\begin{document}
\begin{align*}
0 \xleftarrow{f_{2}} \Hom_{R}(R^{\oplus2},R) \cong R^{\oplus2} 
 &\xleftarrow{f_{1}} \Hom_{R}(R^{\oplus3},R) \cong R^{\oplus3} 
  \xleftarrow{f_{0}} \Hom_{R}(R,R) \cong R \xleftarrow{g} 0 \\
(x,y,x+y) &\gets 1 \\
    (1,y) &\gets (1,0,0) \\
   (1,-x) &\gets (0,1,0) \\
   (-1,0) &\gets (0,0,1) \\
\end{align*}
\end{document}

附录:如果愿意,可以将左\gets箭头(又名\leftarrow)的实例替换为开头带有“基数”的版本,即箭头的反面。我们将执行与\mapsto相反操作的宏称为。包括和包在内的几个数学字体符号包以及大多数基于 OpenType 的数学字体(用于 LuaLaTeX/XeLaTeX 和包下)实际上都是以这种方式定义的。不幸的是,未在字体包中定义。如果您的文档恰好使用 Computer Modern 或 Latin Modern 字体,您仍然可以按如下方式创建宏:(a)加载包(用于其和宏)和(b)在序言中发出以下指令:\mapsto\mapsfrom\newtxmath\newpxmathunicode-math\mapsfrom\mapsfromamssymb\mapsfromgraphicx\raisebox\rotatebox

\providecommand\mapsfrom{%
    \mathrel{\raisebox{0.31ex}{\rotatebox[origin=c]{180}{$\mapsto$}}}}

答案3

我会使用一个数组:

\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{stmaryrd}

\DeclareMathOperator{\Hom}{Hom}
\newcommand{\xmapsfrom}[2][]{\xleftarrow[#1]{#2}\mapsfromchar}


\begin{document}

\[
\setlength{\arraycolsep}{0pt}
\newcommand{\ff}{\hphantom{f_0}}
\begin{array}{@{} c >{{}}c<{{}} c >{{}}c<{{}} c @{}}
0 \xleftarrow{f_2} \Hom_R(R^{{\oplus}2},R) \cong R^{{\oplus}2} &
\xleftarrow{f_1} & \Hom_R(R^{{\oplus}3},R) \cong R^{{\oplus}3} &
\xleftarrow{f_0} & \Hom_R(R,R)\cong R \xleftarrow{g} 0
\\
&& \hspace*{\fill} (x,y,x+y) & \xmapsfrom{\ff} & 1 \hspace*{\fill}
\\
\hspace*{\fill} (1,y) & \xmapsfrom{\ff} & (1,0,0) \hspace*{\fill}
\\
\hspace*{\fill} (1,-x) & \xmapsfrom{\ff} & (0,1,0) \hspace*{\fill}
\\
\hspace*{\fill} (-1,0) & \xmapsfrom{\ff} & (0,0,1) \hspace*{\fill}
\end{array}
\]

\end{document}

本地命令\ff用于均衡\xmapsfrom\xleftarrow使用\hspace*{\fill}I 可以更改列中的对齐方式。

在此处输入图片描述

相关内容