TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I currently use the \boxed{} command to place boxes around my equations. However, I would like to have more control of the style of the box. Is there a way to do this?

To take a specific example, the figure below shows both the standard \boxed{} out put (a) and the desired mock-up (b), where I have increased the box size and increased the border thickness slightly.

enter image description here

share|improve this question
Are you asking for automated features/parameters to increase border width, or are you asking for different line styles/thicknesses etc. around the box? – Steven B. Segletes Mar 6 '13 at 14:37
My main aim is to increase the box size. Anything else (line thickness, line style, line colour, etc.) would be a bonus. – User 17670 Mar 6 '13 at 14:44
You say increase box size. That might imply scaling the whole object to a larger size (see scalerel package) or your answer might imply keeping the equation the same size and adding border space. – Steven B. Segletes Mar 6 '13 at 14:52
@Steven: In my opinion, it's quite clear from the image that the OP wants to keep the equation the same size. – Hendrik Vogt Mar 6 '13 at 14:56
No one suggested the usual TikZ overkilling solution, so it's my turn; you may have a look to \boxed{}, TikZ and colored equation background and to hf-tikz doesn't box around equation (which shows some new option of the hf-tikz package). – Claudio Fiandrino Mar 6 '13 at 19:49
up vote 12 down vote accepted

Someone is going to suggest a tikz box with multicoloured translucent rounded corners, but before they do I'll observe that \boxed is a thin wrapper around \fbox so you can use


to set the padding inside the box and


to set the line thickness.

share|improve this answer

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.