13

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

6
  • Are you asking for automated features/parameters to increase border width, or are you asking for different line styles/thicknesses etc. around the box? 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. Mar 6 '13 at 14:52
  • 2
    @Steven: In my opinion, it's quite clear from the image that the OP wants to keep the equation the same size. Mar 6 '13 at 14:56
  • 1
    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). Mar 6 '13 at 19:49
18

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

\setlength\fboxsep{...}

to set the padding inside the box and

\setlength\fboxrule{...}

to set the line thickness.

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.