I am writing a Latex package for myself. Just for the learning purpose.
Currently it draws some basic shapes which each represents an event. I created a function
\event[year][month][year][month][label] which adds a new event to the graphic. The first two parameters are the start date and the second two is the end date.
Now the idea is to draw the events below each other. But because the shapes for the event contains also the label for the event which is sometimes longer than the text, I want to draw them below all other events. Sometimes shapes overlap on the x-axis.
To draw the label, if it is longer than the shape of the event, below all overlapping events, I need to know how many events will be added. So my idea was to use a similar approach like the TOC does. Basically you need two compile runs to generate the final graphics. As far as I know the TOC generation uses the
.aux file. But I am not sure how to use it for my own purpose or if there is a better approach?
Graphic which shows my idea:
------ | -EVENT LABEL- | -EVENT LABEL- | LABEL IS TOO LONG