I would like to include a loudspeaker icon, for instance by defining my own command \myloudspeaker
:
I looked at Detexify and the Comprehensive LaTeX symbol list.
symbols
I would like to include a loudspeaker icon, for instance by defining my own command \myloudspeaker
:
I looked at Detexify and the Comprehensive LaTeX symbol list.
The Unicode symbol for ₣ is:
U+20A3 FRENCH FRANC SIGN
Libertine is an example for a Unicode font that supports the character:
% lualatex or xelatex
\documentclass{article}
\usepackage{libertineotf}
\begin{document}
^^^^20a3 % ASCII notation
\end{document}
Example for GNU FreeFont:
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\fontspec{FreeSerif.otf}
^^^^20a3
\end{document}
Another example for Times New Roman (from Windows 7):
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\fontspec{times.ttf}
^^^^20a3
\end{document}
\fontspec{Comfortaa-Regular.ttf}% Comfortaa Regular
:
\fontspec{OpenSans-Regular.ttf}% Open Sans Regular
:
siunitx
and pdfLaTeXIf lualatex or pdflatex cannot be used, then the symbol can be included as graphics. The graphics is generated by:
% franc.tex
\nofiles
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\fontspec{FreeSerif.otf}
^^^^20a3
\end{document}
It is compiled via:
$ lualatex franc
$ pdfcrop franc
Then franc-crop.pdf
can be used as image for pdfLaTeX:
\documentclass{article}
\usepackage{graphicx}
\usepackage{siunitx}
\DeclareRobustCommand*{\myfranc}{\includegraphics[scale=.1]{franc}}
\DeclareSIUnit{\franc}{\myfranc}
\begin{document}
\SI{123.45}{\franc}
\end{document}
If you are using lualatex or xelatex, then the font can be used directly, e.g.:
\DeclareRobustCommand*{\myfranc}{%
\begingroup
\fontspec{FreeSerif.otf}%
^^^^20a3%
\endgroup
}
There are some issues to consider:
The standard line width in TeX is 0.4pt
, it is hardcoded in TeX as 26214sp
.
\overline
uses a different line width. It is taken from font parameter 8 of math font family 3 in TeX.
The standard math fonts (Computer Modern) are using 0.39998pt
in all font sizes. But it is scalable in other fonts, e.g. package mathptmx
with 10pt
as class option:
0.3999pt
in \textfont
(\textstyle
/\displaystyle
)0.29591pt
in \scriptfont
(\scriptstyle
)0.23993pt
in \scriptscriptfont
(\scriptscriptstyle
)\overline
TeX constructs a \overline{...}
the following way with θ
as line width (pseudo code):
\vbox{
\kern θ
\hrule height θ
\kern 3*θ
\hbox{$...$}
}
Especially there is white space above the rule. This is useful, if the overlined symbol is put in the denominator of a fraction, for instance.
TeX uses cramped math style for the math expression of \overline
. This means, the superscripts are moved down a little, for a better visual appearance.
Thus \overline
looks like a good choice for the "house" symbols. However, the vertical lines should use the same line width as used by \overline
.
TeX inserts 3 * θ (θ = line width of \overline
) between the formula and the line in \overline
. This cannot be easily changed without loosing cramped style. (AFAIK only LuaTeX can set cramped style explicitly.)
Extra space is added above the line in \overline
, see above.
Usually symbols have side bearings, space at the left and right side of the symbol. The exact amount is usually not available in TeX. The example uses 2 * θ as horizontal space between the vertical lines and the formula. Also a horizontal space 1.5 * θ is put outside the vertical lines. Some kind of side bearings of the new symbol to avoid touching of housed math expressions.
Since the OP wants longer lines (see comment), the example adds 2 * θ as additional depth. (3 * θ seems too large, because there is not a underline that needs some distance from the formula.)
The full example also takes into account the different math styles, thus macro \house
respects the current math sizes.
\documentclass{article}
\usepackage{mathptmx}
\makeatletter
\newcommand*{\house}[1]{%
\mathord{%
\mathpalette\@house{#1}%
}%
}
\newcommand*{\@house}[2]{%
% #1: math style
% #2: expression that gets the "house"
% get the line width of `\overline' in the current math font size
\dimen@=\fontdimen8 %
\ifx#1\scriptscriptstyle\scriptscriptfont
\else\ifx#1\scriptstyle\scriptfont
\else\textfont\fi\fi
3 %
\sbox0{%
$#1%
\vrule width\dimen@\relax
\overline{%
\kern2\dimen@
\begingroup % to keep changes of \dimen@ in #2 local
#2%
\endgroup
\kern2\dimen@
}%
\vrule width\dimen@\relax
\mathsurround=1.5\dimen@ % outside margin
$%
}%
% TeX adds an empty space above `\overline', it needs to be
% removed to get the correct height for the `\vrule's
\ht0=\dimexpr\ht0-\dimen@\relax
\dp0=\dimexpr\dp0+2\dimen@\relax
\vbox{%
\kern\dimen@ % reinsert previously removed space
\copy0 %
}%
}
\begin{document}
\[
\textstyle % same size as \displaystyle
\house{\alpha + \beta}
\stackrel{\mbox{\tiny T}}{=}
\house{\alpha} + \house{\beta}^n
\]
\[
\scriptstyle
\house{\alpha + \beta}
\stackrel{\mbox{\tiny S}}{=}
\house{\alpha} + \house{\beta}^n
\]
\[
\scriptscriptstyle
\house{\alpha + \beta}
\stackrel{\mbox{\tiny SS}}{=}
\house{\alpha} + \house{\beta}^n
\]
\[
\def\x{\frac{\house{\alpha + \beta}}{\house{\alpha} + \house{\beta}}}
\x, \frac{\x}{\x}
\]
\[
\underbrace{\overline{\alpha^2}, \house{\alpha^2}}_{\mbox{\tiny cramped}} \ne
\overline{\mbox{$\alpha^2$}}, \house{\mbox{$\alpha^2$}}
\]
\end{document}
Best Answer
fontawesome
provides a number of options:You're probably after
\faVolumeUp
.