I just had a thought. Quite commonly when I define a figure graphics I write something like:
\begin{figure}[btp]
\centering
\includegraphics[width=0.95\textwidth]
{example.png}
\caption{foo bar buzz}
\end{figure}
But today, it struck me, that I can do:
\begin{figure}[btp]
\centering
\includegraphics[width=0.95\textwidth plus 0.05\textwidth minus 0.05\textwidth]
{example.png}
\caption{foo bar buzz}
\end{figure}
Why has noone told me about this before? 🙂
And more importantly, are there any good reasons not to do this?
EDIT: Just to clarify, my thought was that this would be used to avoid widows and orphans. But maybe that doesn't even work?
Best Answer
Nobody told you because, simply, you can't do it.
This runs without error:
but this is not a sign that it does something according to your wish. Indeed, it's sufficient to look at the output:
Your code
makes TeX stop with
that's due to some
\csname
construction that finds\textwidth
before\endcsname
and this token is illegal in that context.What's the problem? The length you specify for
width
is used to set the width of a box and a box has a fixed width. Rubber lengths are used for specifying glue that can shrink or stretch.