交换图包

交换图包

我想把这些很棒的范畴论图表之一放入我的一篇论文中。我可以使用哪种软件包而不会破坏我迄今为止的 TeX 工作。

答案1

我建议tikz-cd。让我们看一些例子(最后一个来自这些笔记

\documentclass{amsart}
\usepackage{tikz-cd}

\DeclareMathOperator{\Hom}{Hom}

\begin{document}
\section{Commutative $k$-algebra}
\[
\begin{tikzcd}
A\otimes A \arrow[rr,"\iota"] \arrow[dr,swap,"\mu"] && A\otimes A \arrow[dl,"\mu"] \\
& A
\end{tikzcd}
\]

\section{Cocommutative $k$-coalgebra}
\[
\begin{tikzcd}
& C \arrow[dl,swap,"\Delta"] \arrow[dr,"\Delta"] \\
C\otimes C \arrow[rr,"\iota"] && C\otimes C
\end{tikzcd}
\]

\section{Associative $k$-algebra}
\[
\begin{tikzcd}
A\otimes A\otimes A \arrow[r,"\mu\otimes 1"] \arrow[d,swap,"1\otimes\mu"] &
  A \otimes A \arrow[d,"\mu"] \\
A \otimes A \arrow[r,"\mu"] & A
\end{tikzcd}
\]
\section{Coassociative $k$-coalgebra}
\[
\begin{tikzcd}
C \arrow[r,"\Delta"] \arrow[d,swap,"\Delta"] &
  C \otimes C \arrow[d,"1\otimes\Delta"] \\
C\otimes C \arrow[r,"\Delta\otimes 1"] & C\otimes C\otimes C
\end{tikzcd}
\]

\section{Hochschild cohomology complex}
\[
\begin{tikzcd}
0 \arrow[r] & M \arrow[r,"\partial_0-\partial_1"] &
  \Hom_k(R,M) \arrow[r,"d"] & \Hom_k(R\otimes R,M) \arrow[r,"d"] & \dotsb
\end{tikzcd}
\]
\end{document}

注意,三角图是通过添加中间柱来实现的。

在此处输入图片描述

答案2

现在来看看 pstricks 方法:这里是代码counity diagram

\documentclass[pdf]{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{pst-node}
\DeclareMathOperator\id{id}

\begin{document}

\[ \psset{arrows = ->, nodesep = 3pt, labelsep = 3pt}%,
\begin{psmatrix}[colsep = 1.6]
C & C \otimes C \\
C \otimes C & K \otimes C \cong C \cong C \otimes K
%
\ncline{1,1}{1,2}\naput{\Delta} \ncline{2,1}{2,2}\nbput{\varepsilon \otimes \id}
\ncline{1,1}{2,1}\nbput{\Delta} \ncline{1,2}{2,2}\naput{\id \otimes \varepsilon}
 \ncline{1,1}{2,2}\nbput{\id}
\end{psmatrix}
\]

\end{document} 

在此处输入图片描述

答案3

的语法xy让代码变得简短但难以阅读。不过xy功能强大,所以我把它放在这里。

\documentclass{amsart}
\usepackage{tikz-cd}\usetikzlibrary{decorations.pathmorphing}
\usepackage[all,pdf]{xy}\SelectTips {cm}{}

\DeclareMathOperator{\Hom}{Hom}
\DeclareMathOperator\id{id}

\begin{document}
\section{Commutative $k$-algebra}
\[\xymatrix{
    A\otimes A \ar^\iota[rr]\ar_\mu[dr] && A\otimes A \ar[dl]^\mu \\
    & A
}\]

\section{Cocommutative $k$-coalgebra}
\[\xymatrix{
    & C \ar_\Delta[dl]\ar^\Delta[dr] \\
    C\otimes C \ar^\iota[rr] && C\otimes C
}\]

\section{Associative $k$-algebra}
\[\xymatrix{
    A\otimes A\otimes A \ar^-{\mu\otimes1}[r]\ar_{1\otimes\mu}[d] & A\otimes A \ar^\mu[d] \\
    A\otimes A \ar^-\mu[r] & A
}\]

\section{Coassociative $k$-coalgebra}
\[\xymatrix{
    C \ar^\Delta[r]\ar_\Delta[d] & C\otimes C \ar^{1\otimes\Delta}[d] \\
    C\otimes C \ar^{\Delta\otimes1}[r] & C\otimes C\otimes C
}\]

\section{Hochschild cohomology complex}
\[\xymatrix{
    0\ar[r] & M \ar^-{\partial_0-\partial_1}[r] & \Hom_k(R,M) \ar^-d[r] & \Hom_k(R\otimes R,M)\ar^-d[r] & \cdots
}\]

\section{Bernard's answer}
\[\xymatrix{
    C \ar^\Delta[r]\ar_\Delta[d]\ar_\id[dr] & C\otimes C \ar^{\id\otimes\varepsilon}[d] \\
    C\otimes C \ar_-{\varepsilon\otimes\id}[r] & K\otimes C\cong C\cong C\otimes K
}\]

\section{Comparsion}
\[\begin{tikzcd}[column sep=3cm]
    A\ar[hook,squiggly,two heads,"\phi" description]{r} & B
\end{tikzcd}\]
\[\xymatrix@C3cm{
    A\ar@{^(~>>}|\phi[r] & B
}\]
\end{document}

相关内容