3

To denote convergence of a sequence towards a limit, the usual \rightarrow seems too short to me. My document uses Michael Barr's diagxy package, which defines \to, and that arrow is too long.

How might I get a more suitable length arrow for this?

Example:

\documentclass[12pt]{article}
\usepackage{amsfonts}
\newcommand{\tendsto}{\mathrel{\rightarrow}}
\newcommand{\N}{\mathbb{N}}
\usepackage{diagxy}     %% redefines \to

\linespread{1.21}

\begin{document}

Let $(x_{n})_{n \in \N} \tendsto x$ in $X$. %% too short?

Let $(x_{n})_{n \in \N} \to x$ in $X$.      %% too long!

\end{document}

Arrows - amsfonts

The problem is more pronounced with the actual fonts I'm using, namely, Lucida Bright (\usepackage{lucidabr} instead of \usepackage{amsfonts}):

Arrows - Lucida Bright fonts

The longer arrow \to from Barr's package (which is a nice length for function notation, as in $f \colon A \to B$) is defined in this part of diagxy:

\def\setwdth#1#2{\setbox0\hbox{$\labelstyle#1$}\wdth=\wd0%
\setbox0\hbox{$\labelstyle#2$}\ifnum\wdth<\wd0 \wdth=\wd0 \fi}%

\def\topppp/#1/<#2>^#3_#4{\:%
\ifnum#2=0%
   \setwdth{#3}{#4}\deltax=\wdth \divide \deltax by \ul%
   \advance \deltax by \defaultmargin  \ratchet{\deltax}{100}%
\else \deltax #2%
\fi%
\xy\ar@{#1}^{#3}_{#4}(\deltax,0) \endxy%
\:}%

\def\toppp/#1/<#2>^#3{\ifnextchar_{\topppp/#1/<#2>^{#3}}{\topppp/#1/<#2>^{#3}_{}}}%
\def\topp/#1/<#2>{\ifnextchar^{\toppp/#1/<#2>}{\toppp/#1/<#2>^{}}}%
\def\toop/#1/{\ifnextchar<{\topp/#1/}{\topp/#1/<0>}}%
\def\to{\ifnextchar/{\toop}{\toop/>/}}%

Is there some suitable way to exploit code from diagxy, or by other means, produce an arrow that's a bit longer than \rightarrow but not as long as Barr's \to?

4
  • I don't know this package, but why not saving the old definition before loading this package if this is the length you are looking for? \let\oldto\to \usepackage{diagxy}
    – nox
    Commented Jul 28, 2018 at 20:51
  • 1
    Or you could use \xrightarrow from amsmath: \xrightarrow{\hspace{10pt}} adjust this space to your needs. Of course you can create a new macro with your desired length: \newcommand{\myrightarrow}{\xrightarrow{\hspace{10pt}}}
    – nox
    Commented Jul 28, 2018 at 20:59
  • 5
    I see overlong arrows all the time; keep it as short as possible.
    – egreg
    Commented Jul 28, 2018 at 21:00
  • In part, by making the arrows a bit longer I'm trying to compensate for the relatively small arrowhead size with the Lucida Bright arrows.
    – murray
    Commented Jul 28, 2018 at 22:26

1 Answer 1

2

I’d like to direct your attention to lucida-amsmath.pdf. On Page 22, we find that the “normal usage” of the “converges to” symbol is just \rightarrow in Equations (48) and (49).

The length of the \rightarrow is chose by the font designer. If the designer doesn’t find the arrow head “too small” or the arrow bar “too short”, then we shouldn’t either (and if you disagree, perhaps change the font). But if you insist on designing your own arrow, which you called \tendsto, then you can borrow the definition found in lucidabr.dtx:

\DeclareMathSymbol{\relbar@}{\mathord}{arrows}{45}
\def\relbar{\mathrel{\smash\relbar@}\mathrel{\mkern-2.5mu}}
% ...
\def\longrightarrow{\mathrel{\mkern4mu}\relbar\rightarrow}

We see that \longrightarrow is built by simply connecting a \relbar with a \rightarrow, and then using \mathrel{\mkern4mu} to adjust the spacing around this relation symbol.

So, in order to design an arrow of our own use, we could add the following to the preamble:

% Adjust the `-2' in \mkern-2mu to suit your need
\newcommand*{\tendsto}{\mathrel{\mkern4mu}\relbar\mkern-2mu\rightarrow}

Since I don’t have the Lucida fonts, I can only provide an empirical -2mu in the above definition. Adjust this length to suit your need. It is worth pointing out that there is no standard for how long an arrow should be, so the length you decide to put into this customized \tendsto is totally subjective. Added: For Computer Modern, you may find -8mu looks good (\longrightarrow uses \joinrel, which is essentially \mkern-3mu).

Added: This approach may be better than \newcommand{\myrightarrow}{\xrightarrow{\hspace{10pt}}} suggested by @nox, because:

  1. This doesn’t require amsmath, although it’s very likely that you’ll need amsmath anyway if you have a lot of math.
  2. This scales correctly in the script- and second-script-levels, since it doesn’t rely on the absolute length like 10pt. You could use something like 0.8em, but the arrow head won’t be scaled correctly (Well, you’re not supposed to use \xrightarrow{...} in scripts anyway. It was designed to have text placed over/under it).

Both approaches use redesigned arrows essentially.

Side note: I don’t recommend using the redefined \to from the diagxy package: The arrow head simply doesn’t blend with either Computer Modern or Lucida Bright.

Illustration using Computer Modern

Here is an illustration using Computer Modern:

\documentclass[12pt]{article}

% Many font packages, including lucidabr, redefine things set up by amsmath
% So amsmath must come before math font settings
% See Section 1 of lucida-amsmath.pdf
\usepackage{amsmath}
\newcommand*{\myrightarrow}{\xrightarrow{\hspace{10pt}}}

\usepackage{amsfonts}
\newcommand*{\tendsto}{\relbar\mkern-8mu\rightarrow}
\newcommand{\N}{\mathbb{N}}

%\usepackage{diagxy}     %% redefines \to

\newcommand*{\test}[1]{%
  \makebox[7em][r]{\texttt{\textbackslash#1}}:
  Let $(x_n)_{n \in \N} \csname#1\endcsname x$ in~$X$;
  that is, \[\lim_{n \csname#1\endcsname \infty} x_n = x.\]}

\begin{document}
\noindent\test{to}
\test{tendsto}
\test{myrightarrow}
\end{document}

Comparison

2
  • Why might that arrow re-design be better than using \newcommand{\myrightarrow}{\xrightarrow{\hspace{10pt}}}?
    – murray
    Commented Jul 29, 2018 at 0:29
  • @murray Please check my updated answers. Actually, \xrightarrow redesigns arrow as well. However, \xrightarrow is meant to be used in \displaystyle, so there will be problems in sub- and superscripts. Commented Jul 29, 2018 at 3:05

You must log in to answer this question.

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