[texhax] Space factor as dimen?
Joel C. Salomon
joelcsalomon at gmail.com
Tue Jun 23 23:51:43 CEST 2009
Donald Arseneau wrote:
>> I found the word I needed---space factor. To rephrase the question
>> above: can I supply a space factor to a macro expecting a dimen?
>
> No.
>
> You probably have to do something like
>
> \newlength\myspc
> \settowidth\myspc{\spacefactor3000{ }}
>
> and then use \myspc as the dimension argument. That won't track
> font size changes though.
I found most of what I was looking for, except for the bit doesn’t work:
\newlength{\issp} % default inter-sentence space
\setlength{\issp}{\fontdimen2\font} % inter-word space
\addtolength{\issp}{\fontdimen7\font} % extra space
\newlength{\isst} % inter-sentence stretch
\setlength{\isst}{\fontdimen3\font} % inter-word stretch
\multiply\isst3 % mimic \spacefactor 3000
\newlength{\issh} % inter-sentence shrink
\setlength{\issh}{\fontdimen4\font} % inter-word shrink
\divide\isst3 % mimic \spacefactor 3000
\newlength{\intersentencespace}
%\setlength{\intersentencespace}{\issp plus \isst minus \issh}
The funny thing is, this /does/ work:
\newlength{\iwp}
\setlength{\iwp}{\fontdimen2\font %
plus \fontdimen3\font minus \fontdimen4\font}
(In fact I could see the difference between using ‘{\iwp}’ as an
argument to \newtheoremstyle and using ‘{ }’, because the stretch was
applied.)
How can I set a rubber length the way I’m trying to?
—Joel Salomon
More information about the texhax
mailing list