1

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:

enter image description here

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

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

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}

enter image description here

2

With fancybox

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

\ovalbox{one box}

\Ovalbox{another box}

\end{document}

ovalbox

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.