(texdraw)Scaling coordinates
3.4 Scaling coordinates
=======================
There are two scale factors available, the unit scale factor and the
segment scale factor. The overall scale factor is the product of these
two. There are absolute and relative versions of commands to change
these scale factors.
The unit scale factor is normally used to affect global scale
changes. Changes to the unit scale factor remains local to a segment,
but propagate to inferior segments. The default value is unity.
The segment scale factor is used for local scale changes. It remains
local to a segment. The segment scale factor is reset to unity on entry
into each segment. This means that changes to the segment scale factor
do not propagate to inferior segments.
'\setunitscale SCALE'
Set the unit scaling to SCALE. The argument SCALE is a real number
which is used to scale coordinate values. The overall scaling
factor is the product of the unit scale factor and the segment
scale factor.
'\relunitscale VALUE'
Adjust the unit scale factor by multiplying by VALUE. This has the
effect of multiplying the overall scale factor by the same factor.
The overall scaling factor is the product of the unit scale factor
and the segment scale factor.
'\setsegscale SCALE'
Set the segment scale factor. The argument SCALE is a real number
which is used to scale coordinate values. The overall scale factor
is the product of the unit scale factor and the segment scale
factor.
'\relsegscale VALUE'
Adjust the segment scale factor by multiplying by VALUE. This has
the effect of multiplying the current overall scale factor by the
same factor. The overall scaling factor is the product of the unit
scale factor and the segment scale factor.
In addition to the unit scale factor and the segment scale factor,
the scaling can be controlled by the choice of drawing units with the
command '\drawdim' (Note: Coordinate specification).
'\drawdim cm \setunitscale 2.54'
Set the units to centimetres scaled by 2.54. Together these
commands are effectively the same as '\drawdim in'.
The segment scale can be used to allow scale changes in segments so
that values are in more convenient units. For example suppose
dimensions in a segment are multiples of one third of an inch. The
segment scale can be set once to make 1 drawing unit equal 0.3333
inches. From that point on, coordinates can be specified with integer
values.
The following example defines a macro to draw a rectangular box which
is twice as wide as it is high. The width is specified as an argument.
\def\mybox #1{\bsegment
\setsegscale #1
\lvec (0 +0.25) \lvec (1 +0.25) \lvec (1 -0.25)
\lvec (0 -0.25) \lvec (0 0)
\esegment}
automatically generated by info2www version 1.2.2.9