Fonts & Character SetsIcon for a Loudspeaker

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
Linguist
Posts: 43
Joined: Mon Nov 07, 2011 12:07 pm

Icon for a Loudspeaker

Post by Linguist »

Is there's a font or package that would allow me to input a speaker icon, or loudspeaker icon?

At the moment I'm using the picture from this page with the following code to resize it.

Code: Select all

\includegraphics[height=1.55ex]{speaker.eps}
But ideally I'd use an actual icon. I've made a pretty through search of "The Comprehensive LaTeX Symbol List", and haven't found anything! There's all sorts of cool miscellaneous symbols and icons; heck, there's even a package that allows you to input characters from the Simpsons! But nothing for a speaker...

Thanks for any help or pointers.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Icon for a Loudspeaker

Post by hugovdberg »

If you just want a shortcut to include that icon you could simply declare a new macro:

Code: Select all

\documentclass{article}

\newcommand{\speaker}{%
   \includegraphics[height=1.55ex]{speaker.eps}%
}

\begin{document}
\speaker
\end{document}
or alternatively, if you want to be able to change the size regularly:

Code: Select all

\documentclass{article}

\newcommand{\speaker}[1]{%
   \includegraphics[height=#1]{speaker.eps}%
}

\begin{document}
\speaker{1.55ex}
\end{document}
If you actually want a different icon, the simplest way to go is with tikz, this way you can finetune all the details of your icon yourself (inspired by solution on tex.se):

Code: Select all

\documentclass{article}

\usepackage{tikz}

\newcommand{\speaker}[1]{%
\begin{tikzpicture}[#1]
   \draw[thick,rounded corners=2pt, fill=black] (0,0.25) -- (0,0.45) -- (0.25,0.45) -- (0.5,0.7) -- (0.5,0) -- (0.25,0.25) -- cycle;
   \draw[line width=2pt,line cap=round] (0.6,0.25) arc (-30:30:2mm);
   \draw[line width=2pt,line cap=round] (0.7,0.15) arc (-30:30:4mm);
   \draw[line width=2pt,line cap=round] (0.8,0.05) arc (-30:30:6mm);
\end{tikzpicture}
}

\begin{document}
\speaker{}
\end{document}
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
Linguist
Posts: 43
Joined: Mon Nov 07, 2011 12:07 pm

Re: Icon for a Loudspeaker

Post by Linguist »

Thanks, the third solution is the closest to what I want.

I'll muck around with it until it's the size I want.

Thanks again!
Linguist
Posts: 43
Joined: Mon Nov 07, 2011 12:07 pm

Icon for a Loudspeaker

Post by Linguist »

Hello,

For posterity, I found the following code created a speaker symbol which dimensions that fit well into a 12pt document (with mathptmx for Times style font).

Code: Select all

\newcommand{\spk}[1]{
\begin{tikzpicture}[#1]
   \draw[thick,rounded corners=0.1pt, fill=black] (0,0.0909) -- (0,0.1636) -- (0.0909,0.1636) -- (0.1818,0.2545) -- (0.1818,0) -- (0.0909,0.0909) -- cycle;
   \draw[line width=0.65pt,line cap=round] (0.2182,0.0909) arc (-30:30:0.7273mm);
   \draw[line width=0.65pt,line cap=round] (0.2545,0.0545) arc (-30:30:1.4545mm);
   \draw[line width=0.65pt,line cap=round] (0.2909,0.0182) arc (-30:30:2.1818mm);
\end{tikzpicture}} %speaker symbo
Post Reply