# Remove stretch and shrink (glue) from existing length

Suppose I have a length \mylength, defined to be

\setlength{\mylength}{5pt plus 1pt minus 2pt}


I'd like to make \mylength a fixed length, but keep the default length. In this example, I'd like

\setlength{\mylength}{5pt}


But what if I didn't know the definition of \mylength? I know I can use \the\mylength to have it printed in the document, which I then can inspect, but I was wondering whether there is a simple way to strip out the glue of a length.

• If you use 1\mylength the stretch and shrink components are removed. Dec 3 '16 at 11:02
– Hugh
Dec 3 '16 at 11:03

If you use a factor in front of \mylength, the stretch and shrink components are discarded. With

\newlength{\lenA}
\newlength{\lenB}

\setlength{\lenA}{5pt plus 1pt minus 1pt}
\setlength{\lenB}{1\lenA}


the length \lenB will be set to 5pt.

If you just need to use \lenA without stretch and shrink components, the same holds:

\hspace{1\lenA}


will make a nonflexible space.