用於交換圖的 Tikz

用於交換圖的 Tikz

我需要使用tikz包,因為它產生的交換圖的品質正如我在一些手冊中看到的那樣。我已經嘗試了好幾次但都無濟於事。我在 Windows 上使用 MiKTeX 和 TeXmaker 編輯器。 MiKTeX於去年九月(2012年)安裝。我想知道

  1. 如果我需要安裝任何特定的軟體包或需要安裝最新版本的 MiKTeX
  2. 確切地說,我需要在序言中指定或包含什麼,並記住我正在寫的文檔是代數類別的論文。

\documentclass[12pt]{book}
\usepackage{amsmath,amssymb,amsthm,latexsym}
\usepackage{tikz-cd}
\usetikzlibrary{matrix,arrows}

\begin{document}

\begin{tikzcd}[column sep = 1.3cm]
  K 
   \arrow{r}{\kappa}  
  & L
    \arrow[transform canvas = {yshift = 0.7ex}]{r}{\alpha}        
    \arrow[transform canvas = {yshift = -0.7ex},leftarrow]
    {r}{\beta}
  & M
 \end{tikzcd}
\end{document}

答案1

我會推薦tikz-cd交換圖包;包文檔包含範例,如下一個範例:

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

\begin{document}

\begin{tikzcd}[row sep=scriptsize, column sep=scriptsize]
& f^* E_V \arrow{dl}\arrow{rr}\arrow{dd} & & E_V \arrow{dl}\arrow{dd} \\
f^* E \arrow[crossing over]{rr}\arrow{dd} & & E \\
& U \arrow{dl}\arrow{rr} & & V \arrow{dl} \\
M \arrow{rr} & & N\arrow[crossing over, leftarrow]{uu}\\
\end{tikzcd}

\end{document}

在此輸入影像描述

對於您的 LaTeX 系統,最好的方法是保持您的安裝更新。安裝最新的 MiKTeX 版本並進行完整安裝,而不僅僅是基本的 MiKTeX 安裝。

關於提到的問題,在評論中,您可以使用swap更改箭頭標籤的位置:

\documentclass[12pt]{book}
\usepackage{amsmath,amssymb,amsthm,latexsym}
\usepackage{tikz-cd}
\usetikzlibrary{matrix,arrows}

\begin{document}

\begin{tikzcd}[column sep = 1.3cm]
  K 
   \arrow{r}{\kappa}  
  & L
    \arrow[transform canvas={yshift = 0.7ex}]{r}{\alpha}        
    \arrow[transform canvas={yshift = -0.3ex},leftarrow,swap]
    {r}{\beta}
  & M
 \end{tikzcd}

\end{document}

在此輸入影像描述

答案2

使用 PSTricks。

在此輸入影像描述

\documentclass[preview,border=12pt]{standalone}
\usepackage{pst-node}
\psset{rowsep=1,colsep}
\begin{document}
\offinterlineskip
$
\psmatrix
&
    f^*E_v&
        &
            E_v\\
f^*E&
    &
        E&
            \\
&
    U&
        &
            V\\
M&
    &
        N&
\endpsmatrix
\everypsbox{\scriptstyle}
\psset{arrows=->,nodesep=3pt,border=3pt}
\ncline{1,2}{1,4}
\ncline{1,2}{2,1}
\ncline{1,4}{2,3}
\ncline{2,1}{4,1}
\ncline{1,2}{3,2}
\ncline{1,4}{3,4}
\ncline{2,1}{2,3}
\ncline{3,2}{4,1}
\ncline{3,2}{3,4}
\ncline{3,4}{4,3}
\ncline{4,1}{4,3}
\ncline{2,3}{4,3}
$
\end{document}

對於雙線和標籤:

在此輸入影像描述

\documentclass[preview,border=12pt]{standalone}
\usepackage{pst-node}
\psset{rowsep=1,colsep}
\begin{document}
\offinterlineskip
$
\psmatrix
&
    f^*E_v&
        &
            E_v\\
f^*E&
    &
        E&
            \\
&
    U&
        &
            V\\
M&
    &
        N&
\endpsmatrix
\everypsbox{\scriptstyle}
\psset{arrows=->,nodesep=3pt,border=2pt,shortput=tablr,labelsep=2pt}
\ncline[offset=2pt]{1,2}{1,4}^{a}
\ncline[offset=-2pt,arrows=<-]{1,2}{1,4}_{b}
\ncline{1,2}{2,1}
\ncline{1,4}{2,3}
\ncline{2,1}{4,1}
\ncline{1,2}{3,2}
\ncline{1,4}{3,4}
\ncline{2,1}{2,3}
\ncline{3,2}{4,1}
\ncline{3,2}{3,4}
\ncline{3,4}{4,3}
\ncline{4,1}{4,3}
\ncline{2,3}{4,3}
$
\end{document}

相關內容