1

In this MWE:

\documentclass{article}

\begin{document}

\dimen1=10pt
\multiply\dimen1 by 20pt
\rule{\dimen1}{10pt}

\end{document}

I multiply 10pt with 20pt, expecting a value of 200pt (which is also the case as shown by the resulting rule).

However, there is also the text pt being printed as a result of invoking multiply with these inputs. Why? And how can I get rid of it?

gablin
  • 17,006
  • 7
    Multiplying two dimensions would give an area, except TeX doesn't store areas so it uses just an integer and typesets the pt – Joseph Wright Dec 17 '15 at 15:01
  • Hm, so I need to remove the 'pt' from the dimension before multiplying, then? – gablin Dec 17 '15 at 15:11
  • 3
    Yes, removing pt from 20pt would make sense and be mathematically correct since you want to scale \dimen1 by some factor and use it as the width argument of \rule which is still a length. – AlexG Dec 17 '15 at 15:28

1 Answers1

4

The TeXbook Chapter 24 states

\multiply<numeric variable><optional by><number>

which means that TeX will scan your input

\multiply\dimen1 by 20pt

up to the p of pt, since p is not a number and will start typesetting.

Henri Menke
  • 109,596