12

Where do I find the on/off symbol of electronics?enter image description here

5

5 Answers 5

18

The package fontawesome provides a lot of useful symbols and can be used with both Unicode (LuaTeX, XeTeX) and non-Unicode (pdfTeX, eTeX) engines:

\documentclass{article}
\usepackage{fontawesome}
\begin{document}
\faPowerOff
\end{document}

output

1
  • 3
    The fontawesome package contains a \faoff or \faicon{off} command for this. It is an OpenType font, so that you need fontspec and xelatex or lualatex to use it. Maybe otftotfm and cfftot1, from the LCDF type tools, might allow to obtain a type 1 version usable with (pdf)latex.
    – Bernard
    Commented Feb 2, 2014 at 18:50
12

And a tikz solution that can also be used as standalone symbol graphics:

\documentclass{standalone}
\usepackage{tikz}

\newlength\unit
\setlength{\unit}{20pt}

\begin{document}
\begin{tikzpicture}[
  x=\unit,
  y=\unit,
  radius=\unit,
  line width=.4\unit,
  line cap=round,
]
  \draw[overlay]
    (0,1.2) -- (0,0)
    (130:1) [overlay] arc[start angle=130, delta angle=280]
  ;
  \path[use as bounding box] (-1.2,-1.2) (1.2,1.4);
  % arc is is taking the points of the internally used Bézier
  % curves into account for the bounding box
\end{tikzpicture}
\end{document}

Result

Remarks:

  • The bounding box is specified separately, because arc uses the points of the internally used Bézier curve for the bounding box.
  • I have used rounded line caps, they look better for my taste.
12
\documentclass[pstricks,border=12pt]{standalone}

\begin{document}
\begin{pspicture}[linewidth=1,linecap=1](6,6)
    \psarc(3,3){2.5}{125}{55}
    \psline(3,3)(3,5.5)
\end{pspicture}
\end{document}

enter image description here

3
  • 1
    Nice and short! Commented Feb 2, 2014 at 18:55
  • line cap of the arc must be round too. ;)
    – percusse
    Commented Feb 2, 2014 at 20:03
  • 3
    @percusse: It is not sharp anymore and becomes safe for children. Commented Feb 5, 2014 at 7:19
11

You can drawing it yourself using PSTricks.

With 'sharp' corners:

\documentclass{article}

\usepackage{pstricks-add}

\newcommand*\OnOff[1]{%
\begin{pspicture}(6,6.5)
 \psset{
   dimen = middel,
   linecolor = #1,
   fillstyle = solid,
   fillcolor = #1
 }
  \psRing(3,3)[125,55]{2}{3}
  \psarc(3,3){0.5}{180}{360}
  \psframe(2.5,3)(3.5,6)
  \psarcn(3,6){0.5}{180}{0}
\end{pspicture}}

\begin{document}

\begin{center}
  \OnOff{black}
  \OnOff{blue}
  \OnOff{red}
  \OnOff{yellow}
\end{center}

\end{document}

output1

With 'round' corners:

\documentclass{article}

\usepackage{pstricks-add}

\newcommand*\OnOff[1]{%
\begin{pspicture}(6,6.5)
 \psset{
   dimen = middel,
   linecolor = #1,
   fillstyle = solid,
   fillcolor = #1
 }
  \psarc(!3 2.5 130 cos mul add 3 2.5 130 sin mul add){0.5}{310}{130}
  \psRing(3,3)[130,50]{2}{3}
  \psarc(!3 2.5  50 cos mul add 3 2.5  50 sin mul add){0.5}{50}{230}
  \psarc(3,3){0.5}{180}{360}
  \psframe(2.5,3)(3.5,6)
  \psarcn(3,6){0.5}{180}{0}
\end{pspicture}}

\begin{document}

\begin{center}
  \OnOff{black}
  \OnOff{blue}
  \OnOff{red}
  \OnOff{yellow}
\end{center}

\end{document}

output2

0

If you want to use it in the paragraph. You can use fontawesome package as below. It also has a lot of other user symbols and characters.

\documentclass{article}
\begin{document}

\usepackage{fontawesome}
This is power button \faPowerOff in the paragraph.

\end{document}
New contributor
annie is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • 3
    Welcome! fontawesome is great, but isn't this a duplicate of the answer above: tex.stackexchange.com/a/157200? Also, you need \command{} in the rather than \command in the or you'll lose the space.
    – cfr
    Commented 2 days ago

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .