3

Using amsmath and extarrows packages, we have many extensible arrows. But these arrows look ugly, since some parts in an arrow are boldfaced.

enter image description here

Are there any better-looking extensible arrows?

3
  • 1
    They are not really bold, just overlapping slightly which affects the anti-aliasing in low resolution. They should print OK. tikz or pstricks or xypick can all draw arrows instead of using repeated character segments, which may suit you better Oct 7, 2013 at 8:52
  • @DavidCarlisle The overlapping makes arrows look ugly when reading document in computer. Why overlapping is necessary in these extensible arrows? I notice that in xypic, long arrows look better than these.
    – Z.H.
    Oct 7, 2013 at 9:03
  • @DavidCarlisle But how to use an arrow drawn by tikz or xypic as an operater inside a math formula? It seems not easy.
    – Z.H.
    Oct 7, 2013 at 9:14

1 Answer 1

5

This is a substitute for \xrightarrow made with Xy-pic

\documentclass{article}
\usepackage[all,cmtip]{xy}

\newlength{\xywd}
\newcommand{\xyrightarrow}[2][]{%
  \sbox{0}{$\scriptstyle#1$}%
  \xywd=\wd0
  \sbox{0}{$\scriptstyle#2$}%
  \ifdim\wd0>\xywd \xywd=\wd0 \fi
  \xymatrix@C\dimexpr\xywd+1em\relax{{}\ar[r]^{#2}_{#1}&{}}%
}

\begin{document}
\[
X \xyrightarrow[r_1-r_2]{r_2-r_1} Y
\]
\[
X \xyrightarrow[r_1-r_2+r_3]{r_2-r_1} Y
\]
\[
X \xyrightarrow{r_2-r_1} Y
\]
\end{document}

enter image description here

2
  • Thanks for this. It seems that you should have \xywd instead of \xywd0 in the code above. Jun 23, 2020 at 18:27
  • @PedroSánchezTerraf The 0 doesn't definitely belong there, thanks!
    – egreg
    Jun 23, 2020 at 19:50

You must log in to answer this question.

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