Using newtxmath with the original arrowheads
To get curly-shaped arrowheads while using the newtxmath
package, you may want to load the old-arrows package.
The following screenshots show the output of an MWE without and with the old-arrows
package loaded.
\documentclass[border=2pt]{standalone}
\usepackage{newtxtext}
\usepackage[libertine]{newtxmath}
%\usepackage{old-arrows} % uncomment as desired
\begin{document}
$A\to B$, $a\mapsto b$, $c\gets d$, $u\leftrightarrow v$
\end{document}
Addendum: Just for completeness, here are a couple of screenshots that show the effect that loading the old-arrows
package has if no font package is loaded, i.e., if the Computer Modern
font is employed. The main effect is a noticeable reduction in the size of the arrowheads (back to their pre-1992 sizes, according to the user guide of the old-arrows
package).
\documentclass[border=2pt]{standalone}
%\usepackage{old-arrows} % uncomment as desired
\begin{document}
$A\to B$, $a\mapsto b$, $c\gets d$, $u\longleftrightarrow v$
\end{document}
Here is how you can adjust the arrows in tikz-cd
, regardless of whether or not you load old-arrows
(as suggested in Mico's answer). tikz-cd
comes with the option to get the arrow head from a glyph. So we can just use the rightarrow
glyph to get
\documentclass{article}
\usepackage{newtxtext}
\usepackage[libertine]{newtxmath}
\usepackage{tikz-cd}
\usepackage{old-arrows} % uncomment as desired
\tikzset{
math to/.tip={Glyph[glyph math command=rightarrow]}}
\begin{document}
$A\to B, a\mapsto b$
\begin{tikzcd}
A\arrow[r,-math to] & B \end{tikzcd}
\end{document}
When you comment out the \usepackage{old-arrows}
What if you wish to install this globally for "ordinary" arrows? Just redefine the rightarrow
style.
\documentclass{article}
\usepackage{newtxtext}
\usepackage[libertine]{newtxmath}
\usepackage{tikz-cd}
%\usepackage{old-arrows}
\tikzset{
math to/.tip={Glyph[glyph math command=rightarrow]}}
\tikzcdset{rightarrow/.code={\pgfsetarrows{tikzcd cap-math to}}}
\begin{document}
$A\to B, a\mapsto b$
\begin{tikzcd}
A\arrow[r] & B \end{tikzcd}
\end{document}
You can emulate more and more of these arrows. This essentially amounts to copying the code from tikzlibrarycd.code.tex
and replacing the arrow heads as described above. Here are a few more.
\documentclass{article}
\usepackage{newtxtext}
\usepackage[libertine]{newtxmath}
\usepackage{tikz-cd}
%\usepackage{old-arrows}
\tikzset{
ambient rightarrow/.tip={Glyph[glyph math command=rightarrow]},
ambient Rightarrow/.tip={Glyph[glyph math command=Rightarrow]},
}
\tikzcdset{ambient arrows/.code={
\tikzcdset{rightarrow/.code={\pgfsetarrows{tikzcd cap-ambient rightarrow}},
Rightarrow/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies cap-ambient Rightarrow}},
leftarrow/.code={\pgfsetarrows{ambient rightarrow-tikzcd cap}},
Leftarrow/.code={\tikzcdset{double line}\pgfsetarrows{ambient Rightarrow-tikzcd implies cap}},
leftrightarrow/.code={\pgfsetarrows{ambient rightarrow-ambient rightarrow}},
Leftrightarrow/.code={\tikzcdset{double line}\pgfsetarrows{ambient Rightarrow-ambient Rightarrow}},
mapsto/.code={\pgfsetarrows{tikzcd bar-ambient rightarrow}},
mapsfrom/.code={\pgfsetarrows{ambient rightarrow-tikzcd bar}},
Mapsto/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies bar-ambient Rightarrow}},
Mapsfrom/.code={\tikzcdset{double line}\pgfsetarrows{ambient Rightarrow-tikzcd implies bar}},
}}}
\begin{document}
$A\to B, a\mapsto b,C\Rightarrow D$
\begin{tikzcd}[ambient arrows]
A\arrow[d,mapsto]\arrow[r] & B \\
C & \arrow[l,Rightarrow] D\arrow[u,Rightarrow]
\end{tikzcd}
\end{document}
One should, however, also mention that, while these glyphs are really great, they are not perfect nor quite as versatile as the arrows from arrows.meta
. So you should not expect to be able to bend them arbitrarily and your may find viewer-dependent glitches. If you want this, then you probably need to declare arrow heads on your own. This is not particularly difficult but somewhat tedious. For details look up \pgfdeclarearrow
in the pgf manual (and look for posts using this command). (Ironically a couple of hours ago I believe to have found that the Implies
arrow head might be somewhat less versatile than one may think it is.)