# Knowledge indicators

I'm writing my CV with LaTeX and I would like to add knowledge indicators next to my skills. I'm looking for a package that can display a "vertical stack". Something like:

• German ≡
• English =
• Chinese -

The symbols should be aligned to the bottom and it would be great if there were two colors. So it would always be three bars but depending on the skill level one, two or three bars would be of the second color.

• Package stackengine by our member Steven B. Segletes might help
– user31729
Jan 23, 2015 at 20:54
• Or the all-purpose if you don't know any better, use TikZ-approach. Jan 23, 2015 at 20:54
• One thing to consider with the request for colors: What happens when the CV is inevitably printed/copied in greyscale? Jan 23, 2015 at 21:30
• Or in other words, as fancy and nice this may look at first glance, there are drawbacks. I hope you don't get on of the HR persons that will feel offended by pictograms for illiterate. exaggerated to make a point Jan 23, 2015 at 21:38
• Since, according to your profile, you seem to live in Europe, you should also consider using the Common Reference Levels (A1...C2) for languages (en.wikipedia.org/wiki/…).
– MaxD
Jan 23, 2015 at 22:29

Just for fun, with picture mode:

\documentclass{article}
\usepackage{xcolor}

\newcommand{\skill}[1][3]{%
\setlength{\unitlength}{1ex}%
\begin{picture}(1,1.8)
\linethickness{0.3ex}%
\textcolor{gray!15}{\multiput(0, 0.15)(0, 0.6){3}{\line(1,0){1}}}
\multiput(0, 0.15)(0, 0.6){#1}{\line(1,0){1}}
\end{picture}%
}

\begin{document}
\begin{itemize}
\item German \skill[3]
\item English \skill[2]
\item Chinese \skill[1]
\item Default \skill
\end{itemize}
Testing \skill[1], winning \skill[2], and excellence \skill[3].
\end{document}


• This looks very simple and elegant. I have one problem: There is a whitespace after the indicator. Let's say I have German\skill[2], English it would show as German = , English instead of German =, English. Is there any way to fix this? Jan 23, 2015 at 23:04
• Yep, an easy fix to account for inline usage. Updating now. :-) Jan 23, 2015 at 23:08

Building on A.Ellet's answer to produce something as required (three rectangles always in each group; green ones will show the skill level):

The code:

\documentclass{article}
\usepackage{tikz}

\definecolor{colori}{RGB}{249,193,158}
\definecolor{colorii}{RGB}{158,214,149}

\newcommand\skilllevel[1]{%%
\begin{tikzpicture}
\foreach \Val in {1,2,3}
{
\node[fill=colori,inner ysep=0pt]
at ([yshift=2*\Val]0,\Val pt) {};
}
\foreach \Val in {1,...,#1}
{
\node[fill=colorii,inner ysep=0pt]
at ([yshift=2*\Val]0,\Val pt) {};
}
\end{tikzpicture}%
}

\makeatother

\begin{document}

\noindent\begin{tabular}{lc}
German  &  \skilllevel{2}    \\
Latin  &  \skilllevel{1}     \\
Japanese  &  \skilllevel{3}  \\
\end{tabular}

\end{document}


Perhaps the following modification is less confusing (see Andrew Cashner's comment):

\documentclass{article}
\usepackage{tikz}

\definecolor{colori}{RGB}{249,193,158}
\definecolor{colorii}{RGB}{158,214,149}

\newcommand\skilllevel[1]{%%
\begin{tikzpicture}
\foreach \Val in {1,2,3}
{
\node[draw,fill=white,inner ysep=1pt]
at ([yshift=2*\Val]0,\Val pt) {};
}
\foreach \Val in {1,...,#1}
{
\node[draw,fill=colorii,inner ysep=1pt]
at ([yshift=2*\Val]0,\Val pt) {};
}
\end{tikzpicture}%
}

\begin{document}

\noindent\begin{tabular}{lc}
German  &  \skilllevel{2}    \\
Latin  &  \skilllevel{1}     \\
Japanese  &  \skilllevel{3}  \\
\end{tabular}

\end{document}


• You've done what the OP asked, but if I was an employer looking this, I would be confused whether the one with two green bars on the bottom was better than the one with two green bars on top. Jan 23, 2015 at 21:28
• @AndrewCashner Agreed. I added a new code with a simple modification that I think is less confusing. Jan 23, 2015 at 21:38

With stacks. I have chosen to keep the answer within the confines of normal line spacing, but that can be changed by invoking \setstackgap{L}{desired-baselineskip}. The bar thicknesses (1pt) and widths (1ex) are set within the \rl and \rlf definitions (as well as the colors). The vertical space between bars is set with \setstackgap{S}{1.5pt} and the gap between the words and the bars is set via \setstacktabbedgap{1ex}.

\documentclass{article}
\usepackage{tabstackengine,xcolor}
\def\rl{\textcolor{red}{\protect\rule{1ex}{1pt}}}
\def\rlf{\textcolor{red!15}{\protect\rule{1ex}{1pt}}}
\newcommand\level[1]{%
\if 1#1\stackon{\stackon{\rl}{\rlf}}{\rlf}\else
\if 2#1\stackon{\stackon{\rl}{\rl}}{\rlf}\else
\if 3#1\stackon{\stackon{\rl}{\rl}}{\rl}\else
\fi\fi\fi
}
\begin{document}
\renewcommand\stackalignment{l}
\setstackgap{S}{1.5pt}
\setstacktabbedgap{1ex}
\tabbedLongstack{German&\level{3}\\Latin&\level{2}\\Japanese&\level{1}}
\end{document}


If one doesn't feel confortable with TABstacks, ordinary stacks can be used to achieve the same result by

\Longstack{German\\Latin\\Japanese}%
\hspace{1ex}%
\Longstack{\level{3}\\\level{2}\\\level{1}}

• The faded colors make the meaning of the bars clearer than the other examples. Jan 23, 2015 at 21:35

With the caveat that this might be hard to understand, here's a solution without graphical packages.

\documentclass{article}

\usepackage{xcolor}

\colorlet{know}{green!60}
\colorlet{dontknow}{red!60}

\newcommand{\knowledge}[1]{%
\ifcase#1\relax\or
\knowone\or
\knowtwo\or
\knowthree\fi
}

\newcommand{\knowone}{\know{know}{dontknow}{dontknow}}
\newcommand{\knowtwo}{\know{know}{know}{dontknow}}
\newcommand{\knowthree}{\know{know}{know}{know}}
\newcommand{\knowrule}[1]{%
\makebox[0pt][l]{%
\textcolor{#1}{\rule{\knowwd}{1pt}}%
}%
}

\newcommand{\know}[3]{%
\makebox[\knowwd][l]{%
\knowrule{#1}%
\raisebox{0.5ex}{\knowrule{#2}}%
\raisebox{1ex}{\knowrule{#3}}%
}%
}

\begin{document}

\noindent
\begin{tabular}{ll}
German   & \knowledge{2} \\
Latin    & \knowledge{1} \\
Japanese & \knowledge{3}
\end{tabular}

\end{document}


Several macros, but each one does a different task.

• Red and green is usually really bad to use... (colorblind). Feb 4, 2015 at 19:04
• @PerAlexandersson Tell to those who produce traffic lights. ;-). The advantage here is that colors are easily changeable. Feb 4, 2015 at 20:27
• Traffic lights has a blue component in the green light, making it easy for colorblinds to see the difference. Also, the green light is always at the bottom. Feb 4, 2015 at 20:54
• @PerAlexandersson Right, but my answer started “With the caveat that this might be hard to understand”… Feb 4, 2015 at 21:09

You could use tikz for something like:

\documentclass{article}
\usepackage{tikz}

\makeatletter

\newcommand\skilllevel[1]{%%
\def\ae@color{\ifcase#1\or
red\or
orange\else
blue\fi}%%
\tikz \node[draw,fill,rectangle,minimum height=#1em,\ae@color] (A) {};}

\makeatother

\begin{document}

\begin{tabular}{lc}
German  &  \skilllevel{2}    \\
Latin  &  \skilllevel{1}     \\
Japanese  &  \skilllevel{3}  \\
\end{tabular}

\end{document}


Here's a similar approach, but with bars:

\documentclass{article}
\usepackage{tikz}

\makeatletter

\newcommand\skilllevel[1]{%%
\def\ae@color{\ifcase#1\or
red\or
orange\else
blue\fi}%%
\rule{0pt}{3ex}%%
\begin{tikzpicture}
\foreach \myn in {1,...,#1}
{
\typeout{==>\myn}%%
\node[fill,rectangle,inner sep=0pt,
minimum height=0.75ex,
minimum width=1em,\ae@color] (A\myn) at (0,\myn ex) {};
}
\end{tikzpicture}}

\makeatother

\begin{document}

\begin{tabular}{lc}
German  &  \skilllevel{2}    \\
Latin  &  \skilllevel{1}     \\
Japanese  &  \skilllevel{3}  \\
\end{tabular}

\end{document}


This doesn't answer the question with its graphical approach, but might be useful for people who want to keep their CV as simple as possible.

\documentclass{article}
\begin{document}
\begin{tabular}{rl}
German   & native speaker \\
Latin    & intermediate \\
Japanese & working knowledge \\
\end{tabular}
\end{document}

• This is the approach I would recommend. Jan 23, 2015 at 21:29

This uses a text like approach, the alignment is the job of the resume/cv document. As long nothing else is specified, I used a rather rudimentary interface.

\documentclass{article}

\usepackage{xcolor}
\usepackage{stackengine}

\begin{document}

\setstackgap{S}{0.1pt}
\begin{itemize}
\item  German  {\color{red}\Shortstack{- - - -}}
\item  English {\color{red}\Shortstack{- - - }}
\item  Chinese {\color{red}\Shortstack{- - }}
\item  Klingon {\color{red}\Shortstack{- }}
\end{itemize}

\end{document}


• \_ would be better. I change tomorrow
– user31729
Jan 23, 2015 at 21:19

Draw \rules and color them with xcolor. The only issue is getting them to stack, which you can do with \kern.

\documentclass{article}
\usepackage{xcolor}

\newcommand{\skillbar}{%
\rule{1em}{1pt}%
}
\newcommand{\basic}{%
\textcolor{violet}{\skillbar}%
}
\newcommand{\intermediate}{%
\basic%
\kern -1em%
\raisebox{3pt}{%
\textcolor{blue}{\skillbar}%
}%
}
\intermediate%
\kern -1em%
\raisebox{6pt}{%
\textcolor{cyan}{\skillbar}%
}%
}

\begin{document}

\section{Language Skills}

\begin{tabular}{ll}

• You beat me to it! :-) you can also use \rlap/\llap for the stacking. Jan 23, 2015 at 21:20