答案1
修改https://tex.stackexchange.com/a/248297/4427
第二行,只是\badpfeil
为了比较。
\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}
带有不同且较小的箭头,取自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}
计算表明,行间距不会增加;箭头尖端几乎会碰到较深的字母,但发生这种情况的概率并不高。您可以减小(已经很小的)字距,使接触不那么明显。