5

Consider the following MWE.

\documentclass[fontsize=12pt]{scrbook}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}

\begin{document}
    \begin{align*}
        v\xrightarrow{e}w &\quad v\overset{e}\rightarrow w \\
        \scriptstyle v\xrightarrow{e}w &\quad \scriptstyle v\overset{e}\rightarrow w \\
        \scriptscriptstyle v\xrightarrow{e}w &\quad \scriptscriptstyle v\overset{e}\rightarrow w
    \end{align*}
\end{document}

The result looks like this:

xrightarrow not scaling

While \rightarrow is changing in size when using \scriptstyle or \scriptscriptstyle, \xrightarrow is not and produces arrows of wrong size and hence height, as well as too little spacing.

Is there a way to fix \xrightarrow?

  • You might want to reduce the MWE even further and removing the libertine stuff as well – daleif Sep 8 '17 at 9:13
2

According to its definition, \xrightarrow only provides normal size and it won't scale in subscripts.

You can define a (less efficient) variant:

\documentclass[fontsize=12pt]{scrbook}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
%\usepackage{libertine}
%\usepackage[libertine]{newtxmath}

\newcommand{\sxrightarrow}[2][]{%
  \mathrel{\text{$\xrightarrow[#1]{#2}$}}%
}

\begin{document}

\begin{align*}
v\sxrightarrow{e}w &\quad v\overset{e}\rightarrow w \\
\scriptstyle v\sxrightarrow{e}w &\quad \scriptstyle v\overset{e}\rightarrow w \\
\scriptscriptstyle v\sxrightarrow{e}w &\quad \scriptscriptstyle v\overset{e}\rightarrow w
\end{align*}

\end{document}

enter image description here

  • the bottom-most "e" on the right-hand side is larger than its companion on the left. more like the size of the one above it in the second row. (in the first and second rows, the sizes match.) – barbara beeton Sep 8 '17 at 16:01
  • @barbarabeeton That's because there is no third level for subscripts/superscripts. I don't think such an arrow would be used in scriptscriptstyle, but the smaller label is better anyway. – egreg Sep 8 '17 at 16:20

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.