7

The underlying problem

I find the arrow tip in the Lucida Bright \rightarrow, hence in \to and \mapsto, to be too small, especially at smaller font sizes. Likewise, I find the Lucida Bright \relbar, used to form \mapsto too short. At the same time, those arrow tips are different from those used by default in TikZ commutative diagrams (from tikz-cd).

Solution so far

From answers in What length arrow for "converges to"? and Use tikz to create better \to and \mapsto that also match tikz-cd diagrams, I have new definitions (as well as a \tendsto for denoting convergence) as follows.

\documentclass[10pt]{article}
\usepackage[left=2in,right=0.75in]{geometry}

\usepackage{amsmath}

\usepackage[lucidascale]{lucidabr}
\linespread{1.04}

\newcommand{\N}{\mathbb{N}}
\newcommand{\from}{\protect\colon}

\def\oldrightarrow{\rightarrow}
\def\oldto{\to}
\def\oldmapsto{\mapsto}
\newcommand*{\oldtendsto}{\mathrel{\oldrightarrow}}

\usepackage{scalerel}
\usepackage{tikz-cd}
\usetikzlibrary{arrows.meta}

\tikzcdset{every arrow/.append style = -{Stealth[scale=1]}}
\tikzcdset{arrows={line width=0.4pt}}

\newcommand{\basicrightarrow}{\mathrel{\tikz[baseline,line width=0.4pt]\draw[arrows=-{Stealth[scale=1.21]},yshift=0.75ex] (0,0) -- (1.667em,0);}}
\newcommand{\newrightarrow}{\scalerel*{\basicrightarrow}{\oldrightarrow}}
\newcommand{\newto}{\mathrel{\scalerel*{\basicrightarrow}{\oldrightarrow}}}
\newcommand{\barredrightarrow}{\mathrel{\tikz[baseline,line width=0.4pt]\draw[arrows={Bar[line width=1.125pt,scale=1.667]}-{Stealth[scale=1.67]},yshift=0.75ex] (0,0) -- (1.95em,0);}}
\newcommand{\newmapsto}{\mathrel{\scalerel*{\barredrightarrow}{\oldrightarrow}}}
\newcommand{\newtendsto}{\mathrel{\newto}}

% command \test based upon the one used by Ruixi Zhang in answer at
% https://tex.stackexchange.com/questions/443614/what-length-arrow-for-converges-to/443623#443623
\newcommand*{\test}[4]{% params; tendsto, to, mapsto
  \texttt{\textbackslash#1}, \texttt{\textbackslash#2}, \texttt{\textbackslash#3}, and \texttt{\textbackslash#4}:\\[6pt]
  Let $(x_n)_{n \in \N} \csname#1\endcsname x$ in~$X$ where $f \from X \csname#2\endcsname Y$ \& $x \csname#3\endcsname y$;
  that is, $\lim_{n \csname#1\endcsname \infty} x_n = x$%
   \[\lim_{n \csname#1\endcsname \infty} x_n = x \quad \text{where $\quad f \from X \csname#2\endcsname Y$ and $x \csname#3\endcsname y$}\\[6pt]
   \quad\text{on the interval $[0, \csname#4\endcsname)$}.\]}

\begin{document}

\noindent%
\test{oldtendsto}{oldto}{oldmapsto}{oldrightarrow}
\test{newtendsto}{newto}{newmapsto}{newrightarrow}
\[
\begin{tikzcd}
 & Y \arrow{dr}{g} & \\
X \arrow{ur}{f} \arrow{rr}{h} && Z
\end{tikzcd}
\]
\[
\begin{tikzcd}
X \arrow{r}{f} \arrow[swap]{d}{h} & Y \arrow{d}{k}
\\
Z \arrow{r}{g} & W
\end{tikzcd}
\]
\end{document} 

New arrows for Lucida Bright Notes:

The option lucidascale for the lucidabr package is to compensate for the relatively large x-height of the Lucida fonts (with nonlinear scaling).

Answers to the questions below will be useful even if you use a different font from Lucida Bright.

Questions

  1. How can I re-use the same names \rightarrow, \to, and \mapsto for what I'm calling \newrightarrow, \newto, and \newmapsto? This is evidently just a TeX/LaTeX macro expansion issue, but I don't understand how to solve it.
  2. How would I shift the arrows vertically upward, to match the vertical position of the original ones? I tried changing yshift=0.75ex to have a larger value, but that just seems to change the size of the arrow rather than shifting it upward.
  3. Do you have any suggestions for simplifying the code?
  4. Can you suggest improvements in the design of the new arrows?
3
  • Use baseline=-axis_line as an option to the \tikz which will put y = 0 at the vertical center of a line. You can also use the PGFMath function width("$\oldrightarrow$") which gives you the width of its content to be used, say, in a coordinate. Then you don't need scalerel. Since the font is not freely available it makes it a bit harder to help you. Commented Apr 3, 2023 at 8:03
  • @Qrrbrbirlbel: Does not compile if I use tikz[baseline=-axis line, line width=0.4pt].
    – murray
    Commented May 7, 2023 at 15:44
  • Sorry it should be axis_height not line (and there's an underscore _). See the linked Q&A. Commented May 7, 2023 at 20:37

1 Answer 1

1

Answering the first question: To preserve the old arrows you should use

\let\oldrightarrow\rightarrow
\let\oldto\to
\let\oldmapsto\mapsto

I had trouble getting your example to compile, but I am positive that this will solve the issue of being unable to overwrite \to and the other commands.


Explanation: If you say \def\oldto{\to}, then \oldto simply expands to \to when you call \oldto, which then expands to the current meaning of \to. On the other hand, \let\oldto\to makes it so \oldto has the same contents as \to, so overwriting \to later does not change what \oldto does.

\def\a{old contents}
\let\b\a
\def\c{\a}
\b; \c\par
\def\a{new contents }
\b; \c\par
\meaning\a; \meaning\b; \meaning\c

enter image description here

1
  • Yes, that answers my problem (1).
    – murray
    Commented May 7, 2023 at 21:37

You must log in to answer this question.

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