【发布时间】:2021-02-10 05:47:42
【问题描述】:
有谁知道如何用 Latex 创建以下图标(我猜是 tikz)
有了一些newcommand,我可以选择 tex 文档中从 0 到 4 填充的条形。
类似于他们在这里定义的命令:In-line graphics in text to represent a loading bar for language skills in a CV,但不是用圆圈绘制这个 wifi 条。
谢谢!
【问题讨论】:
有谁知道如何用 Latex 创建以下图标(我猜是 tikz)
有了一些newcommand,我可以选择 tex 文档中从 0 到 4 填充的条形。
类似于他们在这里定义的命令:In-line graphics in text to represent a loading bar for language skills in a CV,但不是用圆圈绘制这个 wifi 条。
谢谢!
【问题讨论】:
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\newcommand{\wifi}[1][4]{%
\colorlet{col1}{gray}%
\colorlet{col2}{gray}%
\colorlet{col3}{gray}%
\colorlet{col4}{gray}%
\ifnum0<#1
\colorlet{col1}{green}%
\fi%
\ifnum1<#1
\colorlet{col2}{green}%
\fi%
\ifnum2<#1
\colorlet{col3}{green}%
\fi%
\ifnum3<#1
\colorlet{col4}{green}%
\fi%
\begin{tikzpicture}[rounded corners=0.05ex]
\fill[col1] (0ex,0ex) rectangle ++(0.5ex,0.9ex);
\fill[col2] (0.7ex,0ex) rectangle ++(0.5ex,1.05ex);
\fill[col3] (1.4ex,0ex) rectangle ++(0.5ex,1.20ex);
\fill[col4] (2.1ex,0ex) rectangle ++(0.5ex,1.35ex);
\end{tikzpicture}%
}
\begin{document}
test \wifi[0] \wifi[1] \wifi[2] \wifi[3] \wifi[4]
\Huge test \wifi
\end{document}
【讨论】: