This seems like such a simple problem but I cannot seem to find an answer mixed in all the questions about drawing boxes.
I want to be able to draw a bounding, not a frame, but a bounding box. One with zero extra size around any object: a minipage, a paragraph, a tikz picture, a figure, a table, whatever.
For the purposes of illustrating how large something is on the page I want to encapsulate it a box. This means that adding the bounding box to the page must not change any of the page layout.
I of course expect these boxes to be ugly, their only purpose is for drafting needs to measure distances, similar to the showframe
option for \geometry
.
If my understanding about TeX is correct, everything ever drawn on a page is a box. Is there a way to simply draw this box?
EDIT-----------------------------------------------------------------
I have added a minimum working example depicting the problems with the (at the time of 1:53pm) suggestions so far.
\documentclass[fontsize=12pt,twoside=false,]{scrbook}
\usepackage{babel}
\usepackage{listings}
\usepackage{geometry}
\usepackage{parskip}
\usepackage{lipsum} % Just for the MWE
\begin{document}
%Phelype Oleiniks Suggestion
\fboxsep=0pt \fboxrule=1sp
%This doesnt work
\fbox{\lipsum[1]}
%This doesnt work either
\fbox{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum
ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu
libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue
eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada
fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla
et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor
gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc.
Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla,
malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec
varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis,
diam. Duis eget orci sit amet orci dignissim rutru}
%Putting it inside a minipage works for unknown reasons.
\fbox{\begin{minipage}[t]{\linewidth}%
\lipsum[1]%
\end{minipage}}
%demonstration of poor baseline with \frame{}
Oh how \fbox{Frustrating!}!
Oh how \frame{Frustrating!}!
%this even breaks the compiler
% \fbox{\begin{lstlisting}
% Here is some code
% More code = 4;
% \end{lstlisting}}
\end{document}
\frame{...}
.\fboxsep=0pt \fboxrule=1sp
and then use\fbox
.