# Code for pin icon on a map

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.

• Nov 30, 2014 at 15:55
• Welcome to TeX.SX! Actually, this does not mean address but location. For an address, I would take a house symbol. Nov 30, 2014 at 15:56
• @Harry +1 for your promise below to contribute here in time. Nov 30, 2014 at 19:08

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,
]
-- (0, -\pinC) -- cycle
circle[
at={(0,0)},
]
;
\end{tikzpicture}
\end{document}


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}


• Wow! This is very helpful. Thank you so much. Nov 30, 2014 at 17:00
• Is there anyway, I can shrink the size of this symbol? Its huge on the document. I am sorry, but I am very new to Latex. Nov 30, 2014 at 17:05
• @Harry It can be scaled, when included, e.g, \includegraphics[scale=.25]{pin.pdf} or \includegraphics[height=\heightof{M}]{pin.pdf} (the latter requires \usepackage{calc}. Or you can change the length settings of \pinA, \pinB, \pinC. Nov 30, 2014 at 17:08
• Hello. Changing the length settings helped. Thanks a bunch. Cheers - Harry Nov 30, 2014 at 17:10
• Everybody here in the TeX community is very helpful and friendly. Keep up the good work guys!!! I hope to be able to help other newbies with their questions in the near future. :-) Nov 30, 2014 at 18:03

You can use the command \faMapMarker from the package fontawesome. Like this:

\documentclass{scrartcl}
\usepackage{fontawesome}

\begin{document}
Map Symbol: \faMapMarker
\end{document}


Output:

This symbol is available in pdflatex now as well, since the fontawesome-package added support for pdflatex recently.

• Thanks so much for your prompt response. I am using pdfLaTeX. I am not sure if the fontawesome package would work with pdfLaTeX. I will give it a shot in any case and report back. Nov 30, 2014 at 15:50
• @Harry no, it won't. Just in case, you haven't tried it yet. Nov 30, 2014 at 15:59
• @Harry it's possible you might have nothing to lose by using XeLaTeX or LuaLaTeX for this particular document. See this question. Dec 1, 2014 at 11:20