[Tex/LaTex] Code for pin icon on a map

graphicssymbols

Is there any way I can get the pin icon / symbol (that us usually used on maps)? Any icon similar to the attached one would do. I am trying to use this symbol instead of stating 'Address' in one of my documents. Any input, suggestions or advice will be greatly appreciated.

enter image description here

Best Answer

A tikz solution (as standalone image):

\documentclass{standalone}

\usepackage{xcolor}
\usepackage{tikz}

\newdimen\pinA
\newdimen\pinB
\newdimen\pinC

\setlength{\pinA}{10mm}
\setlength{\pinB}{20mm}
\setlength{\pinC}{40mm}

\definecolor{pin}{gray}{0}

\begin{document}
  \begin{tikzpicture}
    \useasboundingbox (-\pinB, -\pinC) (\pinB, \pinB);
    \pgfmathsetmacro{\pinAngle}{acos(\pinB/\pinC)}%
    \pgfmathsetmacro{\pinAngleRight}{270+\pinAngle}%
    \path[fill=pin, even odd rule]
      (\pinAngleRight:\pinB)
      arc[
        at={(0,0)},
        start angle=\pinAngleRight,
        delta angle=360-2*\pinAngle,
        radius=\pinB,
      ]
      -- (0, -\pinC) -- cycle
      circle[
        at={(0,0)},
        radius=\pinA,
      ]
    ;  
  \end{tikzpicture}
\end{document}

Result

The both radii and the length of the tip can be configured using the dimen registers \pinA, \pinB, \pinC, all three measured from the origin in the middle of the circles. The color can be set via color name pin.

Usage

The file can be stored as pin.tex, then run pdflatex pin to get pin.pdf. The following example automatically scales the image to the size of uppercase letters, when included as image:

\documentclass{article}
\usepackage{graphicx}
\usepackage{calc}

\newcommand*{\pin}{%
  \includegraphics[height=\heightof{M}]{pin}%
}

\begin{document}
{\Huge \pin~Hello World}
{\normalsize \pin~Hello World}
{\tiny \pin~Hello World}
\end{document}

Result usage

Related Question