Download METAOBJ Manual - (La)TeX Navigator

Transcript
1.4.4
Pictures
An object can naturally contain pictures. The boxes package provides two
functions, boxit and circleit, which frame pictures. However, there is a big
difference between points and pictures: a point can be floating, a picture can
not. A picture is always at some place and an equation will not move it. You
can assign it to another place, but not just hope it will move alone. The boxes
package always puts the pictures at the origin, and so do we. In order to give the
feeling of “floatness,” we will have a floating point corresponding to the location
of the picture, and everytime we need to draw the picture, we can merely move
it to its location.
1.4.5
Paths
An object usually contains lines, arrows, etc., in addition to pictures or labels.
When the lines are straight and connect two or more points of an object, the
only thing to do is to keep track of the instruction drawing the line. Everything
else is already there.
However, certain connections are more complex. Consider for instance:
nw
ne
Here, there is a connection between the two points nw and ne, but the first
point is left with an angle of 30 degrees with respect to the horizontal. This
seems fine, and one would think that it is sufficient to record the appropriate
drawing instruction in the object. Unfortunately, this is not convenient, because
the application of linear transformations to the object will produce strange
results if the hardwired angle of 30 degrees is kept. For instance, if we turn this
object by 50 degrees counterclockwise, we get:
ne
nw
One could think of computing the correct angle, but even if one does, the
angle is actually not enough to specify the right path (even if metapost draws
a path, it is probably not the one we want). This is obvious if one considers the
control points of a path.
A first problem is one similar as with the pictures: we cannot have paths
connecting undefined points. Therefore, when an object is “floating”, we could
either store a fixed path and move it, but this may not always be convenient if
we want to change the size of the object as we will see later.
One way out of this dilemma is to store inside the object all the points
defining the path, including its control points. Then, we can forget about the
angles, and just let the points move according to the transformations that are
applied to the objects, and then reconstruct the path from its points and control
points.
10