I’m using both \fbox
and \boxed
but for different uses. When I use \fbox
, I need it to have \fboxsep
set to -0.5pt
, but when I used \boxed
I want a \fboxsep
of 2pt
.
Is there a way to do that?
EDIT: As I was asked for my usage, I defined this in my preamble
\setlength\fboxrule{0.5pt}
\setlength\fboxsep{-0.5pt}
\newcommand{\schema}[1]{\fbox{\includegraphics[width=\linewidth]{#1}}}
This is in order to include schemes drawn on a white background in a colored background area (typically one from tcolorbox
) and have them neatly separated by a thin black margin.
OTOH, I used \boxed
around all types of mathematical formulas.
\myboxxed as {\setlength\fboxsep{2pt}\boxed{#1}}
Overfull \hbox
instead, because I use\fbox
around figures that are\linewidth
wide. See my above edit.\noindent\fbox{\gincludegraphics[width=\dimexpr\linewidth-2\fboxsep-2\fboxrule]{...}}
???