答案1
或多或少:
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\newtcbox{mytag}{size=small, sharp corners, fontupper=\sffamily, colback=blue!20, colframe=blue!20, colupper=blue, nobeforeafter}
\begin{document}
\mytag{ux} \mytag{segurança} \mytag{senhas}
\end{document}
更新:
我已经包含了用 HTML 模型(十六进制)定义的颜色、圆角(尽管原始示例显示它们很尖锐)以及before upper
强制所有标签具有相似高度和深度的选项。
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\definecolor{myback}{HTML}{ADA8F6}
\definecolor{mytext}{HTML}{858585}
\newtcbox{mytag}{%
size=small,
fontupper=\sffamily,
colback=myback,
colframe=myback,
colupper=mytext,
nobeforeafter,
before upper=\vphantom{Ähgy}}
\begin{document}
\mytag{ux} \mytag{segurança} \mytag{senhas}
\end{document}
答案2
同样仅使用 TikZ:
\documentclass{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\definecolor{mybluea}{HTML}{87CEEB}
\definecolor{myblueb}{HTML}{0000FF}
\newcommand{\mytag}[1]{\tikz{\node[rounded corners, text height=1.5ex, text depth=.25ex, fill=mybluea, draw=myblueb, text=myblueb] {#1};}}
\begin{document}
\mytag{ux} \mytag{segurança} \mytag{senhas}
\end{document}