1

Please see the code below

\documentclass[12pt,reqno,a4paper]{amsart}

\usepackage{amsmath,amsthm,amsfonts,amssymb}
\usepackage{hyperref}
\usepackage{mathrsfs}
\usepackage[all]{xy}
\usepackage{tikz-cd}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{color}
\pagestyle{myheadings}
\author{someone}
\title{something}
\begin{document} 
    
\[  \begin{tikzcd}[sep=small] 
        & U_{\alpha\beta\gamma} \arrow[dd, "{\rm pr}_{13}"] \arrow[rr, "{\rm pr}_{23}"] \arrow[ld, "{\rm pr}_{12}"'] &  & U_{\beta\gamma} \arrow[dd] \arrow[ld] \\  U_{\alpha\beta} \arrow[dd] \arrow[rr] & & U_\beta \arrow[dd] & \\
        & U_{\alpha\gamma} \arrow[rr] \arrow[ld] & & U_\gamma \arrow[ld]  \\
        U_\alpha \arrow[rr] & & U & 
    \end{tikzcd}\]
\end{document}

This code has given the following diagram enter image description here

The label of the arrow pr_{13} is overlapping with the horizontal arrow.

Is there a way to fix this issue by moving the label pr_{13} higher than its current position?

5
  • Unrelated \rm has been depreciated since 1993, use \mathrm{pr} or as it is an operator \operatorname{pr}
    – daleif
    Jun 29, 2023 at 10:07
  • 1
    You can move the label using the pos=fraction key, the default is pos=0.5
    – daleif
    Jun 29, 2023 at 10:10
  • Many thanks @daleif I see there are some duplicates for this question.. should I just delete this? Jun 29, 2023 at 10:16
  • Just leave it. Others might mark it as a duplicate
    – daleif
    Jun 29, 2023 at 10:21
  • TikZ manual section Jun 29, 2023 at 11:43

1 Answer 1

1

The bad placement of the label is not the only problem. You also want to hide parts of the arrows in the “back layer”. Anyway, add pos=0.3 or some other factor.

I wouldn't use sep=small, here I just reduce the column separation.

Note that the last arrow is drawn as a leftarrow, so it is placed later and crossing over works.

\documentclass[12pt,reqno,a4paper]{amsart}
%\usepackage[english]{babel}% why?

\usepackage{amsmath,amsthm,amsfonts,amssymb}
\usepackage{mathrsfs}
\usepackage{tikz-cd}
\usepackage{hyperref}

\newcommand{\pr}{\mathrm{pr}}

\begin{document} 
    
\[
\begin{tikzcd}[column sep=small]
  & U_{\alpha\beta\gamma}
    \arrow[dd, "\pr_{13}",pos=0.3]
    \arrow[rr, "\pr_{23}"]
    \arrow[ld, "\pr_{12}"']
 && U_{\beta\gamma} \arrow[dd] \arrow[ld]
\\
    U_{\alpha\beta} \arrow[dd] \arrow[rr,crossing over] 
 && U_\beta
\\
  & U_{\alpha\gamma} \arrow[rr] \arrow[ld]
 && U_\gamma \arrow[ld]
\\
    U_\alpha \arrow[rr] && U \arrow[leftarrow,uu,crossing over]
\end{tikzcd}
\]

\end{document}

enter image description here

1
  • Many thanks for mentioning crossing over option.. :) Jun 30, 2023 at 17:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .