This might be a silly question, but I can't seem to be able to find the answer anywhere: suppose I have this simple plain TeX code:
\newskip\myskip
\myskip = 10pt plus 4pt minus 2pt
Now, how can I access (read) those stretch and shrink parts, those 4pt and 2pt values?
After David's answer: this is what I wanted:
%%%! tex
\newskip\spaceskipFixed
% nonsensical values just for testing
\spaceskipFixed = 10pt plus 4pt minus 2pt
\spaceskip = \spaceskipFixed
% wrong, glue becomes dimen, stretchability and shrinkability gone
\def\modifyspaces #1 {%
\spaceskip = #1\spaceskipFixed
}
\def\text{Aha oho haha hoho!}
\newbox\gauge \setbox\gauge = \hbox{\modifyspaces .5 \text}
\def\showline #1#2{
\line{\hbox to\wd\gauge{#1\hfill}\hskip 2em {\spaceskip = 0pt\tt\% #2}\hfill}
}
\line{\text\hskip 2em{\spaceskip = 0pt\tt \% unmodified, wild spaces}\hfill}
\vbox to 0pt{\noindent\kern \wd\gauge\hbox{\vrule width .1pt height 0pt depth 15mm}\par\vskip -15mm}
\showline{\modifyspaces .5 \text}{simple text with modified spaces, width \the\wd\gauge}
\showline{\hbox to 92pt {\modifyspaces .5 \text}}{hbox to 92pt, no shrinkability => overfull}
% fixed
\def\modifyspaces #1 {%
\spaceskip = #1\spaceskipFixed plus #1\gluestretch\spaceskipFixed minus #1\glueshrink\spaceskipFixed
}
\showline{\hbox to 92pt {\modifyspaces .5 \text}}{hbox to 92pt, shrinkability preserved, all shiny}
\bye


\dividewould be cleanest for the above (0.5) case. – ShreevatsaR May 20 '17 at 01:27