Skip to content

Instantly share code, notes, and snippets.

@pscheid92
Created January 24, 2019 10:06
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pscheid92/bd1199828b34370a23e1bd01fba1e10d to your computer and use it in GitHub Desktop.
Save pscheid92/bd1199828b34370a23e1bd01fba1e10d to your computer and use it in GitHub Desktop.
Skill Grading Dots code snippet for LaTeX
%
% 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