Previous: Measurements, Up: Measurements


5.2.1 Default Units

Many requests take a default unit. While this can be helpful at times, it can cause strange errors in some expressions. For example, the line length request expects em units. Here are several attempts to get a line length of 3.5 inches and their results:

     
     3.5i      ⇒   3.5i
     7/2       ⇒   0i
     7/2i      ⇒   0i
     (7 / 2)u  ⇒   0i
     7i/2      ⇒   0.1i
     7i/2u     ⇒   3.5i

Everything is converted to basic units first. In the above example it is assumed that 1i equals 240u, and 1m equals 10p (thus 1m equals 33u). The value 7i/2 is first handled as 7i/2m, then converted to 1680u/66u which is 25u, and this is approximately 0.1i. As can be seen, a scaling indicator after a closing parenthesis is simply ignored.

Thus, the safest way to specify measurements is to always attach a scaling indicator. If you want to multiply or divide by a certain scalar value, use ‘u’ as the unit for that value.