There are symbols for a magnifying glass in LaTeX but I want something like this:
How can I achieve this?
fontawesome
There are symbols for a magnifying glass in LaTeX but I want something like this:
How can I achieve this?
A variant using \clap
from mathtools
and the wide
option of enumitem
:
\documentclass{article}
\usepackage[showframe]{geometry} \usepackage{fontawesome}
\usepackage{enumitem}
\usepackage{mathtools}
% page 3 of manual
\SetLabelAlign{center}{\clap{#1}}
\begin{document}
\begin{itemize}[wide, labelsep = 1em, align=center]
\item[\faCode] Ruby, Python, Java, Javascript, Racket
\item[\faGlobe] Sinatra, Rails, Django, Flask
\item[\faHTMLfive] HTML5, CSS3, JQuery
\item[\faCloud] Redis, CouchDB, PostgreSQL, MySQL
\item[\faExchange] JSON, XML, OAuth
\item[\faCodeFork] git, SVN
\end{itemize}
\end{document}
A simple pic with the "speed" as parameter may do.
\documentclass[tikz,border=7pt]{standalone}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}[pics/speedometer/.style={code={
\foreach \X/\Y [count=\Z] in {green!70!black/low,orange/medium,red/high}
{\fill[fill=\X] (240-\Z*60:4) arc(240-\Z*60:180-\Z*60:4) --
(180-\Z*60:3) arc(180-\Z*60:240-\Z*60:3) -- cycle;
\path [decorate, decoration={text along path,
text={|\color{white}\Huge\sffamily\bfseries|\Y}, text align=center}]
(240-\Z*60:3.2) arc(240-\Z*60:180-\Z*60:3.25);}
\fill (180-#1+8:0.3) arc (180-#1+8:180-#1+344:0.3) -- (180-#1-0.5:3.25)
-- (180-#1+0.5:3.25) -- cycle;
}}]
\path (0,0) pic{speedometer=45}
(0,-5) pic{speedometer=80}
(0,-10) pic{speedometer=160};
\end{tikzpicture}
\end{document}
An arguably more fancy version thereof is obtained when making the color transitions smooth. To this end we need to rotate and flip the color wheel that comes with the shadings
library. This can be done using transform canvas
, which has some side-effect, which is why the results get stored in a \savebox
and then reused.
\documentclass[tikz,border=7pt]{standalone}
\usetikzlibrary{decorations.text,shadings}
\newsavebox\ColorWheelRotated
\sbox\ColorWheelRotated{\begin{tikzpicture}
\clip (180:4) arc(180:0:4) -- (3,0) arc(0:180:3);
\shade[shading=color wheel,transform canvas={
rotate=-65,xscale=-1}] (0,0) circle [radius=4];
\end{tikzpicture}}
\begin{document}
\begin{tikzpicture}[pics/speedometer/.style={code={
\path (0,0) node[above,inner sep=0pt] {\usebox\ColorWheelRotated};
\foreach \X/\Y [count=\Z] in {green!70!black/low,orange/medium,red/high}
{
\path [decorate, decoration={text along path,
text={|\color{white}\Huge\sffamily\bfseries|\Y}, text align=center}]
(240-\Z*60:3.2) arc(240-\Z*60:180-\Z*60:3.25);}
\fill (180-#1+8:0.3) arc (180-#1+8:180-#1+344:0.3) -- (180-#1-0.5:3.25)
-- (180-#1+0.5:3.25) -- cycle;
}}]
\path (0,0) pic{speedometer=45}
(0,-5) pic{speedometer=80}
(0,-10) pic{speedometer=160};
\end{tikzpicture}
\end{document}
In order to make this symbols you may want to kick out the texts.
\documentclass[a4paper,12pt]{article}
\usepackage{awesomebox}
\usepackage{lipsum}
\usepackage{tikz}
\tikzset{pics/speedometer/.style={code={
\foreach \X/\Y [count=\Z] in {green!70!black/low,orange/medium,red/high}
{\fill[fill=\X] (240-\Z*60:4) arc(240-\Z*60:180-\Z*60:4) --
(180-\Z*60:3) arc(180-\Z*60:240-\Z*60:3) -- cycle;}
\fill (180-#1+8:0.3) arc (180-#1+8:180-#1+344:0.3) -- (180-#1-0.5:3.25)
-- (180-#1+0.5:3.25) -- cycle;
}}}
\newsavebox\LowSpeed
\newsavebox\MediumSpeed
\newsavebox\HighSpeed
\sbox\LowSpeed{\scalebox{0.1}{\tikz{\pic{speedometer=45};}}}
\sbox\MediumSpeed{\scalebox{0.1}{\tikz{\pic{speedometer=90};}}}
\sbox\HighSpeed{\scalebox{0.1}{\tikz{\pic{speedometer=135};}}}
\begin{document}
\awesomebox[violet]{2pt}{\usebox\LowSpeed}{violet}{\lipsum[4]}
\end{document}
Best Answer
You can use the
tikz
machinery.