1

For my CV I'd like to use some skillbars.

But since my layout is fixed I need to adjust the space between the entries.

Here is a MWE:

\documentclass{report}

\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{xcolor}

\definecolor{white}{RGB}{255,255,255}
\definecolor{gray}{HTML}{4D4D4D}
\definecolor{maingray}{HTML}{B9B9B9}

\newcommand\skills[1]{ 
    \begin{tikzpicture}
        \foreach [count=\i] \x/\y in {#1}{
            \draw[fill=maingray,maingray] (0,\i) rectangle (6,\i+0.4);
            \draw[fill=white,gray](0,\i) rectangle (\y,\i+0.4);
            \node[above right] at (0,\i+0.4) {\x};
        }
    \end{tikzpicture}
}

\begin{document}
\skills{{a/1},{b/2}}
\end{document}

How can I change the code to define/decrease the space between the two entries?

Someone
  • 329
  • 1
    May be you want to consider another version of skills command which can break between pages for large lists of skills: https://tex.stackexchange.com/q/416094/1952 – Ignasi Feb 20 '18 at 10:26

1 Answers1

1

enter image description here

you need to reduce size if \i for example with multiplying it by 0.8:

\documentclass{report}

\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{xcolor}

\definecolor{white}{RGB}{255,255,255}
\definecolor{gray}{HTML}{4D4D4D}
\definecolor{maingray}{HTML}{B9B9B9}

\newcommand\skills[1]{
    \begin{tikzpicture}
        \foreach [count=\j, evaluate={\i=\j*0.8}] \x/\y in {#1}{
            \draw[fill=maingray,maingray] (0,\i) rectangle +(6,0.4); % <---
            \draw[fill=white,gray](0,\i) rectangle +(\y,0.4);% <---
            \node[above right] at (0,\i+0.4) {\x};% <---
        }
    \end{tikzpicture}
}

\begin{document}
\skills{{a/1},{b/2}}
\end{document}
Zarko
  • 296,517