2

I defined a new command

\newcommand{\pfeil}[2]{[\overleftarrow{#1,#2}]}

to visualize the arrows used in the field of graph theory.

enter image description here

As you can see, the tip of the arrow touches the numbers. Is there any way to change the tip style and the size? For example the 'stealth' tip from the Tikz arrow tip library would be a better choice for my needs. Because the standard tip seems to be too height when used it text mode. See this example (with the command from egreg's answer):

enter image description here

3

A modification of https://tex.stackexchange.com/a/248297/4427

The second row, with \badpfeil is just for comparison.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\overleftsmallarrow}{\mathpalette{\overarrowsmall@\leftarrowfill@}}
\newcommand{\overarrowsmall@}[3]{%
  \vbox{%
    \ialign{%
      ##\crcr
      #1{\smaller@style{#2}}\crcr
      \noalign{\nointerlineskip}%
      $\m@th\hfil#2#3\hfil$\crcr
    }%
  }%
}
\def\smaller@style#1{%
  \ifx#1\displaystyle\scriptstyle\else
    \ifx#1\textstyle\scriptstyle\else
      \scriptscriptstyle
    \fi
  \fi
}
\makeatother

\newcommand{\pfeil}[2]{[\overleftsmallarrow{\mathstrut#1,#2}]}
\newcommand{\badpfeil}[2]{[\overleftarrow{\mathstrut#1,#2}]}


\begin{document}

\[
\pfeil{1}{7}\quad\pfeil{2}{8}\quad\pfeil{8}{3}
\]

\[
\badpfeil{1}{7}\quad\badpfeil{2}{8}\quad\badpfeil{8}{3}
\]

\end{document}

enter image description here

With a different and smaller arrow tip taken from mathabx:

\documentclass{article}
\usepackage{amsmath,mathabx}

\DeclareFontFamily{U}{mathb}{}
\DeclareFontShape{U}{mathb}{m}{n}{
  <-5.5>    mathb5
  <5.5-6.5> mathb6
  <6.5-7.5> mathb7
  <7.5-8.5> mathb8
  <8.5-9.5> mathb9
  <9.5-11>  mathb10
  <11->     mathb12
}{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
\DeclareFontSubstitution{U}{mathb}{m}{n}
\DeclareMathSymbol{\blacktriangleleft}{2}{mathb}{"9E}

\makeatletter
\newcommand{\overleftsmallarrow}{\mathpalette{\overarrowsmall@\smallleftarrowfill@}}
\newcommand{\overarrowsmall@}[3]{%
  \vbox{%
    \ialign{%
      ##\crcr
      #1{\smaller@style{#2}}\crcr
      \noalign{\nointerlineskip\kern0.4pt}%
      $\m@th\hfil#2#3\hfil$\crcr
    }%
  }%
}
\newcommand{\smallleftarrowfill@}{%
  \arrowfill@\blacktriangleleft\relbar\relbar
}
\def\smaller@style#1{%
  \ifx#1\displaystyle\scriptstyle\else
    \ifx#1\textstyle\scriptstyle\else
      \scriptscriptstyle
    \fi
  \fi
}
\makeatother

\newcommand{\pfeil}[2]{[\overleftsmallarrow{#1,#2}]}


\begin{document}

Space between a deep line and a digit:
\the\dimexpr\baselineskip-\fontchardp\font`y-\fontcharht\font`8\relax

Space between a deep line and \verb|\pfeil|
\sbox0{$\pfeil{2}{8}$}
\the\dimexpr\baselineskip-\fontchardp\font`y-\ht0\relax

\[
\pfeil{1}{7}\quad\pfeil{2}{8}\quad\pfeil{8}{3}
\]

yyyyyy yyyyy yyyyyy yyyyy yyyyyy yyyyy yyyyyy yyyyy
yyyyyy yyyyy yyyyyy yyyyy yyyyyy yyyyy yyyyyy yyyyy
yyyyyy yyyyy yyyyyy $\pfeil{2}{8}$ yyyyy yyyyyy yyyyy
yyyyyy yyyyy yyyyyy yyyyy yyyyyy yyyyy

\end{document}

The computation shows that the interline space will not be increased; the arrow tip will almost touch a deep letter, but the probability of this happening is not so high. You might decrease the (already small) kerning to make the touching less evident.

enter image description here

  • @JohnnyDrama I added a new version – egreg Apr 13 '18 at 17:37
  • It’s hardly the case to remark that the first version (with CM arrowtips) of the smaller arrows is also made available by the halloweenmath package (it’s not a joke, it does exist!). – GuM Apr 13 '18 at 19:21
3

You can use the old-arrows package:

\documentclass{article}

\usepackage{mathtools, amssymb, old-arrows}
\newcommand{\pfeil}[2]{[\overleftarrow{#1,#2}]}

\begin{document} %

\[ \pfeil{1}{7}\enspace\pfeil{2}{8}\enspace\pfeil{8}{3} \]%

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.