You could, of course, use TikZ for this:
The symbol will scale with your font size, since it uses ex
to define the path.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\newcommand\shield{%
\tikz [baseline] \draw (0,1.75ex) -- (0,0.75ex) arc [radius=0.75ex, start angle=-180, end angle=0] -- (1.5ex,1.75ex) -- cycle;%
}
A shield: \shield
\end{document}
If you're feeling fancy, you could parametrise it a bit:
\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\begin{document}
\newcommand\shield[1][]{%
\tikzset{
shield width/.store in=\shieldwidth,
shield width=1.5ex,
shield height/.store in=\shieldheight,
shield height=1.75ex
}%
\tikz [baseline,#1] \draw (0,\shieldheight) -- (0,\shieldwidth/2) arc [radius=\shieldwidth/2, start angle=-180, end angle=0] -- (\shieldwidth,\shieldheight) -- cycle;%
}
A shield: \shield
A wide shield: \shield[shield width=2ex]
A tall shield: \shield[shield height=3ex]
\end{document}
Here is a pure LaTeX solution that uses \dashedleftarrow
from MnSymbol
, and makes it extendable with (shortened) minus signs, as usual for extendable accents. The new command to use is \odla{...}
, short for \overdashedleftarrow
.
\documentclass{article}
\usepackage{graphicx}
\usepackage{MnSymbol}
\makeatletter
\newcommand{\odla}[1]{%
\vbox {\m@th\ialign{##\crcr
\odlafill \crcr
\noalign{\kern-\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}
%% fill with (short) minus signs
\def\odlafill{%
$\m@th\dashedleftarrowtip\mkern-5mu\cleaders\hbox{$\mkern4mu\shortbar\mkern-3mu$}\hfill\mkern-0.5mu$}
%% put 2pt space above and below the tip
\def\dashedleftarrowtip{%
\raisebox{\z@}[2pt][2pt]{$\mathord{\dashedleftarrow}$}}
%% make the minus shorter to fit \dashedleftarrow
\def\shortbar{%
\smash{\scalebox{0.4}[1.0]{$-$}}}
\makeatother
\begin{document}
\begin{equation*}
\odla{x} \quad \odla{ab} \quad \odla{abc} \quad \odla{abcd} \quad \odla{abcde} \quad \odla{a}^{\:\odla{b}} \quad \odla{abcdefghijklmnop}
\end{equation*}
\end{document}
In the likely case you don't want to use MnSymbol
as your math font just to have the \dashedleftarrow
we use as a the arrow tip here, we can use this symbol like this:
\documentclass{article}
\usepackage{graphicx}
\DeclareFontFamily{U}{MnSymbolA}{}
\DeclareSymbolFont{MnSyA}{U}{MnSymbolA}{m}{n}
\DeclareFontShape{U}{MnSymbolA}{m}{n}{
<-6> MnSymbolA5
<6-7> MnSymbolA6
<7-8> MnSymbolA7
<8-9> MnSymbolA8
<9-10> MnSymbolA9
<10-12> MnSymbolA10
<12-> MnSymbolA12}{}
\DeclareMathSymbol{\dashedleftarrow}{\mathrel}{MnSyA}{98}
\makeatletter
\newcommand{\odla}[1]{%
\vbox {\m@th\ialign{##\crcr
\odlafill \crcr
\noalign{\kern-\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}
%% fill with (short) minus signs
\def\odlafill{%
$\m@th\dashedleftarrowtip\mkern-5mu\cleaders\hbox{$\mkern4mu\shortbar\mkern-3mu$}\hfill\mkern-0.5mu$}
%% put 2pt space above and below the tip
\def\dashedleftarrowtip{%
\raisebox{\z@}[2pt][2pt]{$\mathord{\dashedleftarrow}$}}
%% make the minus shorter to fit \dashedleftarrow
\def\shortbar{%
\smash{\scalebox{0.4}[1.0]{$-$}}}
\makeatother
\begin{document}
\begin{equation}
\odla{x} \quad \odla{ab} \quad \odla{abc} \quad \odla{abcd} \quad \odla{abcde} \quad \odla{a}^{\:\odla{b}} \quad \odla{abcdefghijklmnop}
\end{equation}
\end{document}
Best Answer
Using
TikZ
you can define a command that will give you a stretchable symbol; you can do something like this: