2

I'm writing my CV. Let us consider the following MWE:

\documentclass[11 pt,oneside,a4paper,titlepage]{article}
\usepackage{multicol}
% advanced drawing
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{smartdiagram}
\usepackage{float}
\usepackage{array}
\usetikzlibrary{decorations.text}
\usetikzlibrary{fadings}
\usetikzlibrary{calc}
\usetikzlibrary{shapes.misc,positioning}
\usetikzlibrary{arrows}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{backgrounds} 
\usetikzlibrary{shadings}
\usetikzlibrary{calendar} 
\usetikzlibrary{er}
\usetikzlibrary{patterns}
\usetikzlibrary{shapes} 
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{decorations}
\usetikzlibrary{topaths}
\usepackage{graphicx}
% Skill bar
\newcommand\skillbar[1]{ 
    \begin{tikzpicture}
        \foreach [count=\i] \x/\y in {#1}{
            \draw[fill=black!30,black!30] (0,\i) rectangle (2,\i+0.15);
            \draw[fill=white,black](0,\i) rectangle (\y,\i+0.15);
            \node[above right] at (0,\i+0.2) {\x};
        }
    \end{tikzpicture}
}

\begin{document}

 % Programming Languages
        \section*{PROGRAMMING LANGUAGES}
        \vspace*{-0.5cm}
        \begin{multicols}{2}    
        \begin{itemize}
            \footnotesize

            \item  \textbf{Fortran 90} \skillbar{/0.5} 
            \item  \textbf{Matlab}  \skillbar{/1.5}
            \item  \textbf{\LaTeX}   \skillbar{/1.2} 
            \item  \textbf{C}   \skillbar{/1.2} 
         
        \end{itemize}
        \end{multicols}

\end{document}

figure

I need to horizontally align the skill bars in such a way they start at the same position, can you show how to do?

2 Answers 2

6

With use of ˛tabular˛instead of \itemize:

documentclass[11 pt,oneside,a4paper,titlepage]{article}

\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{calc}
% Skill bar
\newcommand\skillbar[1]{
    \begin{tikzpicture}
        \foreach [count=\i] \x/\y in {#1}{
            \draw[fill=black!30,black!30] (0,\i) rectangle (2,\i+0.15);
            \draw[fill=white,black](0,\i) rectangle (\y,\i+0.15);
            \node[above right] at (0,\i+0.2) {\x};
        }
    \end{tikzpicture}
}

\begin{document}

 % Programming Languages
 \section*{PROGRAMMING LANGUAGES}
 
        \begin{tabular}{>{\textbullet}c >{\bfseries}ll 
                        @{\qquad\qquad} 
                       >{\textbullet}c >{\bfseries}ll }
        & Fortran 90    & \skillbar{/0.5}   && \LaTeX    & \skillbar{/1.2}   \\
        & Matlab        & \skillbar{/1.5}   && C         & \skillbar{/1.2}
        \end{tabular}

\end{document}

enter image description here

Addedndum:
A wee bit simplified:

  • definition for \skillbar` command, which now consider grade of knowledge between 0 (zero, no knowledge) and 10 (excellent), and

specification of the table columns (merged are columns with bullets and language names):

\documentclass[11 pt,oneside,a4paper,titlepage]{article}
\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{calc}
% Skill bar
\newcommand\skillbar[1]{% grade from 0 to 10
    \tikz{\draw         (0,0) rectangle (2, 1.5ex);
          \fill[black]  (0,0) rectangle (2*#1/10, 1.5ex);
          }
                        }

\begin{document}
% Programming Languages
\section*{PROGRAMMING LANGUAGES}
        \begin{tabular}{>{\textbullet\bfseries\ }ll 
                        @{\qquad\qquad}
                        >{\textbullet\bfseries\ }ll }
        Fortran 90    & \skillbar{4}   & \LaTeX    & \skillbar{6}   \\
        Matlab        & \skillbar{7.5} & C         & \skillbar{6}
        \end{tabular}
\end{document}

enter image description here

3

Something like this?

enter image description here

\documentclass[11pt,oneside,a4paper,titlepage]{article}
\usepackage{multicol}
% advanced drawing
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{smartdiagram}
\usepackage{float}
\usepackage{array}
\usetikzlibrary{decorations.text}
\usetikzlibrary{fadings}
\usetikzlibrary{calc}
\usetikzlibrary{shapes.misc,positioning}
\usetikzlibrary{arrows}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{backgrounds} 
\usetikzlibrary{shadings}
\usetikzlibrary{calendar} 
\usetikzlibrary{er}
\usetikzlibrary{patterns}
\usetikzlibrary{shapes} 
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{decorations}
\usetikzlibrary{topaths}
\usepackage{graphicx}
% Skill bar
\newcommand\skillbar[1]{ 
    \begin{tikzpicture}
        \foreach [count=\i] \x/\y in {#1}{
            \draw[fill=black!30,black!30] (0,\i) rectangle (2,\i+0.15);
            \draw[fill=white,black](0,\i) rectangle (\y,\i+0.15);
            \node[above right] at (0,\i+0.2) {\x};
        }
    \end{tikzpicture}
}

% new:
\usepackage{calc} % for '\widthof' macro
\newcommand\mybox[2]{\parbox[l]{\widthof{\textbf{#2}}}{\textbf{#1}}}

\begin{document}

 % Programming Languages
        \section*{PROGRAMMING LANGUAGES}
        \vspace*{-0.5cm}
        \begin{multicols}{2}
        \footnotesize  
        \begin{itemize}
            \item  \textbf{Fortran 90}        \skillbar{/0.5} 
            \item  \mybox{Matlab}{Fortran 90} \skillbar{/1.5}
            \item  \textbf{\LaTeX}   \skillbar{/1.2} 
            \item  \mybox{C}{\LaTeX} \skillbar{/1.2}   
        \end{itemize}
        \end{multicols}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .