Is it possible to write a command using TikZ to produce a small rounded and colored box around a piece of text, inside sentence? I know the \framedbox
command gives a rectangle around a piece of text (but not a rounded rectangle as far as I know).
I guess one could also adjust the color of the background when using framebox (using tips from answers to this question), but I don't think it could help with other factors such as the box's edge-width, the amount of roundness, etc.
The following picture was produced with Inkscape for the purpose of the question.
Best Answer
Either use
TikZ
directly ortcolorbox
with\tcbox
and a lot configurable settings.If such boxes should appear more than once, a
\newtcbox
is appropiate, setting the options there and just saying\inlinebox{foo}
etc.As can be seen from the direct usage of
\tcbox
that the margins are too wide, but the\inlinebox
has a nicer look, there the margins are set withleft=...
andright=...
andboxsep=...