3

How can I put a range symbol over a character?

The symbol I am looking for is similar to this:

\overleftrightarrow{T}

But instead of using an arrow at each end, I want to put a black dot at each end.

AAA
  • 43
  • 3

3 Answers3

6

Here's an extensible version.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\range}{\mathpalette{\overarrow@\range@}}
\newcommand{\range@}{%
  \arrowfill@\leftrangebullet\relbar\rightrangebullet
}
\newcommand{\leftrangebullet}{\mathrel{\smallbullet}\joinrel\relbar}
\newcommand{\rightrangebullet}{\relbar\joinrel\mathrel{\smallbullet}}
\newcommand{\smallbullet}{%
  \vcenter{\hbox{$\m@th\scriptscriptstyle\bullet$}}%
}
\makeatother

\begin{document}

$\range{T}+\range{ABCD}$

\end{document}

enter image description here

Now also \leftrange and \rightrange:

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\range}{\mathpalette{\overarrow@\range@}}
\newcommand{\leftrange}{\mathpalette{\overarrow@\leftrange@}}
\newcommand{\rightrange}{\mathpalette{\overarrow@\rightrange@}}
\newcommand{\range@}{%
  \arrowfill@\leftrangebullet\relbar\rightrangebullet
}
\newcommand{\leftrange@}{%
  \arrowfill@\leftrangebullet\relbar\relbar
}
\newcommand{\rightrange@}{%
  \arrowfill@\relbar\relbar\rightrangebullet
}
\newcommand{\leftrangebullet}{\mathrel{\smallbullet}\joinrel\relbar}
\newcommand{\rightrangebullet}{\relbar\joinrel\mathrel{\smallbullet}}
\newcommand{\smallbullet}{%
  \vcenter{\hbox{$\m@th\scriptscriptstyle\bullet$}}%
}
\makeatother

\begin{document}

$\range{T}+\range{ABCD}$

$\leftrange{T}+\leftrange{ABCD}$

$\rightrange{T}+\rightrange{ABCD}$

\end{document}

enter image description here

egreg
  • 1,121,712
  • Oh thanks, in fact, I was having problems with extensions – AAA Dec 03 '17 at 16:33
  • Just a quick question, How can I do a half range?. For example for start range: just the left circle and the bar – AAA Dec 03 '17 at 16:56
  • @DiegoDiazDominguez Easy enough! ;-) – egreg Dec 03 '17 at 17:04
  • interesting. the length of the bar isn't the same for a single-ended vs. double-ended extender. and it's not just the width of the ball on the end. – barbara beeton Dec 04 '17 at 17:21
  • @barbarabeeton There is a minimum width, because there is \relbar on both sides. This shows for the single symbol. – egreg Dec 04 '17 at 18:15
  • but i'm not looking at the one-letter example. i'm looking at the "ABCD" example. compare line 1 with line 2. (the one=letter example is just fine.) – barbara beeton Dec 04 '17 at 18:19
  • @barbarabeeton There is just a tiny difference; you can see it better if you only pile the long bits. It's due to the sidebearings of the bullet. As far as I can see it's less than 0.1pt – egreg Dec 04 '17 at 18:43
  • apologies. i was thrown off by the difference in width of the one-letter example. if i had looked at the relative positions of the plus signs, i would not have been so confused. – barbara beeton Dec 04 '17 at 19:40
4
\documentclass{article}
\usepackage{amsmath}
\usepackage{fdsymbol}
\begin{document}
$\overset{\leftrightblackspoon}{T}$ or 
$\overset{\leftrightblackspoon}{\text{T}}$
\end{document}

enter image description here

  • @DiegoDiazDominguez Glad to hear. Please consider clicking the checkmark symbol left of the answer in order to indicate that this question is answered. –  Dec 03 '17 at 15:57
  • @marmot Note that fdsymbol changes all math symbols. – egreg Dec 03 '17 at 16:01
  • @egreg Thanks for pointing this out. I am wondering if there is a survey of these issues. To my knowledge, the calatlogue of symbols does not explain this, or was I looking at the wrong place? –  Dec 03 '17 at 16:21
  • You should look at the package documentation first: FdSymbol is a font of mathematical symbols designed as a companion to Typotheque’s Fedra family, but it might also fit well to other contemporary typefaces. Note “might”. – egreg Dec 03 '17 at 16:25
2

How does that look?

\documentclass[]{standalone}

\usepackage{amsmath}

\begin{document}
$\overset{\cdot - \cdot}{T}$
\end{document}

enter image description here

Skillmon
  • 60,462