0

How to create a new \to or \rightarrow symbol with a black head as the left side of the following picture?

enter image description here

Similarly, I'd like to get the \leftarrow, \leftrightarrow, and the negation of them, of this kind. By the way it's better that

  1. they should adapt the font sizes;
  2. the spacings before and after them are suitable.
M. Logic
  • 4,214
  • Maybe https://tex.stackexchange.com/questions/571055/using-tikz-arrow-shapes-in-math-mode-of-a-article-or-book ? – Rmano Sep 07 '23 at 07:40
  • 2
    You can try the mathabx package. (Do you mean "head" and not "tail"?) – mickep Sep 07 '23 at 07:46
  • The heads of arrows in mathabx seems to be not black enough as in the picture. – M. Logic Sep 07 '23 at 08:46
  • Hope this https://tex.stackexchange.com/questions/602080/use-a-latex-length-for-an-arrow-head-length-in-tikz might helps you (refer egreg suggestion) – MadyYuvi Sep 07 '23 at 09:47
  • @Rmano and MadyYuvi Thanks! While it seems that they are not exactly as what I asked. – M. Logic Sep 07 '23 at 10:00
  • Michael Barrs old supporting file diagxy.tex redefines the tag \to you can download it from CTAN – MadyYuvi Sep 07 '23 at 10:29

2 Answers2

2

The pdfMsym package offers some tools for defining arrows. Their size should be compatible with your font size, and they scale with sub/superscripts. It also will create longer and extendable variants of the arrows. The package is intended for plain TeX, but it works with LaTeX as well.

arrow example

\input pdfmsym

\pdfmsymsetscalefactor{10} % Your current font size

\catcode`@=11

\def@rstraightarrow{@linehead@type{0 0 m 2 0 l S 2 0 m 0 1.25 l 1 0 l 0 -1.25 l 2 0 l b}{2}} \def@lstraightarrow{@linehead@type{2 0 m 0 0 l S 0 0 m 2 1.25 l 1 0 l 2 -1.25 l 0 0 l b}{2}}

@arrow@def{rsarrow}@linecap@rstraightarrow @arrow@def{lsarrow}@lstraightarrow@linecap @arrow@def{lrsarrow}@lstraightarrow@rstraightarrow

\catcode`@=12

$$ A\rsarrow B $$ $$ A\lsarrow B $$ $$ A\lrsarrow B $$

\bye

Explanations of the pdfMsym macros used can be found in its documentation, page 14.

Slurp
  • 876
0

This may be overkill, but you can design your own arrow with TikZ.

enter image description here

Here is a modified stealth arrowtip. The command is \myarrow, which can take tikz options. For example, \myarrow[->] or \myarrow[<-] or \myarrow[<->]. Other options include [>-] and [>->].

You can also add the option not, as well as other tikz options such as color, line thickness and style (dotted, dashed, etc.). You can use scale= to change the length.

Note that these arrows will not adjust size for subscripts, etc.

\documentclass{article}

\usepackage{tikz} \usetikzlibrary{arrows.meta, decorations.markings}

\tikzset{not/.style={postaction={decorate, decoration={markings, mark=at position .5 with {\draw[-] (-1pt,-2pt) -- (1pt,2pt);}}}}}

\newcommand{\myarrow}[1][]{\mathrel{\tikz[baseline=-.5ex]{ \drawline cap=round, >={Stealth[round, length=4pt, width=4pt]}, #1--(.3351,0); }}}

\begin{document}

$A\myarrow[->]B\myarrow[<-]C\myarrow[<->]D$

$A\to B\leftarrow C\leftrightarrow D$

$A\myarrow[->,not]B\myarrow[<-,not]C\myarrow[<->,not]D$

\end{document}

Sandy G
  • 42,558