3

i have a problem with tikz-cd package and a label over an arrow

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
%
\usepackage{tikz}
\usetikzlibrary{cd}
%
\begin{document}
\begin{tikzcd}[column sep=tiny]
&\mathbb{S}ig^I\arrow[dl,phantom , shift left]\arrow[dl, "\left(Mod^{I}\right)^{op}" above, shift right] \arrow[dr, "Sen^{I}"] &\\
\mathbb{C}at^{op}&\models &\mathbb{S}et
\end{tikzcd}
\end{document}

Here is the problem (in the left arrow is the problem) enter image description here Thanks for the help.

  • \arrow[dl, "(Mod^{I})^{op}", swap] – LaRiFaRi Dec 8 '14 at 15:31
4

This looks fine to me. Added above left and above right, and removed the unnecessary \left...\right construction

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
%
\usepackage{tikz}
\usetikzlibrary{cd}
%
\begin{document}
\begin{tikzcd}[column sep=tiny]
&\mathbb{S}ig^I
\arrow[dl,phantom , shift left]
\arrow[dl, "(Mod^{I})^{op}" above left] 
\arrow[dr, "Sen^{I}",above right] &\\
\mathbb{C}at^{op}&\models &\mathbb{S}et
\end{tikzcd}
\end{document}

enter image description here

2

With some more tricks: using math italic that way leads to not so good output. I would never use blackboard bold for the first letter, but with a personal command it's easy to change the typesetting in the whole document by modifying just the definition.

The vertical alignment of the two labels is obtained by using \mathstrut in the one on the right, which adds a “phantom parenthesis”.

Similarly, the arrows have approximately the same angle by adding a phantom \op in the lower right entry.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{tikz-cd}

\newcommand\cat[1]{\makecat#1\makecat}
\def\makecat#1#2\makecat{\mathbb{#1}\mathrm{#2}}
\newcommand{\fun}[1]{\mathrm{#1}}
\newcommand{\op}{^{\mathrm{op}}}

\begin{document}

\begin{tikzcd}[column sep=0em]
& \cat{Sig}^I
  \arrow[dl, swap, "(\fun{Mod}^{I})\op"]
  \arrow[dr, "\mathstrut\fun{Sen}^{I}"]
\\
\cat{Cat}\op & \models & \cat{Set}\hphantom{\op}
\end{tikzcd}

\end{document}

enter image description here

\cats have \fun. ;-)

1

I try with TikZ.

enter image description here

\documentclass[tikz,border=2mm]{standalone}
\usepackage{amssymb}
\begin{document}
\begin{tikzpicture}
\def\a{2}
\path 
(0,0)      node (Si) {$\mathbb{S}ig^I$}
+(-135:\a) node (Ca) {$\mathbb{C}at^{op}$} 
+(-45:\a)  node (Se) {$\mathbb{S}et$}
(Si|-Ca)   node{$\models$};

\draw (Si)--(Ca) node[pos=.4,left]{$(Mod^{I})^{op}$};
\draw (Si)--(Se) node[pos=.4,right=1mm]{$Sen^{I}$};
\end{tikzpicture}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.