Consider the following example:
\documentclass[a4paper,11pt]{article}
\usepackage{showframe}
\begin{document}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua.
\hfill
\fbox{At vero eos et accusam et justo duo dolores et ea rebum. Sed non arcu.}
\end{document}
The problem is that the contents of the \fbox
does not fit on the line it is typeset and produces an overfull \hbox
.
The question is: how to define a command that automatically puts the \fbox
on the next line if an Overfull \hbox
is generated?