[Tex/LaTex] Add small graph chart to indicate the skill level in a resume

graphicstikz-pgf

I have taken the solution of In-line graphics in the text to represent a loading bar for language skills in a CV and adapted to my current resume. Although I only use three levels and I like the result, it still consumes a lot of space.

So, I want to put a small graph chart next to the skills, like this:

enter image description here

Could you help me to create a command to do that?

Best Answer

Here tikz is overkill. The bar graph can be realized with \rule. The xcolor package is needed to get the lighter color. The command \skillevel adapts automatically to the current font height (with \settoheight) and the current color. The argument is the number of bars with the current text color. The optional argument can be used change how much the color is lightened (0 - 100, the smaller number, the lighter the color).

\documentclass[10pt,a4paper]{article}
\usepackage{xcolor}

\newdimen\slheight
\newcommand{\skillevel}[2][20]{%
  \begingroup
  \settoheight{\slheight}{M}%
  \ifnum#2=0\color{.!#1}\fi
  \rule{.1em}{.33333\slheight}\hspace{.1em}%
  \ifnum#2=1\color{.!#1}\fi
  \rule{.1em}{.66667\slheight}\hspace{.1em}%
  \ifnum#2=2\color{.!#1}\fi
  \rule{.1em}{\slheight}%
  \endgroup
}

\begin{document}
\textcolor{blue}{\textsf{\tiny\skillevel{0} \LaTeX}}
\textcolor{red}{\textsf{\skillevel{1} \LaTeX}}
\textcolor{teal}{\textsf{\skillevel{2} \LaTeX}}
\textcolor{green}{\textsf{\Large\skillevel{3} \LaTeX}}
\textcolor{cyan}{\textsf{\Huge\skillevel{2} \LaTeX}}
\end{document}

enter image description here

Related Question