Is there a way to control the top and bottom spacing between the box and it content (text)? and secondary about left and right spacing? in other words i am looking for the analogous of \arraystretch
command in this case.
PS: here \parbox
is used to allow line breaking.
\documentclass{article}
\begin{document}
\fbox{\parbox{\linewidth}{Hello world test example break this line\\
here is a new line just for the example}}
\end{document}
Best Answer
By default,
\fbox
and the underlying\fr@meb@x
use a single length\fboxsep
for the separation of the box content from the box margin (and rule) -- This is easier of course and is also connected to the fact that in earlier times there weren't much length registers at hand just to squander them.I've stolen the code from
latex.ltx
and changed the settings, using\fboxhsep
and\fboxvsep
, at the right places, to provide a solution without any extra package.Of course, this
\fboxother
won't break over pages. For such thingstcolorbox
etc. is much easier.Update