[Tex/LaTex] edit the minimum length of \hfill

boxesmacros

Once again I have a pretty special problem: I'd like to edit the minimum length of \hfill. According to de.wikibooks it is a TeX primitive. Therefore, I assume, that it can't be edited.

What is it for? I want to squeeze several boxes into one \textwidth no matter what. It should be similar to \mbox{}, but not broader than the textwidth.

There is a possibility the make this by counting the boxes and use \hspace with a (maybe) negative value which is calculated by the number of boxes. But this would be pretty complicated and requires an aux-file.

MnWE for explanation:

%This box should not be wider than \textwidth. It must be squeezed to \textwidth
\mbox[\textwidth]{ %There is no such instruction \mbox[width]{content}
\parbox{0.5\textwidth}{some Text}
\hfill
\parbox{0.5\textwidth}{some Text}
\hfill
\parbox{0.5\textwidth}{some Text}
}
%to fit, hfill must be -0.25\textwith, but it refuses to get negative, so this box will be wider than the text area.

Best Answer

\hss "horizontal shrink/stretch" will shrink to negative sizes if needed or stretch as much as needed, as requested in comments.

\documentclass{article}


\begin{document}

\begin{flushleft}
\makebox[\textwidth][s]{%%%%
\parbox{0.5\textwidth}{some Text}%%%%
\hss
\parbox{0.5\textwidth}{some Text}%%%%
\hss
\parbox{0.5\textwidth}{some Text}%%%%
}
\end{flushleft}

\end{document}