I need in-line pills like the ones Bootstrap has: https://getbootstrap.com/docs/4.0/components/badge/
How do I go about achieving this in LaTeX/XeTeX?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI need in-line pills like the ones Bootstrap has: https://getbootstrap.com/docs/4.0/components/badge/
How do I go about achieving this in LaTeX/XeTeX?
One possibility with the tcolorbox
package:
\documentclass{article}
\usepackage[most]{tcolorbox}
\newtcbox{\badge}[1][red]{
on line,
arc=2pt,
colback=#1!50!black,
colframe=#1!50!black,
fontupper=\color{white},
boxrule=1pt,
boxsep=0pt,
left=6pt,
right=6pt,
top=2pt,
bottom=2pt
}
\begin{document}
test \badge{test} test \badge[blue]{test}
\end{document}
y
or g
characeter), set fontupper=\strut\color{white}
: tex.stackexchange.com/a/418770/100323