4

I would like to add my language skills to my CV in the following manner:

Language skills as loading bars

I could of course create an image in Inkscape for every language, and put it in in a most straightforward way, maybe as described in: Micro-graphics inline in text

But from that thread it looks like it could be automated, so that one maybe could write \loadingbar{4.5,5} and get 4.5 filled circles out of five. Maybe also with some optional parameters for size or colors.

I know it reads a little bit like "solve this problem for me", but especially the part with colors I have no idea how to even approach, and also how to do loops in Latex properly. So if anyone wants to take it on as a challenge I would be more than happy :)

2

Works only for integer of semi integer values.

\documentclass{report}
\usepackage{tikz}
\newcommand{\grade}[1]{%
\begin{tikzpicture}
\clip (1em-.3em,-.3em) rectangle (5em +.5em ,.3em);
\begin{scope}
\clip (1em-.3em,-.3em) rectangle (#1em +.5em ,.3em);
\foreach \x in {1,2,...,5}{
 \path[fill=red] (\x em,0) circle (.25em);
}
\end{scope}
\foreach \x in {1,2,...,5}{
 \draw (\x em,0) circle (.25em);
}
\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}

enter image description here

  • Sorry that I disappeared, your solution is great! I tweaked it a little, but that was just design. Thanks a lot! – Maxim Moloshenko May 24 '15 at 15:09
0

... an adaption of @Sigur's solution.

\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}

enter image description here

  • Welcome to TeX.SX! This is not so much an adaption of Sigur's solution as a small enhancement to allow foreground and background colours. – Andrew May 25 '18 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.