16

I am looking for a "Shield" symbol:

enter image description here

I already perused the Comprehensive Latex Symbol List, with the closest fit being \dsheraldical from the dictsym package, which is however non-satisfactory because of the diagonal bar - I need both the symbol itself and a strike-through version of the symbol, and that doesn't look good with \dsheraldical.

I also tried Detexify, but either my drawing skills suck or such a symbol simply doesn't exist.

Any suggestions - either for where to find that symbol, or how to "create" it through other ways?

EDIT: Building on Jake's answer, my solution looks like this:

\usepackage{tikz}

% Smaller than Jake's version, which was much larger than other symbols
\newcommand\shield{ \tikz [baseline] \draw (0,1.5ex) -- (0,0.75ex) arc [radius=0.5ex, start angle=-180, end angle=0] -- (1ex,1.5ex) -- cycle; }
% Strikethrough version of the same symbol
\newcommand\struckshield{ \tikz [baseline] \draw (0,1.5ex) -- (0,0.75ex) arc [radius=0.5ex, start angle=-180, end angle=0] -- (1ex,1.5ex) -- cycle (0,0) -- (1.0ex,1.75ex); }

Look, Ma, I can do TikZ! :-)

2

4 Answers 4

22

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} 
12
  • 2
    You could make a new box for the shield, save the tikz shield inside that, and define a new command \shield which just copies that box. I guess it'd be a bit lighter that way if the shield is used frequently.
    – morbusg
    Dec 19, 2011 at 8:50
  • @morbusg: That sounds like a good idea, but I've never done anything with boxes. Would you care to add a new answer or edit this one to show how to do that?
    – Jake
    Dec 19, 2011 at 8:54
  • 1
    Jake, @morbusg: Also check out my storebox package which takes care that such repeated content is only stored once in the output PDF. However, for a small drawing like this it might not be that important. Dec 19, 2011 at 9:06
  • 2
    It could just be something like: \newbox\shieldbox\setbox\shieldbox=\hbox{\tikz\draw<...>}\def\shield{\copy\shieldbox} and after that one could use it with \shield.
    – morbusg
    Dec 19, 2011 at 9:50
  • 1
    You should use \usebox instead of \copy to make sure horizontal mode is entered first. Dec 19, 2011 at 9:54
15

There is another way to do that: in the milstd package there is a symbol (in fact a rotated logical AND gate), which in fact has a completely different signification, but looks like what you need: \ANDd:

enter image description here

9
  • Ah, nice, that's the way to go. How did you find that?
    – Jake
    Dec 19, 2011 at 9:43
  • 2
    @Jake: Got good visual memory. ;)
    – Count Zero
    Dec 19, 2011 at 9:45
  • Bwahahaha... VERY nice. Wouldn't have thought of that. :-D
    – DevSolar
    Dec 19, 2011 at 10:32
  • 3
    For the record: It's this milstd package by Rick Simpson, not the other milstd package by Kent McPherson which I tried first and failed :-)
    – diabonas
    Dec 19, 2011 at 12:53
  • 1
    @diabonas: Thanks' I wasn't aware there were two of them... I added the link to my answer, hope it's ok. :)
    – Count Zero
    Dec 19, 2011 at 21:36
3

I need a shield symbol and Jake's answer inspired me. I share my tikz code for my shield shield here:

\documentclass[11pt]{article} 
\usepackage{tikz,pifont}

\newcommand\shield{
\tikz [baseline] \draw (3ex,2.5ex) -- (1.5ex,3ex) -- (0ex,2.5ex)  to [out=-90, in=165] (1.5ex,0ex) to [out=15, in=-90] cycle (1.5ex,1.5ex) node {\ding{51}};}

\begin{document}

\shield

\end{document}
0
2

For the record, a tikz-free solution using the \fontawesome5 icon package, \faShield* command.

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.