Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

When highlighting text using Style and Background, as in Style["Test ", White, Background -> Lighter@Blue] is there a way to pad (ie, enlarge) the bounding box?

The bottom of the background seems coincident with the base of the text: here

share|improve this question

2 Answers 2

up vote 3 down vote accepted
Style[Pane[" Test "], White, Background -> Lighter@Blue]

enter image description here


Controlling the padding:

Style[Pane[" Test ", ImageMargins -> 10], White,  Background -> Lighter@Blue]
share|improve this answer
Ok that works. But is there no way to parametrically control size? (Other than rendering an independent Rectangle) – alancalvitti Jul 21 '12 at 19:22
@alancalvitti Add that request to the question. I tried to answer it in its current state – belisarius has settled Jul 21 '12 at 19:23
@alancalvitti See edit – belisarius has settled Jul 21 '12 at 19:25

You could play with the FrameMargins ...

Framed[Style["Test", White], FrameStyle -> None, FrameMargins -> 2, 
 Background -> Lighter@Blue] 


share|improve this answer
Thank you, so Framed it is. – alancalvitti Jul 21 '12 at 19:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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