# Rounded boxes around text

I have following problem. I want to create rounded boxes around my text, so far I have:

\tikz[baseline=(char.base)]\node[anchor=north west, draw,rectangle, rounded corners, inner sep=1.6pt, minimum size=5.5mm, text height=3.6mm, fill=#2,#2,text=white](char){#1};\phantom{#1};%}


and it gives me:

Which is quite good, but I would also like to extend boxes (I think it's written too tight) like 2mm each side. Ideas?

• you can use inner xsep = 2mm – percusse Apr 17 '18 at 10:16

With tcolorbox

\documentclass{article}
\usepackage[most]{tcolorbox}

\newtcbox{\mybox}[1][red]{on line,
colback=#1, colframe=#1, boxsep=0pt, boxrule=0pt, size=small, arc=1mm}
\begin{document}
\mybox{This is some} \mybox[blue!30]{text with} \mybox[green!70]{rounded corners}
\end{document}


With fancybox

\documentclass[12pt]{article}
\usepackage{fancybox}
\begin{document}

\ovalbox{one box}

\Ovalbox{another box}

\end{document}