I have given an answer on a question with this MWE, and I am not see an evident hole created when I insert a symbol into an arrow. The labels also overlapped to the symbols. How to solve the problem?

enter image description here

\xymatrix@R=4pc@C=4pc{ A \ar@{=}|{/}[r]^a \ar[d]_{c}|{\subset} & B 
\ar[d]^b|{\cong} \\
 C \ar[r]_d|{\cong} & D;}

2 Answers 2


Very nice MWE! :-) I suggest you use \mathstrut -- where necessary, augmented with \smash[t] or \smash[b] -- and \, (thinspace) directives to fine-tune the placement of the symbols and letters.

enter image description here

\usepackage{amsmath} % for \smash[t] and \smash[b] macros
\xymatrix @R=4pc @C=4pc { 
  A \ar@{=}|{/}[r]^{a\smash[t]{\mathstrut}} % smashed \mathstrut
    \ar[d]_{c\,}|{\subset\mathstrut}    % full-height \mathstrut
& B \ar[d]^{\,b}|{\cong\mathstrut} \\   % full-height \mathstrut
  C \ar[r]_{d\smash[b]{\mathstrut}}|{\,\cong\,} % smashed \mathstrut
& D ;
  • 1
    Thank you very very much...........................grazieeeeeeeeeeeeeeeeeeeeee....accepted answer.
    – Sebastiano
    Feb 20, 2023 at 11:55

I know you are a big fan of xy, so this is just for comparison with tikz-cd.

enter image description here

A new style is created for the special labels for use inside the arrow command: \arrow[r, "<main label>"{special=<direction>:<secondary label>}], where <direction> can be provided as an angle or compass direction.


\tikzcdset{special/.style={description, label={[label distance=-5pt, font=\scriptsize]#1}}}


A\arrow[r, equals, "/"{special=90:$a$}]\arrow[d, "\subset"{special=180:$c$}] & B\arrow[d, "\cong"{special=0:$b$}]\\
C\arrow[r, "\cong"{special=270:$d$}] & D


You must log in to answer this question.

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