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}
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
- 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. - 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. - Do you have any suggestions for simplifying the code?
- Can you suggest improvements in the design of the new arrows?
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 functionwidth("$\oldrightarrow$")
which gives you the width of its content to be used, say, in a coordinate. Then you don't needscalerel
. Since the font is not freely available it makes it a bit harder to help you.tikz[baseline=-axis line, line width=0.4pt]
.axis_height
not line (and there's an underscore_
). See the linked Q&A.