Is there a way to get a "3D slant" effect on tikz-cd? I mean something like the Rightarrows in the following diagram, which I made using code from another tex.SE answer:
There are still many problems with the output, such as the α⊗id_id_T label beng crooked and misaligned, the angles not being correct, and the T⊗α (first diagram, from 2-2 to 1-3) and α (second diagram, from 4-2 to 3-3) labels having to be added manually using a phantom arrow, as slanting them together with their 2-arrows made it hard to read...
Here is the code for the above image:
\newsavebox{\BoxOne}
\savebox{\BoxOne}{
\begin{tikzcd}[row sep=4.5em, column sep=4.5em, background color=backgroundColor, ampersand replacement=\&]
{}
\arrow[d, "\alpha\tcirc\biid_{\biid_{\monadT}}"{rotate=-140,description}, Rightarrow]
\\
{}
\end{tikzcd}
}
\newsavebox{\BoxThree}
\savebox{\BoxThree}{
\begin{tikzcd}[row sep=3.6em, column sep=3.6em, background color=backgroundColor, ampersand replacement=\&]
{}
\arrow[d, Leftarrow]
\\
{}
\end{tikzcd}
}
\begin{tikzcd}[row sep={4.5em,between origins}, column sep={4.5em,between origins}, background color=backgroundColor, ampersand replacement=\&]
\monadT^{4}
\arrow[rr, "\monadT^{2}\tcirc\mu"description]
\arrow[dd, "\mu\tcirc\monadT^{2}"'description]
\arrow[rd, "\monadT\tcirc(\mu\tcirc\monadT)"{name=1,description}]
\&
\&
\monadT^{3}
\arrow[rd, "\monadT\tcirc\mu"description]
\&
\\
\&
\monadT^{3}
\arrow[rr, "\monadT\tcirc\mu"description]
\arrow[dd, "\mu\tcirc\monadT"description]
\&
\&
\monadT^{2}
\arrow[dd, "\mu"description]
\\
\monadT^{3}
\arrow[rd, "\mu\tcirc\monadT"{name=2,description}]
\&
\&
\&
\\
\&
\monadT^{2}
\arrow[rr, "\mu"'description]
\&\&
\monadT^{1}
% 2-Arrows
\arrow[from=3-1,to=2-2,"\rotslant{-30}{-30}{\rotatebox{140}{\usebox{\BoxOne}}}",phantom,yshift=-0.25em]
\arrow[from=2-2,to=1-3,"\rotslant{-22.5}{+22.5}{\rotatebox{0}{\usebox{\BoxThree}}}",phantom]
\arrow[from=2-2,to=1-3,"\scalebox{0.75}{$\monadT\tcirc\alpha$}"description,phantom]
\arrow[from=4-2,to=2-4,"\alpha"description,Rightarrow,shorten=3.0em]
\end{tikzcd}
&=
\newsavebox{\BoxTwo}
\savebox{\BoxTwo}{
\begin{tikzcd}[row sep=3.6em, column sep=3.6em, background color=backgroundColor, ampersand replacement=\&]
{}
\arrow[d, "\alpha"{rotate=-140,description}, Rightarrow]
\\
{}
\end{tikzcd}
}
\newsavebox{\BoxThree}
\savebox{\BoxThree}{
\begin{tikzcd}[row sep=3.6em, column sep=3.6em, background color=backgroundColor, ampersand replacement=\&]
{}
\arrow[d, Leftarrow]
\\
{}
\end{tikzcd}
}
\begin{tikzcd}[row sep={4.5em,between origins}, column sep={4.5em,between origins}, background color=backgroundColor, ampersand replacement=\&]
\monadT^{4}
\arrow[rr, "\monadT^{2}\tcirc\mu"description]
\arrow[dd, "\mu\tcirc\monadT^{2}"'description]
\&
\&
\monadT^{3}
\arrow[dd, "\mu\tcirc\monadT"description,dashed]
\arrow[rd, "\monadT\tcirc\mu"description]
\&
\\
\&
\&
\&
\monadT^{2}
\arrow[dd, "\mu"]
\\
\monadT^{3}
\arrow[rr, "\monadT\tcirc\mu"description,dashed]
\arrow[rd, "\mu\tcirc\monadT"{name=2,description}]
\&
\&
\monadT^{2}
\arrow[rd, "\mu"description,dashed]
\&
\\
\&
\monadT^{2}
\arrow[rr, "\mu"']
\&\&
\monadT^{1}
% 2-Arrows
\arrow[from=3-3,to=2-4,"\rotslant{-30}{-30}{\rotatebox{140}{\usebox{\BoxTwo}}}",phantom,yshift=-0.25em]
\arrow[from=4-2,to=3-3,"\rotslant{-22.5}{+22.5}{\rotatebox{0}{\usebox{\BoxThree}}}",phantom]
\arrow[from=4-2,to=3-3,"\scalebox{0.75}{$\alpha$}"description,phantom]
\arrow[from=3-1,to=1-3,"\alpha_{\alpha}^{-1}"description,Rightarrow,shorten=3.0em]
\end{tikzcd}
The \rotslant macro there comes from the tex.SE answer I mentioned before.
Also, is it possible to get such an effect for 2-arrows on more general curved surfaces (i.e. other than 2-arrows on faces of cubes), such as the ones in the diagram
?
Edit: Here's a compilable code for the first image (with a slightly different output (e.g. fonts, spacing), but with the same behaviour for the 3D arrows):
\documentclass[english,11pt]{standalone}
\RequirePackage{luatex85}
\newcommand{\monadT}{\mathrm{T}}
\newcommand{\biid}{\mathsf{id}}
\newcommand{\tcirc}{\otimes}
\usepackage{tikz}
\usepackage{tikz-cd}
\usetikzlibrary{arrows.meta,calc,positioning,decorations.markings,fit,patterns,decorations.pathreplacing,3d}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
% 3D Rotate
\usepackage{fp}
\newsavebox\foobox
\newcommand\slbox[2]{%
\FPdiv{\result}{#1}{57.296}% CONVERT deg TO rad
\FPtan{\result}{\result}%
\slantbox[\result]{#2}%
}%
\newcommand{\slantbox}[2][30]{%
\mbox{%
\sbox{\foobox}{#2}%
\hskip\wd\foobox
\pdfsave
\pdfsetmatrix{1 0 #1 1}%
\llap{\usebox{\foobox}}%
\pdfrestore
}}
\newcommand\rotslant[3]{\rotatebox{#1}{\slbox{#2}{#3}}}
\begin{document}
\newsavebox{\BoxOne}
\savebox{\BoxOne}{
\begin{tikzcd}[row sep=4.5em, column sep=4.5em, ampersand replacement=\&]
{}
\arrow[d, "\alpha\tcirc\biid_{\biid_{\monadT}}"{rotate=-140,description}, Rightarrow]
\\
{}
\end{tikzcd}
}
\newsavebox{\BoxThree}
\savebox{\BoxThree}{
\begin{tikzcd}[row sep=3.6em, column sep=3.6em, ampersand replacement=\&]
{}
\arrow[d, Leftarrow]
\\
{}
\end{tikzcd}
}
\begin{tikzcd}[row sep={4.5em,between origins}, column sep={4.5em,between origins}, ampersand replacement=\&]
\monadT^{4}
\arrow[rr, "\monadT^{2}\tcirc\mu"description]
\arrow[dd, "\mu\tcirc\monadT^{2}"'description]
\arrow[rd, "\monadT\tcirc(\mu\tcirc\monadT)"{name=1,description}]
\&
\&
\monadT^{3}
\arrow[rd, "\monadT\tcirc\mu"description]
\&
\\
\&
\monadT^{3}
\arrow[rr, "\monadT\tcirc\mu"description]
\arrow[dd, "\mu\tcirc\monadT"description]
\&
\&
\monadT^{2}
\arrow[dd, "\mu"description]
\\
\monadT^{3}
\arrow[rd, "\mu\tcirc\monadT"{name=2,description}]
\&
\&
\&
\\
\&
\monadT^{2}
\arrow[rr, "\mu"'description]
\&\&
\monadT^{1}
% 2-Arrows
\arrow[from=3-1,to=2-2,"\rotslant{-30}{-30}{\rotatebox{140}{\usebox{\BoxOne}}}",phantom,yshift=-0.25em]
\arrow[from=2-2,to=1-3,"\rotslant{-22.5}{+22.5}{\rotatebox{0}{\usebox{\BoxThree}}}",phantom]
\arrow[from=2-2,to=1-3,"\scalebox{0.75}{$\monadT\tcirc\alpha$}"description,phantom]
\arrow[from=4-2,to=2-4,"\alpha"description,Rightarrow,shorten=3.0em]
\end{tikzcd}
=
\newsavebox{\BoxTwo}
\savebox{\BoxTwo}{
\begin{tikzcd}[row sep=3.6em, column sep=3.6em, ampersand replacement=\&]
{}
\arrow[d, "\alpha"{rotate=-140,description}, Rightarrow]
\\
{}
\end{tikzcd}
}
\newsavebox{\BoxFour}
\savebox{\BoxFour}{
\begin{tikzcd}[row sep=3.6em, column sep=3.6em, ampersand replacement=\&]
{}
\arrow[d, Leftarrow]
\\
{}
\end{tikzcd}
}
\begin{tikzcd}[row sep={4.5em,between origins}, column sep={4.5em,between origins}, ampersand replacement=\&]
\monadT^{4}
\arrow[rr, "\monadT^{2}\tcirc\mu"description]
\arrow[dd, "\mu\tcirc\monadT^{2}"'description]
\&
\&
\monadT^{3}
\arrow[dd, "\mu\tcirc\monadT"description,dashed]
\arrow[rd, "\monadT\tcirc\mu"description]
\&
\\
\&
\&
\&
\monadT^{2}
\arrow[dd, "\mu"]
\\
\monadT^{3}
\arrow[rr, "\monadT\tcirc\mu"description,dashed]
\arrow[rd, "\mu\tcirc\monadT"{name=2,description}]
\&
\&
\monadT^{2}
\arrow[rd, "\mu"description,dashed]
\&
\\
\&
\monadT^{2}
\arrow[rr, "\mu"']
\&\&
\monadT^{1}
% 2-Arrows
\arrow[from=3-3,to=2-4,"\rotslant{-30}{-30}{\rotatebox{140}{\usebox{\BoxTwo}}}",phantom,yshift=-0.25em]
\arrow[from=4-2,to=3-3,"\rotslant{-22.5}{+22.5}{\rotatebox{0}{\usebox{\BoxFour}}}",phantom]
\arrow[from=4-2,to=3-3,"\scalebox{0.75}{$\alpha$}"description,phantom]
\arrow[from=3-1,to=1-3,"\alpha_{\alpha}^{-1}"description,Rightarrow,shorten=3.0em]
\end{tikzcd}
\end{document}

