答案1
这是必须的蒂克兹解决方案,包装在itemize
使用创建的自定义环境中枚举项. 最终结果是使用以下行
\begin{achievements}
\item[57]\textbf{Personality}\\Leadership, innovation
\item[16]\textbf{Organisation}\\blah
\end{achievements}
您可以生产:
当然,您可以根据自己的喜好自定义颜色!
完整代码如下:
\documentclass[svgnames]{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{siunitx}% only to force percentages to be integers
\usepackage{enumitem}
\let\realItem\item% save for later use
\newcommand\percentageItem[1][10]{%
\realItem[\smash{\tikz[baseline]{%
\node[minimum width=4em] at (0,0) {\num[round-mode=places,round-precision=0]{#1}\%};
\draw[thick,line width=1.5mm,Blue](90:5mm)
arc [radius=5mm, start angle=90, delta angle=-#1*3.6];
\draw[thick,line width=1.5mm,LightSteelBlue](90-#1*3.6:5mm)
arc [radius=5mm, start angle=90-#1*3.6, end angle=-270];
}}]%
}
\newlist{achievements}{itemize}{1}
\setlist[achievements]{
before=\let\item\percentageItem,%make \item = \percentageItem
leftmargin=*,
label={},
itemsep=3mm,
}
\begin{document}
\begin{achievements}
\item[57]\textbf{Personality}\\Leadership, innovation
\item[16]\textbf{Organisation}\\blah
\end{achievements}
\end{document}
答案2
使用 ConTeXt MKIV 和 MetaFun。
\noheaderandfooterlines
\startuseMPgraphic{circle}{percent}
interim linecap := butt;
pen thick;
thick := pencircle scaled 2pt ;
path p, q;
p := reverse (fullcircle scaled (2.5*BodyFontSize) rotated 90);
q := (p cutafter point (arctime \MPvar{percent}/100*(arclength p) of p) of p);
draw p withcolor \MPcolor{gray} withpen thick;
draw q withpen thick;
label("\MPvar{percent}\%", origin);
\stopuseMPgraphic
\setupxtable[skills][frame=off,columndistance=1em]
\setupxtable[skill:head][foregroundstyle=bold]
\setupxtable[skill:list][foregroundcolor=darkgray]
\starttext
\startxtable[skills]
\NC[ny=2] \useMPgraphic{circle}{percent=57} \NC[skill:head] Personality \NR
\NC[skill:list] Lazy \NR
\NC[ny=2] \useMPgraphic{circle}{percent=62} \NC[skill:head] Personality \NR
\NC[skill:list] Lazy \NR
\NC[ny=2] \useMPgraphic{circle}{percent=10} \NC[skill:head] Personality \NR
\NC[skill:list] Lazy \NR
\NC[ny=2] \useMPgraphic{circle}{percent=23} \NC[skill:head] Personality \NR
\NC[skill:list] Lazy \NR
\stopxtable
\stoptext