% This is is the code for the english documentation of the `chronosys' package.
%
% The maintener of this work is Mathieu Long.
% email : mlong.tex@hotmail.fr
% the `chronosys' package consists in the 9 files :
%  -- `docchronosys_en.tex' and `docchronosys_en.pdf' (english manual)
%  -- `docchronosys_fr.tex' and `docchronosys_fr.pdf' (french manual)
%  -- README
%  -- `chronosys.tex' (file for plain TeX)
%  -- `chronosyschr.tex' (main file of the `chronosys' package)
%  -- `chronosys.sty' (file for LaTeX)
%  -- `x-chronosys.tex' (file for ConTeXt)
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
% 
% The Current Maintainer of this work is Mathieu Long.
%
\setupinteraction[title=Chronosys - Documentation, author=Mathieu Long, title=Chronosys documentation -english-, subtitle=Draw timelines]
\setupcolors[state=start]
\unless\ifdefined\XeTeXpicfile \unless\ifdefined\directlua
\setupoutput[pdftex]
\fi\fi
\setupheadertexts%
[chapter][section]
\setupheader[text][style=\ss]
\enableregime[utf8]
\mainlanguage[en]
\setupbodyfont[14pt,regular]
\setuppapersize[B4]
\setupinteraction[state=start,color=middlered]
\setupcapitals[sc=yes]
\setupindenting[yes,20pt]
\setuppagenumbering[location={bottom,right},left=--~]

\definetyping[typingTEX][option=TEX]
\setuptyping[typingTEX][color=darkblue]
\setupcolors[state=start]
\useURL[MetaPost_TUG][http://www.tug.org/docs/metapost/mpman.pdf]
\useURL[Tikz_CTAN][http://mirror.ctan.org/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf]
\starttext

\startmode[mkiv]
\def\METAPOST{MetaPost}
\stopmode 


\placebookmarks[chapter,section,subsection][chapter,section]
\usemodule[chronosys]
\startstandardmakeup\switchtobodyfont[myface,16pt]
\midaligned{Chronosys}
\midaligned{Draw timelines diagrams !}
\bigskip
\startchronology[width=\hsize,height=7ex,stopyear=\numexpr\year+38\relax,startyear=1982,color=darkgreen]
\chronoevent{2011}{\type{chronosys}'s creation}
\stopchronology
\bigskip\bigskip
\midaligned{Mathieu \sc Long}
\midaligned{\color[darkgreen]mlong.tex@hotmail.fr}
\stopstandardmakeup
\completecontent[level=subsection,interaction=pagenumber]

\def\HeadTitle#1#2%
{\hbox to \hsize
{ \vbox{\hrule\par\noindent\vrule height1.15cm depth0pt\leaders\hrule\hskip10pt \lower5pt\vbox{\hbox{ #1\hskip10pt#2 }}\leaders\hrule\hfill\vrule height1.15cm depth0pt}
}}
\setuphead[chapter][command=\HeadTitle]
\setupbodyfont[14pt]
\parskip 1cm
\chapter{Introduction}

\type{Chronosys}  is distributed under the LaTeX Project Public License.You may use it for drawing timelines. It uses the \type{tikz}\footnote{for more informations on \type{tikz}, see \from[Tikz_CTAN]} package for drawing. You need to have \ETEX\ to use it. 
\blank
\unprotect
This package is version {\unprotect\chron@sysversion\protect}, others versions might be created later.
\bigskip
It is recommended not to load the \type{color.tex} file if you use plain \TeX.
\bigskip

You can load \type{chronosys} by~:
\startitemize[4]
\item \tex{usemodule[chronosys]} in \CONTEXT.
\item \tex{usepackage{chronosys}} in \LaTeX.
\item \tex{input chronosys} in plain \TeX.
\stopitemize

\subject{updates' history}
\startitemize[1]
\item 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 events placed above the frieze, added the ability to colour the text background of events and periods.
\item 1.15 : added possibility to create owns new commands, to graduate automatically the timeline, change the alternation of colours 
 periods and fixes some compatibility issues.
\item 1.2 (actual version) : reduces the use of the module \type{tikz} at least possible, remove the former limitation of the impossibility of
switching the default value of \type{textwidth}. With \CONTEXT, added possibility using \METAPOST\footnote{for more informations on \METAPOST, see \from[MetaPost_TUG]} instead of \type{tikz} (and
 conversely, reuse \type {tikz} instead of \METAPOST{}) using the commands \tex{chronoswitchtomodeMP} and \tex{chronoswitchtomodeTikz}~; with  
the Mark IV version using \METAPOST{} default.

\stopitemize

\blank

\hairline
I wish to thank Gonçalo {\sc Pereira} for his idea about colouring in white the background of the labels of events and periods to avoid them to be mixed with other vertical straights.

\blank
\hrule

\chapter{First use}

\section{Main function: \tex{startchronology}}

The control sequence \tex{startchronology}\index{startchronology} is the first one you need to know.\footnote{There are \tex{begin}\arg{chronology} and \tex{end}\arg{chronology} for \LaTeX}~: it starts the chronological frieze :

\startalignment[middle]
\starttypingTEX
\startchronology[...=...]
\stoptypingTEX
\stopalignment
\leftaligned{\switchtobodyfont[12.4pt] See \in[startchronologyoptions] to have the different possible options}
\blank[small]
The next one is \tex{stopchronology}\index{stopchronology}\footnote{or \tex{end}\arg{chronology}}, it ends the timeline.

\startalignment[middle]
\starttypingTEX
\stopchronology
\stoptypingTEX
\stopalignment

 Let's have a look on the result~:
\starttypingTEX
\startchronology
\stopchronology
\stoptypingTEX

\startchronology
\stopchronology
\bigskip
You can see the timeline is on all the page's width, furthermore it starts at {\os0} and ends at the current year {\os\the\year} when this document was compiled. \type{Chronosys} will compare these years with the events and periods you will give him (see \in[event] and \in[period]).
\blank[small]Now let's learn how to add events on the timeline.

\section[event]{Events: \tex{chronoevent}}

You can add events with \tex{chronoevent}\index{chronoevent}. This control sequence needs two arguments: the first one is the date of the event\footnote{you can go to \in[eventnewdate] to see another way of specifying the date} and the second is the label of this event.

\startalignment[middle]
\starttypingTEX
\chronoevent[...=...]{1.}{2.}
\stoptypingTEX
\stopalignment

\starttabulate[|l|l|]
\NC \color[darkblue]\tt...=...\NC options (see \in[eventoptions])\NC\NR
\NC \color[darkblue]1. \NC date ({\em number})\NC\NR
\NC \color[darkblue]2. \NC label \NC\NR
\stoptabulate

\blank[small]
For instance:
\starttypingTEX
\startchronology
\chronoevent{1977}{\TeX's creation}
\stopchronology
\stoptypingTEX
\startchronology
\chronoevent{1977}{\TeX's creation}
\stopchronology
\bigskip
The event appears between {\os 0} et {\os\the\year}, proportionally with his gap with {\os0}. You can also give several events:

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

\switchtobodyfont[9pt]
\startchronology
\chronoevent{476}{Fall of the Roman empire}
\chronoevent{1492}{Discovery of America}
\chronoevent{1969}{first steps on the Moon}
\stopchronology
\switchtobodyfont[14pt]
\bigskip N.B.: the font size has been reduced to avoid label to overlap; a best way will be given further (see \in[eventoptions]).\blank

\type{Chronosys} won't generate any error if the event's date is out of the starting year and 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 \in[startchronologyoptions]).

\section[period]{Periods: \tex{chronoperiode}}

You can also add one period (or several\footnote{If two periods are overlapping, the last one will overlap the other}) on the frieze with \tex{chronoperiode}\index{chronperiode}.

\startalignment[middle]
\starttypingTEX
\chronoperiode[...=...]{1.}{2.}{3.}
\stoptypingTEX
\stopalignment
\starttabulate[|l|l|]
\NC \tt\color[darkblue]...=...\NC options (see \in[periodoptions])\NC\NR
\NC \color[darkblue]1. \NC date of the beginning ({\em number})\NC\NR
\NC \color[darkblue]2. \NC date of the end ({\em number}) \NC\NR
\NC\color[darkblue]3. \NC label \NC\NR
\stoptabulate

\starttypingTEX
\startchronology
\chronoperiode{1000}{1999}{2\high{nd} Millennium}
\chronoperiode{192}{476}{Eastern Roman Empire}
\chronoevent{1969}{first steps on the Moon}
\stopchronology
\stoptypingTEX
\switchtobodyfont[9pt]
\startchronology
\chronoperiode{1000}{1999}{2\high{nd} Millennium}
\chronoperiode{192}{476}{Eastern Roman Empire}
\chronoevent{1969}{first steps on the Moon}
\stopchronology
\switchtobodyfont[14pt]
\blank
N.B.: on the period from {\os1000} to {\os1999}, blue on the timeline, we can now see the vertical straight under the frieze. You can disable it (see \in[eventoptions]), but if you want it you should place the events after the periods.

The period appears automatically with colour, and the dates are also visible (see \in[periodoptions] to disable them) and the label. The periods can be automatically coloured in 5 colours : blue, red, cyan, purple and yellow, except if the colour is identical to the frieze's one. Of course you can choose the colour of the period (see \in[periodoptions]). 

\section[chronograduation]{Automatic graduation : \tex{chronograduation}}

Use \tex{chronograduation} to add a graduation on the timeline.

\startalignment[middle]
\starttypingTEX
\chronograduation[style][...=...]{1.}
\stoptypingTEX
\stopalignment

\starttabulate[|l|l|]
\NC \color[blue] \type{style} \NC \type{periode} \em or \type{event}\FR
\NC \color[blue] ...=... \NC options (see \in[chronoperiodsoptions] et \in[chronoeventsoptions]) \FR
\NC \color[blue] 1. \NC interval ({\em number})\FR
\stoptabulate

\starttypingTEX
\startchronology
\chronograduation{100}
\stopchronology
\startchronology
\chronograduation[periode][dateselevation=0pt]{100}
\stopchronology
\stoptypingTEX
\startchronology
\chronograduation[][]{100}
\stopchronology
\startchronology
\chronograduation[periode][dateselevation=\z@]{100}
\stopchronology

\chapter[Personnalisation]{Time-lines' customization}

\section{\tex{startchronology}}
\subsection{Example}
\tex{startchronology} can have an optional argument in brackets. 
For example: 

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

\subsection{Different options}
The different options of \tex{startchronology}\index{startchronology} are:
\startitemize
\head \type{startyear}\index{startyear} :\par starting year of the timeline. It needs to be a valid \type{number}. It is by default {\os0}
\head \type{stopyear}\index{stopyear} :\par ending year of the timeline. It also needs to be a valid \type{number}. It is the current year by default.
\head \type{color}\index{color} :\par colour of the frieze. It must be a valid \type{colour}. It is black by default.
\head \type{height}\index{height} :\par height of the frieze. It must be a valid \type{dimen} and it is \type{0.7pc} by default.
\head \type{width}\index{width} :\par width of the frieze. It must be a valid \type{dimen} and it is \tex{hsize}\footnote{\tex{textwidth} in \LaTeX} by default.
\head \type{datesstyle}\index{datessyle} :\par style to apply to dates. It must be a \type{control sequence} (it can take one argument, which will be the dates), is empty by default.
\head \type{dateselevation}\index{dateselevation} :\par height of the dates from the timeline, it must be a valid \type{dimen} and it is \type{20pt} par by default.
\head \type{startdate}\index{startdate} :\par boolean which indicate if the starting year has to be placed. It must be either \type{true} or \type{false} and it is \type{true} by default.
\head \type{stopdate}\index{stopdate} :\par boolean which indicate if the ending year has to be placed. It must be either \type{true} or \type{false} and it is \type{true} by default.
\head \type{dates}\index{dates} :\par boolean which indicate if both dates have to be placed. It must be either \type{true} or \type{false} and it is \type{true} by default.
\head\type{arrow}\index{arrow} :\par boolean which indicate if an arrowhead has to be placed. It must be either \type{true} or \type{false} and it is \type{true} by default.
\head \type{arrowheight}\index{arrowheight} :\par height of the arrowhead. It must be a valid \type{dimen} and it is identical to the height of the timeline by default.
\head \type{arrowwidth}\index{arrowwidth} :\par width of the arrowhead. It encroaches on the entire (\type{height}) width of the frieze. It must be a valid \type{dimen} and it is 1/10 of the entire width of the timeline (\type{width}) by default.
\head \type{arrowcolor}\index{arrowcolor} :\par colour of the arrowhead.  It must be a \type{colour} recognized by the \type{tikz} package. It is identical to the colour of the frieze by default.
\head \type{box}\index{box} :\par boolean which indicates if the timeline should be passed back with a black line. It must be either \type{true} or \type{false} and it is \type{false} by default.
\head \type{align}\index{align} :\par alignment of the timeline on the page. You can choose between \type{right}, \type{center} and \type{left}. It is \type{center} by default.
 
\stopitemize 
\subsection[startchronologyoptions]{Summary}
\placetable[here][fig:startchronologyoptions]{\type{startchronology}'s options}
\starttable[|l|c|l|]
\HL\VL\use{3}\ReFormat[cB]{\tex{startchronology[}\em ...=...\type{]}}\VL\SR
\VL\type{startyear} \NC=\NC\type{<number>}
\VL\FR\VL
\type{stopyear} \NC=\NC\type{<number>}\VL\FR
\VL
\type{color} \NC=\NC\type{<colour>}\VL\FR
\VL
\type{height} \NC=\NC\type{<dimen>}\VL\FR
\VL
\type{width} \NC=\NC\type{<dimen>}\VL\FR
\VL
\type{datesstyle} \NC=\NC\type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\FR
\VL
\type{dateselevation} \NC=\NC\type{<dimen>}\VL\FR
\VL
\type{startdate} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\FR
\VL\type{stopdate} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\FR
\VL\type{dates} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\FR
\VL\type{arrow} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\FR
\VL\type{arrowheight} \NC=\NC\type{<dimen>}\VL\FR
\VL\type{arrowwidth} \NC=\NC\type{<dimen>}\VL\FR
\VL\type{arrowcolor} \NC=\NC\type{<colour>}\VL\FR
\VL\type{box} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\FR
\VL\type{align} \NC=\NC\type{<right>} {\em or} \type{<center>} {\em or} \type{<left>}\VL\FR\HL
\stoptable

\page[yes]
\section{\tex{chronoperiode}}
\subsection{Example}
\tex{chronoperiode} can have an optional argument for the options' customization. 
\starttypingTEX
\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
\stoptypingTEX
\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

\subsection{The colour of the background}

\type{Chronosys} colours the background of the label in white to erase the eventual vertical straights. You can disable it or change the colour if you want (see \in[chronoperiodsoptions]).

\subsection{Colours alternation}

As we saw, the colour of the periods alternates between blue, red, cyan, purple and yellow. You can define your own colours alternation 
with \crlf\tex{chronoperiodecoloralternation}\index{chronoperiodecoloralternation}.

\startalignment[middle]
\starttypingTEX
\chronoperiodecoloralternation{1.}
\stoptypingTEX
\stopalignment

\starttabulate[|l|l|]
\NC\color[darkblue] 1. \NC colours ({\em\type{colour}, \type{colour},... \type{colour}})\FR
\stoptabulate

\blank[big]

Example:

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

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

You can also restart the alternation at the beginning or on a specific colour with\crlf
\tex{restartchronoperiodecolor}\index{restartchronoperiodecolor}.

\startalignment[middle]
\starttypingTEX
\restartchronoperiodecolor[...]
\stoptypingTEX
\stopalignment

\starttabulate[|l|l|]
\NC\color[darkblue] ... \NC name of a colour of the alternation ({\em colour})\FR
\stoptabulate

\subsection[chronoperiodsoptions]{Different options}

The different options of \tex{chronoperiode}\index{chronoperiode} are:

\startitemize
\head \type{startdate}\index{startdate} :\par boolean. It indicate if the starting year has to be placed, and must be either \type{true} or \type{false}. It is \type{true} by default.
\head \type{stopdate}\index{stopdate} :\par boolean. It indicate if the ending year has to be placed, and must be either \type{true} or \type{false}. It is \type{true} by default.
\head \type{dates}\type{true}\index{dates} :\par boolean. It indicate if both dates have to be placed, and must be either \type{true} or \type{false}. It is \type{true} by default.
\head \type{datesstyle}\index{datesstyle} : \par style to apply to the dates. It must be a 

\noindent\type{control sequence} or \type{control sequence#1} and is empty by default.
\head \type{textstyle}\index{textstyle} : \par style to apply to the label. It must be a \type{control sequence} or 

\noindent\type{control sequence#1} and is empty by default.
\head \type{color}\index{color} :\par colour of the period on the frieze. It must be a valid \type{colour}. It alternates between blue, red, cyan, purple and yellow by default.
\head \type{dateselevation}\index{dateselevation} :\par height of the dates from the frieze. It must be a valid \type{dimen} and it is \type{0pt} by default.
\head \type{textdepth}\index{textdepth} :\par depth of the label from the frieze. It must be a valid \type{dimen} and it is \type{15pt} by default.
\head \type{colorbox}\index{colorbox} :\par colour of the background of the text  of the period. It must be a valid \type{colour} and it is white by default.
\head \type{ifcolorbox}\index{ifcolorbox} :\par boolean which indicates if the background of the text has to be coloured. It must be either \type{true} or \type{false}. It is \type{true} by default.
\head \type{topheight}\index{topheight} : \par height of the top of the period on the timeline. It must be a valid \type{dimen} and it is equal to the \type{height of the timeline} by default.
\head \type{bottomdepth}\index{bottomdepth} : \par height of the bottom of the period on the timeline. It must be a valid \type{dimen} and it is \type{0pt} by default.
\stopitemize

\subsection[periodoptions]{Summary}

\placetable[here][fig:chronoperiodeoptions]{\type{chronoperiode}'s options}
\starttable[|l|c|l|]
\HL\VL\use{3}\ReFormat[cB]{\tex{chronoperiode[}\em ...=...\type{]{...}{...}{...}}}\VL\SR
\VL\type{startdate} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\LR
\VL\type{stopdate} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\LR
\VL\type{dates} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\LR
\VL\type{datesstyle} \NC=\NC\type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\LR
\VL\type{textstyle} \NC=\NC\type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\LR
\VL\type{color} \NC=\NC\type{<colour>}\VL\LR
\VL\type{dateselevation} \NC=\NC\type{<dimen>}\VL\LR
\VL\type{textdeph} \NC=\NC\type{<dimen>}\VL\LR
\VL\type{ifcolorbox}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
\VL\type{colorbox} \NC =\NC \type{<colour>} \VL\FR
\VL\type{topheight} \NC =\NC \type{<dimen>}\VL\FR
\VL\type{bottomdepth} \NC =\NC \type{<dimen>}\VL\FR\HL
\stoptable

\page[yes]

\section{\tex{chronoevent}}

\tex{chronoevent} can also have an optional argument for customization.

\subsection{Example}

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

\catcode`\@=11
\def\chron@selectmonth#1{\ifcase#1\or January\or February\or
 March\or April\or May\or June\or July\or August\or
 September\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;\endgraf
assassination of Caesar}
\stopchronology
\stoptypingTEX
\def\MyIcon{{\color[orange]\vrule width 5pt height5pt\relax}}
\catcode`\@=11
\def\chron@selectmonth#1{\ifcase#1\or January\or February\or
 March\or April\or May\or June\or July\or August\or September\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; \endgraf assassination of Caesar}
\stopchronology

\subsection{Specificities}
\subsubsection{The colour box of the text}

As for the periods, to avoid vertical straight to overlap the others labels, as you can see there, if you wanted to type :
\starttypingTEX
\startchronology
\chronoevent{1500}{Label A}
\chronoevent{1525}{Label B}
\stopchronology
\stoptypingTEX
\startchronology
\chronoevent{1500}{Label A}
\chronoevent[markdepth=70pt,ifcolorbox=false]{1525}{Label B}
\stopchronology
\type{chronosys} place a white colour box behind the text, so that you can have 

\startchronology
\chronoevent[markdepth=70pt]{1525}{Label B}
\chronoevent{1500}{Label A}
\stopchronology

You should type the events from the one you want to place from the farthest to the nearest from the timeline. You can of course choose the colour of the box, and disable it if you need (see \in[chronoeventsoptions]).

\subsubsection[eventnewdate]{A new way for specifying the date}

You can specify with more precision the date with \tex{chronoevent}\index{chronoevent}. We saw that typing 
\tex{chronoevent}\arg{-44}\arg{Assassination of Caesar} specified the year of the event, now we will saw the way of specifying
the month and the day. You have to type \type{<day number>/<number of the month>/year}, only specifying the year is compulsory.

You can give only the year as we saw before, the number of the month and the year or the day number and the number of the month and the year. The number of the month is automatically converted to the name of the month (in French by default). You can disable this conversion (see \in[eventoptions]).The control sequence of conversion is:
\starttypingTEX
\def\chron@selectmonth#1{\ifcase#1\or janvier\or f\'evrier\or
 mars\or avril\or mai\or juin\or juillet\or ao\^ut\or
 septembre\or octobre\or novembre\or d\'ecembre\fi}
\stoptypingTEX

To change the language, you only need to redefine the control sequence, for example for English as:
\starttypingTEX
\def\chron@selectmonth#1{\ifcase#1\or January\or February\or
 March\or April\or May\or June\or
 July\or August\or September\or
 October\or November\or December\fi}
\stoptypingTEX
\bigskip
For example,
\starttypingTEX
\catcode`\@=11
\def\chron@selectmonth#1{\ifcase#1\or January\or February\or
 March\or April\or May\or June\or
 July\or August\or September\or
 October\or November\or December\fi}
\startchronology[startyear=-44,
stopyear=-43,color=darkgreen,height=7ex]
\chronoevent{15/03/-44}{Assassination of Caesar}
\stopchronology
\stoptypingTEX
\catcode`\@=11
\def\chron@selectmonth#1{\ifcase#1\or January\or February\or
 March\or April\or May\or June\or July\or August\or September\or
 October\or November\or December\fi}

\startchronology[startyear=-44,stopyear=-43,color=darkgreen,height=7ex]
\chronoevent{15/03/-44}{Assassination of Caesar}
\stopchronology
\blank

\subsection[chronoeventsoptions]{Different options}

Here are the different possible options\index{chronoevent}.
\startitemize[1]
\head \type{barre}\index{barre} :\par boolean which indicate if a vertical straight has to be placed on the frieze at the event position. It must be either \type{true} or \type{false}. It is \type{true} by default.
\head \type{date}\index{date} :\par boolean which indicate if the date of the event has to be placed. It must be either \type{true} or \type{false}. It is \type{true} by default.
\head \type{conversionmonth}\index{conversionmonth} :\par boolean which indicate if the number of the month has to be converted to the name month. It must be either \type{true} or \type{false}. It is \type{true} by default.
\head \type{mark}\index{mark} :\par boolean which indicate if a vertical straight has to be placed under the timeline at the event position. It must be either \type{true} or \type{false}. It is \type{true} by default.
\head \type{year}\index{year} :\par boolean which indicate if the year of the event has to be placed. It must be either \type{true} or \type{false}. It is \type{true} by default.
\head \type{icon}\index{icon} :\par symbol to add on the frieze at the event position. It can be a control sequence or some text, and it is empty by default.
\head \type{markdepth}\index{markdepth} : \par depth of the label of the event and of the vertical straight under the frieze. It must be a valid \type{dimen} and it is \type{10pt} by default.
\head \type{iconheight}\index{iconheight} :\par height of the icon on the timeline.  It must be a valid \type{dimen} and it is half of the height of the frieze by default.
\head \type{textstyle}\index{textstyle} :\par style to apply to the label. It must be a \type{control sequence} or 

\noindent\type{control sequence#1}.
\head \type{datesseparation}\index{datesseparation} : symbol of separation of each element of the date. It can be a control sequence or some text and is a space by default.
\head \type{datestyle}\index{datestyle} :\par style to apply to the entire date with the symbols of separation. It must be a \type{control sequence} or \type{control sequence#1}.
\head \type{datesstyle}\index{datesstyle} :\par style to apply each element of the date without the symbols of separation. It must be a \type{control sequence} or \type{control sequence#1}.
\head \type{colorbox}\index{colorbox} :\par colour of the background of the text and date of the event. It must be a valid \type{colour} and it is white by default.
\head \type{ifcolorbox}\index{ifcolorbox} :\par boolean which indicates if the background of the text and the date has to be coloured. It must be either \type{true} or \type{false}. It is \type{true} by default.
\head \type{textwidth}\index{textwidth} :\par
Width of the label on the page.
It must be a valid \type{dimen}.
\stopitemize 

\subsection[eventoptions]{Summary}

\placetable[here][fig:chronoeventoptions]{\type{chronoevent}'s options}
\starttable[|l|c|l|]
\HL\VL\use{3}\ReFormat[cB]{\tex{chronoevent[}\em ...=...\type{]{...}{...}}}\VL\SR
\VL\type{barre}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
\VL\type{date}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
\VL\type{conversionmonth}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
\VL\type{mark}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
\VL\type{icon}\NC=\NC \type{<text>} {\em or} \type{<control sequence>} \bf\dots\VL\FR
\VL\type{datesseparation}\NC=\NC \type{<text>} {\em or} \type{<control sequence>} \bf\dots\VL\FR
\VL\type{markdepth}\NC=\NC \type{<dimen>}\VL\FR
\VL\type{iconheight}\NC=\NC \type{<dimen>}\VL\FR
\VL\type{textstyle}\NC=\NC \type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\FR
\VL\type{datestyle}\NC=\NC \type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\FR
\VL\type{datesstyle}\NC=\NC \type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\FR
\VL\type{ifcolorbox}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
\VL\type{colorbox} \NC =\NC \type{<colour>} \VL\FR
\VL\type{textwidth} \NC =\NC \type{<dimen>}\VL\FR\HL
\stoptable

\page[yes]


\chapter[permanentchanges]{Permanent changes}
\section[definecommands]{Creating new commands}

You can create your own commands to place events and periods on the timeline with \tex{definechronoevent} and \tex{definechronoperiode}.

\startalignment[middle]
\starttypingTEX
\definechronoperiode{1.}[...=...]
\definechronoevent{1.}[...=...]
\stoptypingTEX
\stopalignment

\starttabulate[|l|l|]
\NC \color[blue] 1. \NC name for the creation of the new command\FR
\NC \color[blue] ...=... \NC options of the type of command defined (see \in[Personnalisation])\FR
\stoptabulate

\blank
N.B.: in \CONTEXT, the syntax is 

\startalignment[middle]
\starttypingTEX
\definechronoperiode[1.][...=...]
\definechronoevent[1.][...=...]
\stoptypingTEX
\stopalignment

The commands \tex{chrono<name of the command>} are now defined. For instance,

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


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

\section[setupdefaultvalues]{Modify the default values}
You can apply changes on default values with using \tex{setupchronology},\crlf \tex{setupchronoevent} and \tex{setupchronoperiode}. You use the 
same name for each option you want to change. 
\index{setupchronology}\index{setupchronoevent} \index{setupchronoperiode}.

\startalignment[middle]
\starttypingTEX
\setupchrono<text>[...]{1.}
\stoptypingTEX
\stopalignment

\starttabulate[|l|l|]
\NC \color[blue] <text> \NC \type{periode} \em or \type{event} or \type{logy} or \type{graduation}\FR
\NC \color[blue] ...\NC name of the command to customize (except for \tex{setupchronology}, and\FR
\NC \NC for\tex{setupchronograduation} it is the style of the graduation ; see \in[definecommands])\FR
\NC \color[blue] 1. \NC options (see \in[Personnalisation])\FR
\stoptabulate

N.B.: Again, in \CONTEXT, the syntax is :

\startalignment[middle]
\starttypingTEX
\setupchrono<text>[...][1.]
\stoptypingTEX
\stopalignment

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

If it is not given, the changes will affect \type {\chronoperiode} and \tex{chronoevent} , otherwise they will affect the command given in
option.

For example, 

\starttypingTEX
\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
\stoptypingTEX

\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\bigskip
\bigskip N.B.: if you want to reapply the automatic colour's alternation of the periods, use 

\startalignment[middle]
\starttypingTEX
\setupchronoperiode{color=\chronoperiodcolor}
\stoptypingTEX
\stopalignment

\setupchronoperiode[color=\chronoperiodcolor]
\startchronology
\chronograduation{250}
\chronoperiode{1050}{1450}{Anything you want}
\chronoperiode{1800}{1899}{19\high{th} century}
\chronoevent{1600}{Anything else}
\stopchronology

\completeindex
\midaligned{\button{Go to table of contents}[content]}
\midaligned{\button{Exit}[ExitViewer]}
\stoptext