Information Technology Reference
In-Depth Information
Now, we describe how our package works. Wherever the user inserts a \todo
command in the text, we store its position and its argument (that is, the com-
ment) in a Lua list, but we do not print anything at this moment. When a
page is finished (“shipped out” in Tex terminology), we compute the position
of the labels and draw them. Before calling our label-placement algorithm, we
have Tex determine the label heights. To determine the absolute positions of the
sites, we use PGF/Ti k Z [15], a widely used Tex package for producing vector
graphics. This package can locate the position of a site on the page where the
\todo command was inserted, even when the command occurs inside a floating
environment (such as a figure or a table).
For each label, the placement algorithm computes the absolute coordinates
on the page on which the label is to be placed. Then, we use Ti k Ztodrawthe
labels and the leaders that connect the labels with their corresponding sites in
text. Finally, a mark is placed at each site. This modular design simplifies the
implementation of new algorithms and makes the package extensible.
The size and position of the rectangles that contain the label texts depend on
the current page layout. We provide options to control the distances between the
labels and the text ( distanceNotesText ) and between the labels and the border
of the page ( distanceNotesPageBorder ). The algorithms can place labels in the
left and in the right margin (see Section 4), but a margin is used only if it is
wide enough to accomodate a label, that is, if the label can be at least of width
minNoteWidth .
When loading the package with \usepackage{luatodonotes} , optional ar-
guments can be specified in square brackets. The most relevant options are
(a) the algorithm for label placement ( positioning ) and (b) the leader type
( leadertype ). Other options control the layout: the minimum vertical distance
of the labels ( interNoteSpace ), the distance from the contents of the label to
its border ( noteInnerSep ) and the color of the leaders ( linecolor ).
3 Algorithms for Label Placement
In the following, the algorithms are categorized by the leader type that they
support. In principle, our package allows the user to combine any label-placement
algorithm with any leader type. Still, some algorithms have been designed with
certain leader types in mind. Other combinations will probably yield unwanted
results, such as label overlap or crossing leaders.
In the descriptions of our algorithms below, we assume that labels are placed
on the left side of the text, but this is not a restriction of our actual imple-
mentations. Additionally, we try to place the labels without gaps between them,
while in reality we want to preserve a certain minimum distance between them.
Clearly, this is easy to achieve.
3.1 s -Leaders
Our algorithms designed for s -leaders have a common property: they draw the
leaders without crossing each other. Their common objective is to place the labels
 
Search WWH ::




Custom Search