docchronosys en

of 24 /24
Chronosys Draw timelines diagrams ! 1982 2050 2011 chronosys’s creation Mathieu Long [email protected]

Author: precious-williams

Post on 09-Jul-2016

19 views

Category:

Documents


3 download

Embed Size (px)

TRANSCRIPT

  • ChronosysDraw timelines diagrams !

    1982 2050

    2011chronosyss creation

    Mathieu [email protected]

  • 1

    Contents

    1 Introduction 2

    2 First use 32.1 Main function: \startchronology 32.2 Events: \chronoevent 32.3 Periods: \chronoperiode 42.4 Automatic graduation : \chronograduation 5

    3 Time-lines customization 73.1 \startchronology 73.1.1 Example 73.1.2 Dierent options 73.1.3 Summary 93.2 \chronoperiode 103.2.1 Example 103.2.2 The colour of the background 103.2.3 Colours alternation 103.2.4 Dierent options 113.2.5 Summary 133.3 \chronoevent 143.3.1 Example 143.3.2 Specicities 143.3.2.1 The colour box of the text 143.3.2.2 A new way for specifying the date 153.3.3 Dierent options 163.3.4 Summary 18

    4 Permanent changes 194.1 Creating new commands 194.2 Modify the default values 19

    5 Index 22

  • Introduction

    2

    1 Introduction

    Chronosys is distributed under the LaTeX Project Public License.You may use itfor drawing timelines. It uses the tikz1 package for drawing. You need to have-TEX to use it.

    This package is version 1.2, others versions might be created later.

    It is recommended not to load the color.tex le if you use plain TEX.

    You can load chronosys by :

    \usemodule[chronosys] in ConTEXt.

    \usepackagechronosys in LATEX.

    \input chronosys in plain TEX.

    updates history

    1.10 : added possibility to change the alignment of the timeline on the page,change the width of the text of the label of events, improved support for eventsplaced above the frieze, added the ability to colour the text background of eventsand periods.

    1.15 : added possibility to create owns new commands, to graduate automat-ically the timeline, change the alternation of colours periods and xes somecompatibility issues.

    1.2 (actual version) : reduces the use of the module tikz at least possible,remove the former limitation of the impossibility of switching the default valueof textwidth. With ConTEXt, added possibility using MetaPost

    2 instead oftikz (and conversely, reuse tikz instead of MetaPost) using the commands\chronoswitchtomodeMP and \chronoswitchtomodeTikz ; with the Mark IVversion using MetaPost default.

    I wish to thank Gonalo Pereira for his idea about colouring in white thebackground of the labels of events and periods to avoid them to be mixed withother vertical straights.

    1 for more informations on tikz, see http://mirror.ctan.org/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf

    2 for more informations on MetaPost, see http://www.tug.org/docs/metapost/mpman.pdf

  • First use Events: \chronoevent

    3

    2 First use

    2.1 Main function: \startchronology

    The control sequence \startchronology is the rst one you need to know.3 : itstarts the chronological frieze :

    \startchronology[...=...]

    See 3.1.3 to have the dierent possible options

    The next one is \stopchronology4, it ends the timeline.

    \stopchronology

    Lets have a look on the result :

    \startchronology\stopchronology

    0 2012

    You can see the timeline is on all the pages width, furthermore it starts at 0and ends at the current year 2012 when this document was compiled. Chronosyswill compare these years with the events and periods you will give him (see 2.2 and2.3).

    Now lets learn how to add events on the timeline.

    2.2 Events: \chronoevent

    You can add events with \chronoevent. This control sequence needs two arguments:the rst one is the date of the event5 and the second is the label of this event.

    \chronoevent[...=...]{1.}{2.}

    ...=... options (see 3.3.4)1. date (number)2. label

    3 There are \begin{chronology} and \end{chronology} for LATEX4 or \end{chronology}5 you can go to 3.3.2.2 to see another way of specifying the date

  • First use Periods: \chronoperiode

    4

    For instance:

    \startchronology\chronoevent{1977}{\TeX's creation}\stopchronology

    0 2012

    1977TEXs creation

    The event appears between 0 et 2012, proportionally with his gap with 0. Youcan also give several events:

    \startchronology\chronoevent{476}{Fall of the Roman empire}\chronoevent{1492}{Discovery of America}\chronoevent{1969}{first steps on the Moon}\stopchronology

    0 2012

    476Fall of the Roman empire

    1492Discovery of America

    1969rst steps on the Moon

    N.B.: the font size has been reduced to avoid label to overlap; a best way willbe given further (see 3.3.4).

    Chronosys wont generate any error if the events date is out of the starting yearand ending year, however it will be ignored. The way of customize the timeline,especially the starting year and ending year, will be seen further(see 3.1.3).

    2.3 Periods: \chronoperiode

    You can also add one period (or several6) on the frieze with \chronoperiode.

    \chronoperiode[...=...]{1.}{2.}{3.}

    ...=... options (see 3.2.5)1. date of the beginning (number)

    6 If two periods are overlapping, the last one will overlap the other

  • First use Automatic graduation : \chronograduation

    5

    2. date of the end (number)3. label

    \startchronology\chronoperiode{1000}{1999}{2\high{nd} Millennium}\chronoperiode{192}{476}{Eastern Roman Empire}\chronoevent{1969}{first steps on the Moon}\stopchronology

    0 2012

    2nd Millennium

    1000 1999

    Eastern Roman Empire

    192 476

    1969rst steps on the Moon

    N.B.: on the period from 1000 to 1999, blue on the timeline, we can now see thevertical straight under the frieze. You can disable it (see 3.3.4), but if you want ityou should place the events after the periods.

    The period appears automatically with colour, and the dates are also visible (see3.2.5 to disable them) and the label. The periods can be automatically coloured in5 colours : blue, red, cyan, purple and yellow, except if the colour is identical to thefriezes one. Of course you can choose the colour of the period (see 3.2.5).

    2.4 Automatic graduation : \chronograduation

    Use \chronograduation to add a graduation on the timeline.

    \chronograduation[style][...=...]{1.}

    style periode or event...=... options (see 3.2.4 et 3.3.3)1. interval (number)

    \startchronology\chronograduation{100}\stopchronology\startchronology\chronograduation[periode][dateselevation=0pt]{100}\stopchronology

    0 2012

    100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000

  • First use Automatic graduation : \chronograduation

    6

    0 20120 100100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000

  • Time-lines customization \startchronology

    7

    3 Time-lines customization

    3.1 \startchronology

    3.1.1 Example

    \startchronology can have an optional argument in brackets. For example:

    \startchronology[startyear=-800,stopyear=500,color=darkblue,height=7ex,width=\hsize]\chronoevent{-753}{Rome's foundation}\stopchronology

    -800 500

    -753Romes foundation

    3.1.2 Dierent options

    The dierent options of \startchronology are:

    startyear :

    starting year of the timeline. It needs to be a valid number. It is by default 0

    stopyear :

    ending year of the timeline. It also needs to be a valid number. It is the currentyear by default.

    color :

    colour of the frieze. It must be a valid colour. It is black by default.

    height :

    height of the frieze. It must be a valid dimen and it is 0.7pc by default.

  • Time-lines customization \startchronology

    8

    width :

    width of the frieze. It must be a valid dimen and it is \hsize7 by default.

    datesstyle :

    style to apply to dates. It must be a control sequence (it can take one argu-ment, which will be the dates), is empty by default.

    dateselevation :

    height of the dates from the timeline, it must be a valid dimen and it is 20ptpar by default.

    startdate :

    boolean which indicate if the starting year has to be placed. It must be eithertrue or false and it is true by default.

    stopdate :

    boolean which indicate if the ending year has to be placed. It must be eithertrue or false and it is true by default.

    dates :

    boolean which indicate if both dates have to be placed. It must be either trueor false and it is true by default.

    arrow :

    boolean which indicate if an arrowhead has to be placed. It must be either trueor false and it is true by default.

    arrowheight :

    height of the arrowhead. It must be a valid dimen and it is identical to the heightof the timeline by default.

    arrowwidth :

    width of the arrowhead. It encroaches on the entire (height) width of the frieze.It must be a valid dimen and it is 1/10 of the entire width of the timeline (width)by default.

    7 \textwidth in LATEX

  • Time-lines customization \startchronology

    9

    arrowcolor :

    colour of the arrowhead. It must be a colour recognized by the tikz package.It is identical to the colour of the frieze by default.

    box :

    boolean which indicates if the timeline should be passed back with a black line.It must be either true or false and it is false by default.

    align :

    alignment of the timeline on the page. You can choose between right, centerand left. It is center by default.

    3.1.3 Summary

    \startchronology[...=...]

    startyear =

    stopyear =

    color =

    height =

    width =

    datesstyle = or

    dateselevation =

    startdate = or

    stopdate = or

    dates = or

    arrow = or

    arrowheight =

    arrowwidth =

    arrowcolor =

    box = or

    align = or or

    Table 3.1 startchronologys options

  • Time-lines customization \chronoperiode

    10

    3.2 \chronoperiode

    3.2.1 Example

    \chronoperiode can have an optional argument for the options customization.

    \startchronology[startyear=-800,stopyear=500,color=darkgreen, height=3cm]\chronoperiode[color=orange,bottomdepth=1cm, topheight=2cm,textstyle=\it, dateselevation=-15pt, ifcolorbox=false,box=true]{-753}{-509}{Roman Royal period}\chronoperiode[color=cyan,startdate=false, textstyle=\bf,textdepth=35pt, bottomdepth=1cm, topheight=2cm,ifcolorbox=false, dateselevation=-15pt,box=true]{-509}{-27}{Roman Republic}\stopchronology

    -800 500

    Roman Royal period

    -753 -509

    Roman Republic

    -27

    3.2.2 The colour of the background

    Chronosys colours the background of the label in white to erase the eventual verticalstraights. You can disable it or change the colour if you want (see 3.2.4).

    3.2.3 Colours alternation

    As we saw, the colour of the periods alternates between blue, red, cyan, purple andyellow. You can dene your own colours alternation with\chronoperiodecoloralternation.

    \chronoperiodecoloralternation{1.}

    1. colours (colour, colour,... colour)

    Example:

  • Time-lines customization \chronoperiode

    11

    \chronoperiodecoloralternation{orange, darkgreen,violet, purple, cyan}\startchronology\chronoperiode[startdate=false]{0}{500}{}\chronoperiode[startdate=false]{500}{1000}{}\chronoperiode[startdate=false]{1000}{1500}{}\stopchronology

    0 2012500 1000 1500

    You can also restart the alternation at the beginning or on a specic colour with\restartchronoperiodecolor.

    \restartchronoperiodecolor[...]

    ... name of a colour of the alternation (colour)

    3.2.4 Dierent options

    The dierent options of \chronoperiode are:

    startdate :

    boolean. It indicate if the starting year has to be placed, and must be eithertrue or false. It is true by default.

    stopdate :

    boolean. It indicate if the ending year has to be placed, and must be either trueor false. It is true by default.

    datestrue :

    boolean. It indicate if both dates have to be placed, and must be either true orfalse. It is true by default.

    datesstyle :

    style to apply to the dates. It must be acontrol sequence or control sequence#1 and is empty by default.

    textstyle :

    style to apply to the label. It must be a control sequence or

  • Time-lines customization \chronoperiode

    12

    control sequence#1 and is empty by default.

    color :

    colour of the period on the frieze. It must be a valid colour. It alternatesbetween blue, red, cyan, purple and yellow by default.

    dateselevation :

    height of the dates from the frieze. It must be a valid dimen and it is 0pt bydefault.

    textdepth :

    depth of the label from the frieze. It must be a valid dimen and it is 15pt bydefault.

    colorbox :

    colour of the background of the text of the period. It must be a valid colourand it is white by default.

    ifcolorbox :

    boolean which indicates if the background of the text has to be coloured. It mustbe either true or false. It is true by default.

    topheight :

    height of the top of the period on the timeline. It must be a valid dimen and itis equal to the height of the timeline by default.

    bottomdepth :

    height of the bottom of the period on the timeline. It must be a valid dimen andit is 0pt by default.

  • Time-lines customization \chronoperiode

    13

    3.2.5 Summary

    \chronoperiode[...=...]{...}{...}{...}

    startdate = or

    stopdate = or

    dates = or

    datesstyle = or

    textstyle = or

    color =

    dateselevation =

    textdeph =

    ifcolorbox = or

    colorbox =

    topheight =

    bottomdepth =

    Table 3.2 chronoperiodes options

  • Time-lines customization \chronoevent

    14

    3.3 \chronoevent

    \chronoevent can also have an optional argument for customization.

    3.3.1 Example

    \def\MyIcon{{\color{orange}\vrule width 5pt height5pt\relax}}

    \catcode`\@=11\def\[email protected]#1{\ifcase#1\or January\or February\orMarch\or April\or May\or June\or July\or August\orSeptember\or October\or November\or December\fi}

    \startchronology[startyear=-800,stopyear=500,color=darkgreen,height=7ex]\chronoevent[textstyle=\bf,datesstyle=\it,datesseparation=/,conversionmonth=false,icon=\MyIcon,year=false, textwidth=4.5cm]{15/3/-44}{\qquad ides of March;\endgrafassassination of Caesar}\stopchronology

    -800 500

    15/3ides of March;

    assassination of Cae-sar

    3.3.2 Specicities

    3.3.2.1 The colour box of the text

    As for the periods, to avoid vertical straight to overlap the others labels, as you cansee there, if you wanted to type :

    \startchronology\chronoevent{1500}{Label A}\chronoevent{1525}{Label B}\stopchronology

  • Time-lines customization \chronoevent

    15

    0 2012

    1500Label A

    1525Label B

    chronosys place a white colour box behind the text, so that you can have0 2012

    1525Label B

    1500Label A

    You should type the events from the one you want to place from the farthest tothe nearest from the timeline. You can of course choose the colour of the box, anddisable it if you need (see 3.3.3).

    3.3.2.2 A new way for specifying the date

    You can specify with more precision the date with \chronoevent. We saw thattyping \chronoevent{-44}{Assassination of Caesar} specied the year of theevent, now we will saw the way of specifying the month and the day. You haveto type //year, only specifying the year iscompulsory.

    You can give only the year as we saw before, the number of the month andthe year or the day number and the number of the month and the year. Thenumber of the month is automatically converted to the name of the month (inFrench by default). You can disable this conversion (see 3.3.4).The control sequenceof conversion is:

    \def\[email protected]#1{\ifcase#1\or janvier\or f\'evrier\ormars\or avril\or mai\or juin\or juillet\or ao\^ut\orseptembre\or octobre\or novembre\or d\'ecembre\fi}

    To change the language, you only need to redene the control sequence, forexample for English as:

  • Time-lines customization \chronoevent

    16

    \def\[email protected]#1{\ifcase#1\or January\or February\orMarch\or April\or May\or June\orJuly\or August\or September\orOctober\or November\or December\fi}

    For example,

    \catcode`\@=11\def\[email protected]#1{\ifcase#1\or January\or February\orMarch\or April\or May\or June\orJuly\or August\or September\orOctober\or November\or December\fi}\startchronology[startyear=-44,stopyear=-43,color=darkgreen,height=7ex]\chronoevent{15/03/-44}{Assassination of Caesar}\stopchronology

    -44 -43

    15 March -44Assassination of Caesar

    3.3.3 Dierent options

    Here are the dierent possible options.

    barre :

    boolean which indicate if a vertical straight has to be placed on the frieze at theevent position. It must be either true or false. It is true by default.

    date :

    boolean which indicate if the date of the event has to be placed. It must beeither true or false. It is true by default.

    conversionmonth :

    boolean which indicate if the number of the month has to be converted to thename month. It must be either true or false. It is true by default.

  • Time-lines customization \chronoevent

    17

    mark :

    boolean which indicate if a vertical straight has to be placed under the timelineat the event position. It must be either true or false. It is true by default.

    year :

    boolean which indicate if the year of the event has to be placed. It must beeither true or false. It is true by default.

    icon :

    symbol to add on the frieze at the event position. It can be a control sequenceor some text, and it is empty by default.

    markdepth :

    depth of the label of the event and of the vertical straight under the frieze. Itmust be a valid dimen and it is 10pt by default.

    iconheight :

    height of the icon on the timeline. It must be a valid dimen and it is half of theheight of the frieze by default.

    textstyle :

    style to apply to the label. It must be a control sequence orcontrol sequence#1.

    datesseparation : symbol of separation of each element of the date. It can bea control sequence or some text and is a space by default.

    datestyle :

    style to apply to the entire date with the symbols of separation. It must be acontrol sequence or control sequence#1.

    datesstyle :

    style to apply each element of the date without the symbols of separation. Itmust be a control sequence or control sequence#1.

    colorbox :

    colour of the background of the text and date of the event. It must be a validcolour and it is white by default.

  • Time-lines customization \chronoevent

    18

    ifcolorbox :

    boolean which indicates if the background of the text and the date has to becoloured. It must be either true or false. It is true by default.

    textwidth :

    Width of the label on the page. It must be a valid dimen.

    3.3.4 Summary

    \chronoevent[...=...]{...}{...}

    barre = or

    date = or

    conversionmonth = or

    mark = or

    icon = or

    datesseparation = or

    markdepth =

    iconheight =

    textstyle = or

    datestyle = or

    datesstyle = or

    ifcolorbox = or

    colorbox =

    textwidth =

    Table 3.3 chronoevents options

  • Permanent changes Modify the default values

    19

    4 Permanent changes

    4.1 Creating new commands

    You can create your own commands to place events and periods on the timelinewith \definechronoevent and \definechronoperiode.

    \definechronoperiode{1.}[...=...]\definechronoevent{1.}[...=...]

    1. name for the creation of the new command...=... options of the type of command dened (see 3)

    N.B.: in ConTEXt, the syntax is

    \definechronoperiode[1.][...=...]\definechronoevent[1.][...=...]

    The commands \chrono are now dened. For instance,

    \definechronoperiode{MyPeriod}[color=yellow, textstyle=\it]\definechronoevent{MyEvent}[textstyle=\it, barre=false]\startchronology[color=darkgreen]\chronoMyPeriod{100}{500}{Something}\chronoMyEvent{800}{Anything else}\stopchronology

    0 2012

    Something

    100 500

    800Anything else

    4.2 Modify the default values

    You can apply changes on default values with using \setupchronology,\setupchronoevent and \setupchronoperiode. You use the same name for eachoption you want to change. .

    \setupchrono[...]{1.}

  • Permanent changes Modify the default values

    20

    periode or event or logy or graduation... name of the command to customize (except for \setupchronology, and

    for\setupchronograduation it is the style of the graduation ; see 4.1)1. options (see 3)

    N.B.: Again, in ConTEXt, the syntax is :

    \setupchrono[...][1.]

    The option name of the command to customize is only available for\setupchronoevent and \setupchronoperiode, and in the case of\setupchronograduation it matches the style of graduation (event or period).

    If it is not given, the changes will aect \chronoperiode and \chronoevent ,otherwise they will aect the command given in option.

    For example,

    \setupchronology{startyear=1000,color=darkblue,stopdate=false}\setupchronoperiode{color=darkgreen}\setupchronoevent{textstyle=\it}\setupchronograduation[event]{markdepth=2cm}\startchronology\chronograduation{250}\chronoperiode{1050}{1450}{Anything you want}\chronoevent{1600}{Anything else}\chronoperiode{1800}{1899}{19\high{th} century}\stopchronology

    1000

    1250 1500 1750 2000

    Anything you want

    1050 1450

    1600Anything else

    19th century

    1800 1899

    N.B.: if you want to reapply the automatic colours alternation of the periods,use

    \setupchronoperiode{color=\chronoperiodcolor}

  • Permanent changes Modify the default values

    21

    1000

    1250 1500 1750 2000

    Anything you want

    1050 1450

    19th century

    1800 1899

    1600Anything else

  • Index

    22

    5 Index

    aalign 9arrow 8arrowcolor 9arrowheight 8arrowwidth 8

    bbarre 16bottomdepth 12box 9

    cchronoevent 3, 15, 16chronoperiode 11chronoperiodecoloralternation 10chronperiode 4color 7, 12colorbox 12, 17conversionmonth 16

    ddate 16dates 8, 11dateselevation 8, 12datesseparation 17datesstyle 11, 17datessyle 8datestyle 17

    hheight 7

    iicon 17

    iconheight 17ifcolorbox 12, 18

    mmark 17markdepth 17

    rrestartchronoperiodecolor 11

    ssetupchronoevent 19setupchronology 19setupchronoperiode 19startchronology 3, 7startdate 8, 11startyear 7stopchronology 3stopdate 8, 11stopyear 7

    ttextdepth 12textstyle 11, 17textwidth 18topheight 12

    wwidth 8

    yyear 17

  • Index

    23

    Go to table of contents

    Exit

    1 Introduction2 First use2.1 Main function: \startchronology2.2 Events: \chronoevent2.3 Periods: \chronoperiode2.4 Automatic graduation : \chronograduation

    3 Time-lines' customization3.1 \startchronology3.1.1 Example3.1.2 Different options3.1.3 Summary

    3.2 \chronoperiode3.2.1 Example3.2.2 The colour of the background3.2.3 Colours alternation3.2.4 Different options3.2.5 Summary

    3.3 \chronoevent3.3.1 Example3.3.2 Specificities3.3.3 Different options3.3.4 Summary

    4 Permanent changes4.1 Creating new commands4.2 Modify the default values

    5 index