5

With the following code

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

\begin{document}

\begin{tikzcd}
\arrow[loop left]{l}{\mathrm{id}_A} \ar{r}A &
B\times C \arrow[loop right]{r}{\mathrm{id}_{B\times C}} 
\end{tikzcd}

\end{document}

I get:

enter image description here

I'd like to fix the arrows, so that they have the same size independent of the source object, with preference given to the big arrow.

My attempts so far had been only somehow not very effective:

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

\begin{document}

\begin{tikzcd}
\arrow[loop left]{l}{\mathrm{id}_A} \ar{r}A \hspace{.5cm}& 
 {B\times C\arrow[loop right]{r}{\mathrm{id}_{B\times C}} }
\end{tikzcd}

\begin{tikzcd}
\arrow[loop left]{l}{\mathrm{id}_A} \ar{r}A &
\hspace{-.7cm}{B\times \hspace{-1.9cm}}& {C\arrow[loop right]{r}{\mathrm{id}_{B\times C}} }
\end{tikzcd}

\end{document}

enter image description here

4

I fear, you will have to set the start and end anchors manually. I can't think of a better solution:

% arara: pdflatex

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

\begin{document}    
    \begin{tikzcd}[cells={nodes={}}]
        \arrow[loop left, distance=3em, start anchor={[yshift=-1ex]west}, end anchor={[yshift=1ex]west}]{}{\mathrm{id}_A} \arrow{r} A 
        & B\times C\arrow[loop right, distance=3em, start anchor={[yshift=1ex]east}, end anchor={[yshift=-1ex]east}]{}{\mathrm{id}_{B\times C}} 
    \end{tikzcd}
\end{document}

enter image description here

For even more control on the arrow, you can define [out=-150, in=150, loop, distance=3em,...].

|improve this answer|||||

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.