h

herodot

@preview

A package for making linear timelines, inspired by chronology.

v1.0.0
GPL-3.0-only

Package Information

Last Updated
Authors
gnist
Categories
visualization
Disciplines
historyphilosophy

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/herodot:1.0.0

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/herodot:1.0.0": *

Version History

1.0.0
2a40ecff3e3a...
0.4.0
ab0519957387...
0.3.0
39f3580f5871...
0.2.0
4247335f9463...
0.1.0
d5b6f6af258f...

A timeline typst package

This package uses cetz to
provide a interface in typst for making timelines, inspired
by the latex chronology package.

It provides the following to work with timelines.

  • A event and eventspan object for grouping data
    you want displayed on the timeline.
  • The timeline function itself.

For getting started quickly add the following to your document:

#import "@preview/herodot:1.0.0" : * 

See the visual examples below and some examples at the end of the readme
for what fields and options the package offers. The source for the examples
can be found at examples/example.typ.

An example of the timeline with the default settings, showing two<br>
event-spans and one event, the second example being of using the<br>
rotation fields to make a vertical timeline rather than the default<br>
of being horizontal.

Examples of setting the day and month field of an event, and<br>
the different options for the event-display field, of whether the<br>
additional shown information should be the day, the month, both or<br>
nothing.

Example of setting different colors for the event-spans.

Examples of setting alternative and alternating spanheights for<br>
the eventspans, and the length of the vertical marker for events.

One more example of different spanheights.

Example

A basic example of using the timeline with the event and eventspan
constructor without setting any of the optional style settings.


#import "@preview/herodot:1.0.0" : * 

#let scifi-time = timeline(
  interval: 200,
  startyear: -200,
  endyear: 1000,
  events: (
  
    // basic event with only title and year
    event(
      title: "Alien invasion",
      year: 0
    ),

    // event with title and the exact date
    event(
      title: "First alien-human marriage",
      year: 40,
      month: 3,
      day: 20,
    ) 
  ),
  eventspans: (
    eventspan(
      title: "Climate collaps",
      start-point: -100,
      end-point: -30
    ),
    eventspan(
      title: "Integration of Earth into galatic commerce",
      start-point: 10,
      end-point: 70
    ),
  ),
)

#scifi-time

Properties/fields

The settable properties for customizing the look
of the timeline. Visual examples can be seen in
the example.pdf

event

The base obligatory settings for event is the year and title.

Property Description
title The title of the event, as a string
year The year of the event, as an integer

Herodot however also has support for setting exact date of the
event with the month and day fields.

Property Description
month The month represented as an integer (1-12)
day The day as an integer (1-31)

eventspan

Obligatory fields for an eventspan.

Property Description
title Title of the event
start-point It's starting point as an integer
end-point It's end-point as an integer
spanheight height/width of the eventspan (the same distance on both sides of the timeline)
spanheight-positive-y Alternative height/width of the eventspan above the timeline (allows for alternative heights between the distance above and below the timeline)
spanheight-negative-y Alternative height/width of the eventspan below the timeline (allows for alternative heights between the distance above and below the timeline)

See the optional styling properties for location
and color setting of the eventspan under timeline.

timeline

Property Description
startyear The start year for the timeline, can be a postive or negative integer
endyear The last year of the timeline, can also be either a positive or negative integer
interval Interval between years to be marked on the timeline
events Array of events to put on the timeline
eventspans Array of eventspans to put on the timeline
event-rotation The rotation of the text title of events (default: 45deg)
span-rotation The rotation of the text title of eventspans (default: 0deg)
event-display The date information displayed along the event title, the default is year, but i can be either one of day/month/year/day-month, day-month-year or none.
month-locale The string locale of the months to be used to display it, by default english, but an array of strings can be manually passed to override it and used alternatively.
Optional styling properties Description
length-of-timeline Length of timeline in cm
linestroke The width and color of the lines making up the timeline