Created
January 24, 2019 10:06
-
-
Save pscheid92/bd1199828b34370a23e1bd01fba1e10d to your computer and use it in GitHub Desktop.
Skill Grading Dots code snippet for LaTeX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% | |
% As found on StackOverflow: | |
% https://tex.stackexchange.com/questions/238898/in-line-graphics-in-text-to-represent-a-loading-bar-for-language-skills-in-a-cv | |
% | |
\documentclass{report} | |
\usepackage{tikz} | |
\definecolor{frontColor}{rgb}{0.22,0.45,0.70} % light blue | |
\definecolor{backColor}{RGB}{200,200,200} % grey | |
\newcommand{\grade}[1]{% | |
\begin{tikzpicture} | |
\clip (1em-.4em,-.35em) rectangle (5em +.5em ,1em); | |
\foreach \x in {1,2,...,5}{ | |
\path[{fill=backColor}] (\x em,0) circle (.35em); | |
} | |
\begin{scope} | |
\clip (1em-.4em,-.35em) rectangle (#1em +.5em ,1em); | |
\foreach \x in {1,2,...,5}{ | |
\path[{fill=frontColor}] (\x em,0) circle (.35em); | |
} | |
\end{scope} | |
\end{tikzpicture}% | |
} | |
\begin{document} | |
\begin{tabular}{ll} | |
Danish: & \grade{5} \\ | |
English:& \grade{4.5} \\ | |
German: & \grade{3.5} \\ | |
French: & \grade{0} | |
\end{tabular} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment