答案1
简单的基本代码
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node [anchor=west] at (.1,.8) {Java};
\draw [fill=gray] (0,0) rectangle (5,.5);
\draw [fill={rgb:red,1;green,2;blue,3}] (0,0) rectangle (.1,.5);
\end{tikzpicture}
\vspace{.05cm}
\begin{tikzpicture}
\node [anchor=west] at (.1,.8) {polite};
\draw [fill=gray] (0,0) rectangle (5,.5);
\draw [fill={rgb:red,1;green,2;blue,3}] (0,0) rectangle (3.5,.5);
\end{tikzpicture}
\vspace{.05cm}
\begin{tikzpicture}
\node [anchor=west] at (.1,.8) {outgoing};
\draw [fill=gray] (0,0) rectangle (5,.5);
\draw [fill={rgb:red,1;green,2;blue,3}] (0,0) rectangle (4,.5);
\end{tikzpicture}
\vspace{.05cm}
\begin{tikzpicture}
\node [anchor=west] at (.1,.8) {good manners};
\draw [fill=gray] (0,0) rectangle (5,.5);
\draw [fill={rgb:red,1;green,2;blue,3}] (0,0) rectangle (3.5,.5);
\end{tikzpicture}
\vspace{.05cm}
\begin{tikzpicture}
\node [anchor=west] at (.1,.8) {pursuer of rabbits};
\draw [fill=gray] (0,0) rectangle (5,.5);
\draw [fill={rgb:red,1;green,2;blue,3}] (0,0) rectangle (4.8,.5);
\end{tikzpicture}
\end{document}
答案2
我知道已经晚了,但这是我从中提取的代码例子截图位置:
\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{{b/2}}
\skills{{a/1}}
\end{document}