latex - 使用 Latex 创建 Wifi 信号条
问题描述
有谁知道如何用 Latex 创建以下图标(我猜是 tikz)
有了一些newcommand
,我可以在 tex 文档中选择要从 0 到 4 填充的条。
类似于他们在此处定义的命令:文本中的内嵌图形表示 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}
推荐阅读
- angular - PrimeNG 列表框,所有项目都在单击之前被选中。使用 [multiple]="true" 时,列表显示为选中状态
- angular - ./node_modules/rxjs/_esm5/operators/index.js Angular 6 ng build --prod of / Resolve 中的错误
- c# - ef core 2.1 中的 COUNT(DISTINCT *)
- javascript - OpenShift Node.js WebSocket 服务器连接问题
- lua - 在roblox中将纹理映射到2个三角形
- wpf - 如何将 Listview 绑定到 WCF 服务中的可观察集合?
- apache - 有什么方法可以更改 apache httpd 配置中的响应状态代码
- c# - C# SSIS 脚本组件格式输入日期行到“MMddyyyy”
- android - 屏幕锁定时出现通知时播放视频
- ldap - 如何使用 Grafana 和 Wamp 的 LDAP 身份验证进行单点登录?