2

I have answered to a this question, Long arrows in a commutative diagram with transform canvas with this MWE:

\documentclass[a4paper,12pt]{article}
\usepackage[cmtip,all]{xy}
\labelmargin-{1pt}
\begin{document}
\xymatrix@R=1.5cm@C=2cm{
 A \ar@<.5ex>[r]^{f} \ar@<.5ex>[d]^{g}& \ar@<.5ex>[l]^{h} B\ar@<.5ex>[dl]\\
 C \ar@<.5ex>[u]^{r} \ar@<.5ex>[ur] & 
 }
\end{document}

enter image description here

Why are r and g labels not well aligned horizontally, like vertical labels?

3
  • do you mean horizontally or vertically? your orange line is drawn at a strange place, below the baseline, if you draw the baseline it looks natural to me rg you expect the tail of the g to be below the r surely? Jun 2, 2020 at 18:51
  • @DavidCarlisle Very kind David Before I have used the translator. Yes you're right: I expect the tail of the g to be below the r. If you want to change my unclear question you're welcome always or welcome.
    – Sebastiano
    Jun 2, 2020 at 18:55
  • To align the r and g, I would enter the r as {r\vphantom{g}} to raise the r. Although the depth of the g could be removed by \smash[b]{g}, that would move it lower, and it already looks closer to the bottom than to the top. (Not tested.) Jun 2, 2020 at 19:51

1 Answer 1

1

As from the suggestion of the very nice user @barbara beeton, I have added your solutions (by your comment):

1. using \phantom:

\documentclass[a4paper,12pt]{article}
\usepackage[cmtip,all]{xy}
\labelmargin-{1pt}
\begin{document}
\xymatrix@R=1.5cm@C=2cm{
 A \ar@<.5ex>[r]^{f} \ar@<.5ex>[d]^{g}& \ar@<.5ex>[l]^{h} B\ar@<.5ex>[dl]\\
 C \ar@<.5ex>[u]^{r\vphantom{g}} \ar@<.5ex>[ur] & 
 }
\end{document}

enter image description here

2. or using \smash[b]{g}

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}

\usepackage[cmtip,all]{xy}
\labelmargin-{1pt}
\begin{document}
\xymatrix@R=1.5cm@C=2cm{
 A \ar@<.5ex>[r]^{f} \ar@<.5ex>[d]^{\smash[b]{g}}& \ar@<.5ex>[l]^{h} B\ar@<.5ex>[dl]\\
 C \ar@<.5ex>[u]^{r} \ar@<.5ex>[ur] & 
 }
\end{document}

enter image description here

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.