2

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

13

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

| improve this answer | |
  • Wow! This is very helpful. Thank you so much. – Harry Nov 30 '14 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. – Harry Nov 30 '14 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. – Heiko Oberdiek Nov 30 '14 at 17:08
  • Hello. Changing the length settings helped. Thanks a bunch. Cheers - Harry – Harry Nov 30 '14 at 17:10
  • 2
    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. :-) – Harry Nov 30 '14 at 18:03
15

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

\documentclass{scrartcl}
\usepackage{fontawesome}

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

Output:

simple map marker from fontawesome

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

| improve this answer | |
  • 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. – Harry Nov 30 '14 at 15:50
  • @Harry no, it won't. Just in case, you haven't tried it yet. – LaRiFaRi Nov 30 '14 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. – David Z Dec 1 '14 at 11:20

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.