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}
There is \providecommand
that defines a macro if it is not yet defined. Together with \renewcommand
you have your "\extranewcommand
":
\providecommand{\foo}{}
\renewcommand{\foo}[1]{bar: #1}
Or you can switch to the plain TeX primitives (other syntax!), e.g.:
\long\def\foo#1{bar: #1}
(\renewcommand
and friends without star use \long\def
and if the star form is given, \def
without \long
is used. Also the parameters are specified differently.)
\declarecommand
A definition of the "requested" \declarecommand
that calls \providecommand
and \renewcommand
together:
\documentclass{article}
\makeatletter
\newcommand*{\declarecommand}{%
\@star@or@long\declare@command
}
\newcommand*{\declare@command}[1]{%
\provide@command{#1}{}%
% \let#1\@empty % would be more efficient, but without error checking
\renew@command{#1}%
}
\makeatother
\begin{document}
\declarecommand*{\foo}{\typeout{foo 1: \meaning\foo}}
\foo
\declarecommand{\foo}{\typeout{foo 2: \meaning\foo}}
\foo
\declarecommand*{\foo}[1]{\typeout{foo #1: \meaning\foo}}
\foo{3}
\end{document}
Result:
foo 1: macro:->\typeout {foo 1: \meaning \foo }
foo 2: \long macro:->\typeout {foo 2: \meaning \foo }
foo 3: macro:#1->\typeout {foo #1: \meaning \foo }
Best Answer
Here is a solution using
stackengine
andgraphicx
. Probably you should scale the whole operator down a little bit, but it does what it should be.If you want this as a macro just do
\newcommand\myop{\ensuremath\mathrel{\raisebox{1pt}{\stackunder{$<$}{\rotatebox{-27}{\resizebox{7pt}{2pt}{$\sim$}}}}}}
.Update: Use
\boldsymbol{\sim}
with a resizebox of 6.5pt instead (as the OP himself/herself suggested) and the output will look nicer.