1

I was happy to learn here how to place "pullback-corner" decorations in tikz-cd squares using labels instead of phantom diagonals, but now I noticed that the label technique seems to affect the dimensions of the diagram. The code

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

\begin{document} [ \begin{tikzcd} U\cap V \ar[r] \ar[d] & V \ar[d] \ U \ar[r] & |[label={[label distance=-3mm]135:\ulcorner}]| P \end{tikzcd} \quad \begin{tikzcd} U\cap V \ar[r] \ar[d] & V \ar[d] \ U \ar[r] & P \end{tikzcd} \quad \begin{tikzcd} U\cap V \ar[r] \ar[d] & V \ar[d] \ U \ar[r] & P \ar[ul, phantom,"\ulcorner",pos=0] \end{tikzcd} ] \end{document}

produces the following diagram:

three squares

The left square, using label, is larger than the middle square without decoration, and the right square with the decoration placed on a phantom diagonal.

Is there a way to avoid this resizing?

  • 1
    You can use overlay with the label (label={[overlay]…}) so that it does not affect the bounding box of the cell. You can also use a “late label” as I call it, i.e. a label that is placed after the matrix has been constructed, basically \arrow[to path={node also[label=…]](\tikztostart)}] (but we can make a nice style out of it), see my answer for a wider discussion about this. You can also use between origins with the column and row separation which will ignore everything in each cell. – Qrrbrbirlbel Aug 10 '23 at 23:53
  • 1
    great, thanks! overlay works. if you want to add an answer i'll accept it. – user313032 Aug 11 '23 at 00:01
  • 4
    I’m voting to close this question because the TO mentions in his comment, that the proposal made solved his/her problem. – MS-SPO Aug 18 '23 at 14:36
  • Why has this been marked as off topic – user313032 Aug 21 '23 at 23:50

0 Answers0