Debian Codegraph @

texmf-dist/doc/generic/chronosys/docchronosys_en.tex

raw
1 % This is is the code for the english documentation of the `chronosys' package.
2 %
3 % The maintener of this work is Mathieu Long.
4 % email : [email protected]
5 % the `chronosys' package consists in the 9 files :
6 % -- `docchronosys_en.tex' and `docchronosys_en.pdf' (english manual)
7 % -- `docchronosys_fr.tex' and `docchronosys_fr.pdf' (french manual)
8 % -- README
9 % -- `chronosys.tex' (file for plain TeX)
10 % -- `chronosyschr.tex' (main file of the `chronosys' package)
11 % -- `chronosys.sty' (file for LaTeX)
12 % -- `x-chronosys.tex' (file for ConTeXt)
13 %
14 % This work may be distributed and/or modified under the
15 % conditions of the LaTeX Project Public License, either version 1.3
16 % of this license or (at your option) any later version.
17 % The latest version of this license is in
18 % http://www.latex-project.org/lppl.txt
19 % and version 1.3 or later is part of all distributions of LaTeX
20 % version 2005/12/01 or later.
21 %
22 % This work has the LPPL maintenance status `maintained'.
23 %
24 % The Current Maintainer of this work is Mathieu Long.
25 %
26 \setupinteraction[title=Chronosys - Documentation, author=Mathieu Long, title=Chronosys documentation -english-, subtitle=Draw timelines]
27 \setupcolors[state=start]
28 \unless\ifdefined\XeTeXpicfile \unless\ifdefined\directlua
29 \setupoutput[pdftex]
30 \fi\fi
31 \setupheadertexts%
32 [chapter][section]
33 \setupheader[text][style=\ss]
34 \enableregime[utf8]
35 \mainlanguage[en]
36 \setupbodyfont[14pt,regular]
37 \setuppapersize[B4]
38 \setupinteraction[state=start,color=middlered]
39 \setupcapitals[sc=yes]
40 \setupindenting[yes,20pt]
41 \setuppagenumbering[location={bottom,right},left=--~]
42
43 \definetyping[typingTEX][option=TEX]
44 \setuptyping[typingTEX][color=darkblue]
45 \setupcolors[state=start]
46 \useURL[MetaPost_TUG][http://www.tug.org/docs/metapost/mpman.pdf]
47 \useURL[Tikz_CTAN][http://mirror.ctan.org/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf]
48 \starttext
49
50 \startmode[mkiv]
51 \def\METAPOST{MetaPost}
52 \stopmode
53
54
55 \placebookmarks[chapter,section,subsection][chapter,section]
56 \usemodule[chronosys]
57 \startstandardmakeup\switchtobodyfont[myface,16pt]
58 \midaligned{Chronosys}
59 \midaligned{Draw timelines diagrams !}
60 \bigskip
61 \startchronology[width=\hsize,height=7ex,stopyear=\numexpr\year+38\relax,startyear=1982,color=darkgreen]
62 \chronoevent{2011}{\type{chronosys}'s creation}
63 \stopchronology
64 \bigskip\bigskip
65 \midaligned{Mathieu \sc Long}
66 \midaligned{\color[darkgreen][email protected]}
67 \stopstandardmakeup
68 \completecontent[level=subsection,interaction=pagenumber]
69
70 \def\HeadTitle#1#2%
71 {\hbox to \hsize
72 { \vbox{\hrule\par\noindent\vrule height1.15cm depth0pt\leaders\hrule\hskip10pt \lower5pt\vbox{\hbox{ #1\hskip10pt#2 }}\leaders\hrule\hfill\vrule height1.15cm depth0pt}
73 }}
74 \setuphead[chapter][command=\HeadTitle]
75 \setupbodyfont[14pt]
76 \parskip 1cm
77 \chapter{Introduction}
78
79 \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.
80 \blank
81 \unprotect
82 This package is version {\unprotect\chron@sysversion\protect}, others versions might be created later.
83 \bigskip
84 It is recommended not to load the \type{color.tex} file if you use plain \TeX.
85 \bigskip
86
87 You can load \type{chronosys} by~:
88 \startitemize[4]
89 \item \tex{usemodule[chronosys]} in \CONTEXT.
90 \item \tex{usepackage{chronosys}} in \LaTeX.
91 \item \tex{input chronosys} in plain \TeX.
92 \stopitemize
93
94 \subject{updates' history}
95 \startitemize[1]
96 \item 1.10 :
97 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.
98 \item 1.15 : added possibility to create owns new commands, to graduate automatically the timeline, change the alternation of colours
99 periods and fixes some compatibility issues.
100 \item 1.2 (actual version) : reduces the use of the module \type{tikz} at least possible, remove the former limitation of the impossibility of
101 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
102 conversely, reuse \type {tikz} instead of \METAPOST{}) using the commands \tex{chronoswitchtomodeMP} and \tex{chronoswitchtomodeTikz}~; with
103 the Mark IV version using \METAPOST{} default.
104
105 \stopitemize
106
107 \blank
108
109 \hairline
110 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.
111
112 \blank
113 \hrule
114
115 \chapter{First use}
116
117 \section{Main function: \tex{startchronology}}
118
119 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 :
120
121 \startalignment[middle]
122 \starttypingTEX
123 \startchronology[...=...]
124 \stoptypingTEX
125 \stopalignment
126 \leftaligned{\switchtobodyfont[12.4pt] See \in[startchronologyoptions] to have the different possible options}
127 \blank[small]
128 The next one is \tex{stopchronology}\index{stopchronology}\footnote{or \tex{end}\arg{chronology}}, it ends the timeline.
129
130 \startalignment[middle]
131 \starttypingTEX
132 \stopchronology
133 \stoptypingTEX
134 \stopalignment
135
136 Let's have a look on the result~:
137 \starttypingTEX
138 \startchronology
139 \stopchronology
140 \stoptypingTEX
141
142 \startchronology
143 \stopchronology
144 \bigskip
145 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]).
146 \blank[small]Now let's learn how to add events on the timeline.
147
148 \section[event]{Events: \tex{chronoevent}}
149
150 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.
151
152 \startalignment[middle]
153 \starttypingTEX
154 \chronoevent[...=...]{1.}{2.}
155 \stoptypingTEX
156 \stopalignment
157
158 \starttabulate[|l|l|]
159 \NC \color[darkblue]\tt...=...\NC options (see \in[eventoptions])\NC\NR
160 \NC \color[darkblue]1. \NC date ({\em number})\NC\NR
161 \NC \color[darkblue]2. \NC label \NC\NR
162 \stoptabulate
163
164 \blank[small]
165 For instance:
166 \starttypingTEX
167 \startchronology
168 \chronoevent{1977}{\TeX's creation}
169 \stopchronology
170 \stoptypingTEX
171 \startchronology
172 \chronoevent{1977}{\TeX's creation}
173 \stopchronology
174 \bigskip
175 The event appears between {\os 0} et {\os\the\year}, proportionally with his gap with {\os0}. You can also give several events:
176
177 \starttypingTEX
178 \startchronology
179 \chronoevent{476}{Fall of the Roman empire}
180 \chronoevent{1492}{Discovery of America}
181 \chronoevent{1969}{first steps on the Moon}
182 \stopchronology
183 \stoptypingTEX
184
185 \switchtobodyfont[9pt]
186 \startchronology
187 \chronoevent{476}{Fall of the Roman empire}
188 \chronoevent{1492}{Discovery of America}
189 \chronoevent{1969}{first steps on the Moon}
190 \stopchronology
191 \switchtobodyfont[14pt]
192 \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
193
194 \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
195 the timeline, especially the starting year and ending year, will be seen further(see \in[startchronologyoptions]).
196
197 \section[period]{Periods: \tex{chronoperiode}}
198
199 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}.
200
201 \startalignment[middle]
202 \starttypingTEX
203 \chronoperiode[...=...]{1.}{2.}{3.}
204 \stoptypingTEX
205 \stopalignment
206 \starttabulate[|l|l|]
207 \NC \tt\color[darkblue]...=...\NC options (see \in[periodoptions])\NC\NR
208 \NC \color[darkblue]1. \NC date of the beginning ({\em number})\NC\NR
209 \NC \color[darkblue]2. \NC date of the end ({\em number}) \NC\NR
210 \NC\color[darkblue]3. \NC label \NC\NR
211 \stoptabulate
212
213 \starttypingTEX
214 \startchronology
215 \chronoperiode{1000}{1999}{2\high{nd} Millennium}
216 \chronoperiode{192}{476}{Eastern Roman Empire}
217 \chronoevent{1969}{first steps on the Moon}
218 \stopchronology
219 \stoptypingTEX
220 \switchtobodyfont[9pt]
221 \startchronology
222 \chronoperiode{1000}{1999}{2\high{nd} Millennium}
223 \chronoperiode{192}{476}{Eastern Roman Empire}
224 \chronoevent{1969}{first steps on the Moon}
225 \stopchronology
226 \switchtobodyfont[14pt]
227 \blank
228 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.
229
230 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]).
231
232 \section[chronograduation]{Automatic graduation : \tex{chronograduation}}
233
234 Use \tex{chronograduation} to add a graduation on the timeline.
235
236 \startalignment[middle]
237 \starttypingTEX
238 \chronograduation[style][...=...]{1.}
239 \stoptypingTEX
240 \stopalignment
241
242 \starttabulate[|l|l|]
243 \NC \color[blue] \type{style} \NC \type{periode} \em or \type{event}\FR
244 \NC \color[blue] ...=... \NC options (see \in[chronoperiodsoptions] et \in[chronoeventsoptions]) \FR
245 \NC \color[blue] 1. \NC interval ({\em number})\FR
246 \stoptabulate
247
248 \starttypingTEX
249 \startchronology
250 \chronograduation{100}
251 \stopchronology
252 \startchronology
253 \chronograduation[periode][dateselevation=0pt]{100}
254 \stopchronology
255 \stoptypingTEX
256 \startchronology
257 \chronograduation[][]{100}
258 \stopchronology
259 \startchronology
260 \chronograduation[periode][dateselevation=\z@]{100}
261 \stopchronology
262
263 \chapter[Personnalisation]{Time-lines' customization}
264
265 \section{\tex{startchronology}}
266 \subsection{Example}
267 \tex{startchronology} can have an optional argument in brackets.
268 For example:
269
270 \starttypingTEX
271 \startchronology
272 [startyear=-800,stopyear=500,
273 color=darkblue,height=7ex,width=\hsize]
274 \chronoevent{-753}{Rome's foundation}
275 \stopchronology
276 \stoptypingTEX
277 \startchronology
278 [startyear=-800,stopyear=500,color=darkblue,height=7ex,width=\hsize]
279 \chronoevent{-753}{Rome's foundation}
280 \stopchronology
281 \bigskip
282
283 \subsection{Different options}
284 The different options of \tex{startchronology}\index{startchronology} are:
285 \startitemize
286 \head \type{startyear}\index{startyear} :\par starting year of the timeline. It needs to be a valid \type{number}. It is by default {\os0}
287 \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.
288 \head \type{color}\index{color} :\par colour of the frieze. It must be a valid \type{colour}. It is black by default.
289 \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.
290 \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.
291 \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.
292 \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.
293 \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.
294 \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.
295 \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.
296 \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.
297 \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.
298 \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.
299 \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.
300 \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.
301 \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.
302
303 \stopitemize
304 \subsection[startchronologyoptions]{Summary}
305 \placetable[here][fig:startchronologyoptions]{\type{startchronology}'s options}
306 \starttable[|l|c|l|]
307 \HL\VL\use{3}\ReFormat[cB]{\tex{startchronology[}\em ...=...\type{]}}\VL\SR
308 \VL\type{startyear} \NC=\NC\type{<number>}
309 \VL\FR\VL
310 \type{stopyear} \NC=\NC\type{<number>}\VL\FR
311 \VL
312 \type{color} \NC=\NC\type{<colour>}\VL\FR
313 \VL
314 \type{height} \NC=\NC\type{<dimen>}\VL\FR
315 \VL
316 \type{width} \NC=\NC\type{<dimen>}\VL\FR
317 \VL
318 \type{datesstyle} \NC=\NC\type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\FR
319 \VL
320 \type{dateselevation} \NC=\NC\type{<dimen>}\VL\FR
321 \VL
322 \type{startdate} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\FR
323 \VL\type{stopdate} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\FR
324 \VL\type{dates} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\FR
325 \VL\type{arrow} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\FR
326 \VL\type{arrowheight} \NC=\NC\type{<dimen>}\VL\FR
327 \VL\type{arrowwidth} \NC=\NC\type{<dimen>}\VL\FR
328 \VL\type{arrowcolor} \NC=\NC\type{<colour>}\VL\FR
329 \VL\type{box} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\FR
330 \VL\type{align} \NC=\NC\type{<right>} {\em or} \type{<center>} {\em or} \type{<left>}\VL\FR\HL
331 \stoptable
332
333 \page[yes]
334 \section{\tex{chronoperiode}}
335 \subsection{Example}
336 \tex{chronoperiode} can have an optional argument for the options' customization.
337 \starttypingTEX
338 \startchronology[startyear=-800,stopyear=500,
339 color=darkgreen, height=3cm]
340 \chronoperiode[color=orange,bottomdepth=1cm, topheight=2cm,
341 textstyle=\it, dateselevation=-15pt, ifcolorbox=false,
342 box=true]{-753}{-509}{Roman Royal period}
343 \chronoperiode[color=cyan,startdate=false, textstyle=\bf,
344 textdepth=35pt, bottomdepth=1cm, topheight=2cm,
345 ifcolorbox=false, dateselevation=-15pt,
346 box=true]{-509}{-27}{Roman Republic}
347 \stopchronology
348 \stoptypingTEX
349 \startchronology[startyear=-800,stopyear=500,color=darkgreen, height=3cm]
350 \chronoperiode[color=orange,bottomdepth=1cm, topheight=2cm, textstyle=\it, dateselevation=-15pt, ifcolorbox=false, box=true]{-753}{-509}{Roman Royal period}
351 \chronoperiode[color=cyan,startdate=false, textstyle=\bf,textdepth=35pt, bottomdepth=1cm, topheight=2cm, ifcolorbox=false, dateselevation=-15pt, box=true]{-509}{-27}{Roman Republic}
352 \stopchronology
353
354 \subsection{The colour of the background}
355
356 \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]).
357
358 \subsection{Colours alternation}
359
360 As we saw, the colour of the periods alternates between blue, red, cyan, purple and yellow. You can define your own colours alternation
361 with \crlf\tex{chronoperiodecoloralternation}\index{chronoperiodecoloralternation}.
362
363 \startalignment[middle]
364 \starttypingTEX
365 \chronoperiodecoloralternation{1.}
366 \stoptypingTEX
367 \stopalignment
368
369 \starttabulate[|l|l|]
370 \NC\color[darkblue] 1. \NC colours ({\em\type{colour}, \type{colour},... \type{colour}})\FR
371 \stoptabulate
372
373 \blank[big]
374
375 Example:
376
377 \starttypingTEX
378 \chronoperiodecoloralternation{orange, darkgreen,
379 violet, purple, cyan}
380 \startchronology
381 \chronoperiode[startdate=false]{0}{500}{}
382 \chronoperiode[startdate=false]{500}{1000}{}
383 \chronoperiode[startdate=false]{1000}{1500}{}
384 \stopchronology
385 \stoptypingTEX
386
387 \restartchronoperiodecolor
388 \startchronology
389 \chronoperiodecoloralternation{orange, darkgreen,
390 violet, purple, cyan}
391 \chronoperiode[startdate=false]{0}{500}{}
392 \chronoperiode[startdate=false]{500}{1000}{}
393 \chronoperiode[startdate=false]{1000}{1500}{}
394 \stopchronology
395
396 You can also restart the alternation at the beginning or on a specific colour with\crlf
397 \tex{restartchronoperiodecolor}\index{restartchronoperiodecolor}.
398
399 \startalignment[middle]
400 \starttypingTEX
401 \restartchronoperiodecolor[...]
402 \stoptypingTEX
403 \stopalignment
404
405 \starttabulate[|l|l|]
406 \NC\color[darkblue] ... \NC name of a colour of the alternation ({\em colour})\FR
407 \stoptabulate
408
409 \subsection[chronoperiodsoptions]{Different options}
410
411 The different options of \tex{chronoperiode}\index{chronoperiode} are:
412
413 \startitemize
414 \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.
415 \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.
416 \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.
417 \head \type{datesstyle}\index{datesstyle} : \par style to apply to the dates. It must be a
418
419 \noindent\type{control sequence} or \type{control sequence#1} and is empty by default.
420 \head \type{textstyle}\index{textstyle} : \par style to apply to the label. It must be a \type{control sequence} or
421
422 \noindent\type{control sequence#1} and is empty by default.
423 \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.
424 \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.
425 \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.
426 \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.
427 \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.
428 \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.
429 \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.
430 \stopitemize
431
432 \subsection[periodoptions]{Summary}
433
434 \placetable[here][fig:chronoperiodeoptions]{\type{chronoperiode}'s options}
435 \starttable[|l|c|l|]
436 \HL\VL\use{3}\ReFormat[cB]{\tex{chronoperiode[}\em ...=...\type{]{...}{...}{...}}}\VL\SR
437 \VL\type{startdate} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\LR
438 \VL\type{stopdate} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\LR
439 \VL\type{dates} \NC=\NC\type{<true>} {\em or} \type{<false>}\VL\LR
440 \VL\type{datesstyle} \NC=\NC\type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\LR
441 \VL\type{textstyle} \NC=\NC\type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\LR
442 \VL\type{color} \NC=\NC\type{<colour>}\VL\LR
443 \VL\type{dateselevation} \NC=\NC\type{<dimen>}\VL\LR
444 \VL\type{textdeph} \NC=\NC\type{<dimen>}\VL\LR
445 \VL\type{ifcolorbox}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
446 \VL\type{colorbox} \NC =\NC \type{<colour>} \VL\FR
447 \VL\type{topheight} \NC =\NC \type{<dimen>}\VL\FR
448 \VL\type{bottomdepth} \NC =\NC \type{<dimen>}\VL\FR\HL
449 \stoptable
450
451 \page[yes]
452
453 \section{\tex{chronoevent}}
454
455 \tex{chronoevent} can also have an optional argument for customization.
456
457 \subsection{Example}
458
459 \starttypingTEX
460 \def\MyIcon{{\color{orange}\vrule width 5pt height5pt\relax}}
461
462 \catcode`\@=11
463 \def\chron@selectmonth#1{\ifcase#1\or January\or February\or
464 March\or April\or May\or June\or July\or August\or
465 September\or October\or November\or December\fi}
466
467 \startchronology[startyear=-800,stopyear=500,
468 color=darkgreen,height=7ex]
469 \chronoevent[textstyle=\bf,
470 datesstyle=\it,datesseparation=/,conversionmonth=false,
471 icon=\MyIcon,year=false, textwidth=4.5cm]{15/3/-44}
472 {\qquad ides of March;\endgraf
473 assassination of Caesar}
474 \stopchronology
475 \stoptypingTEX
476 \def\MyIcon{{\color[orange]\vrule width 5pt height5pt\relax}}
477 \catcode`\@=11
478 \def\chron@selectmonth#1{\ifcase#1\or January\or February\or
479 March\or April\or May\or June\or July\or August\or September\or
480 October\or November\or December\fi}
481
482 \startchronology[startyear=-800,stopyear=500,color=darkgreen,height=7ex]
483 \chronoevent[textstyle=\bf,datesstyle=\it,datesseparation=/,conversionmonth=false,icon=\MyIcon,year=false, textwidth=4.5cm]{15/3/-44}
484 {\qquad ides of March; \endgraf assassination of Caesar}
485 \stopchronology
486
487 \subsection{Specificities}
488 \subsubsection{The colour box of the text}
489
490 As for the periods, to avoid vertical straight to overlap the others labels, as you can see there, if you wanted to type :
491 \starttypingTEX
492 \startchronology
493 \chronoevent{1500}{Label A}
494 \chronoevent{1525}{Label B}
495 \stopchronology
496 \stoptypingTEX
497 \startchronology
498 \chronoevent{1500}{Label A}
499 \chronoevent[markdepth=70pt,ifcolorbox=false]{1525}{Label B}
500 \stopchronology
501 \type{chronosys} place a white colour box behind the text, so that you can have
502
503 \startchronology
504 \chronoevent[markdepth=70pt]{1525}{Label B}
505 \chronoevent{1500}{Label A}
506 \stopchronology
507
508 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]).
509
510 \subsubsection[eventnewdate]{A new way for specifying the date}
511
512 You can specify with more precision the date with \tex{chronoevent}\index{chronoevent}. We saw that typing
513 \tex{chronoevent}\arg{-44}\arg{Assassination of Caesar} specified the year of the event, now we will saw the way of specifying
514 the month and the day. You have to type \type{<day number>/<number of the month>/year}, only specifying the year is compulsory.
515
516 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:
517 \starttypingTEX
518 \def\chron@selectmonth#1{\ifcase#1\or janvier\or f\'evrier\or
519 mars\or avril\or mai\or juin\or juillet\or ao\^ut\or
520 septembre\or octobre\or novembre\or d\'ecembre\fi}
521 \stoptypingTEX
522
523 To change the language, you only need to redefine the control sequence, for example for English as:
524 \starttypingTEX
525 \def\chron@selectmonth#1{\ifcase#1\or January\or February\or
526 March\or April\or May\or June\or
527 July\or August\or September\or
528 October\or November\or December\fi}
529 \stoptypingTEX
530 \bigskip
531 For example,
532 \starttypingTEX
533 \catcode`\@=11
534 \def\chron@selectmonth#1{\ifcase#1\or January\or February\or
535 March\or April\or May\or June\or
536 July\or August\or September\or
537 October\or November\or December\fi}
538 \startchronology[startyear=-44,
539 stopyear=-43,color=darkgreen,height=7ex]
540 \chronoevent{15/03/-44}{Assassination of Caesar}
541 \stopchronology
542 \stoptypingTEX
543 \catcode`\@=11
544 \def\chron@selectmonth#1{\ifcase#1\or January\or February\or
545 March\or April\or May\or June\or July\or August\or September\or
546 October\or November\or December\fi}
547
548 \startchronology[startyear=-44,stopyear=-43,color=darkgreen,height=7ex]
549 \chronoevent{15/03/-44}{Assassination of Caesar}
550 \stopchronology
551 \blank
552
553 \subsection[chronoeventsoptions]{Different options}
554
555 Here are the different possible options\index{chronoevent}.
556 \startitemize[1]
557 \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.
558 \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.
559 \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.
560 \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.
561 \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.
562 \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.
563 \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.
564 \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.
565 \head \type{textstyle}\index{textstyle} :\par style to apply to the label. It must be a \type{control sequence} or
566
567 \noindent\type{control sequence#1}.
568 \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.
569 \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}.
570 \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}.
571 \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.
572 \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.
573 \head \type{textwidth}\index{textwidth} :\par
574 Width of the label on the page.
575 It must be a valid \type{dimen}.
576 \stopitemize
577
578 \subsection[eventoptions]{Summary}
579
580 \placetable[here][fig:chronoeventoptions]{\type{chronoevent}'s options}
581 \starttable[|l|c|l|]
582 \HL\VL\use{3}\ReFormat[cB]{\tex{chronoevent[}\em ...=...\type{]{...}{...}}}\VL\SR
583 \VL\type{barre}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
584 \VL\type{date}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
585 \VL\type{conversionmonth}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
586 \VL\type{mark}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
587 \VL\type{icon}\NC=\NC \type{<text>} {\em or} \type{<control sequence>} \bf\dots\VL\FR
588 \VL\type{datesseparation}\NC=\NC \type{<text>} {\em or} \type{<control sequence>} \bf\dots\VL\FR
589 \VL\type{markdepth}\NC=\NC \type{<dimen>}\VL\FR
590 \VL\type{iconheight}\NC=\NC \type{<dimen>}\VL\FR
591 \VL\type{textstyle}\NC=\NC \type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\FR
592 \VL\type{datestyle}\NC=\NC \type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\FR
593 \VL\type{datesstyle}\NC=\NC \type{<control sequence>} {\em or} \type{<control sequence#1>}\VL\FR
594 \VL\type{ifcolorbox}\NC=\NC \type{<true>} {\em or} \type{<false>}\VL\FR
595 \VL\type{colorbox} \NC =\NC \type{<colour>} \VL\FR
596 \VL\type{textwidth} \NC =\NC \type{<dimen>}\VL\FR\HL
597 \stoptable
598
599 \page[yes]
600
601
602 \chapter[permanentchanges]{Permanent changes}
603 \section[definecommands]{Creating new commands}
604
605 You can create your own commands to place events and periods on the timeline with \tex{definechronoevent} and \tex{definechronoperiode}.
606
607 \startalignment[middle]
608 \starttypingTEX
609 \definechronoperiode{1.}[...=...]
610 \definechronoevent{1.}[...=...]
611 \stoptypingTEX
612 \stopalignment
613
614 \starttabulate[|l|l|]
615 \NC \color[blue] 1. \NC name for the creation of the new command\FR
616 \NC \color[blue] ...=... \NC options of the type of command defined (see \in[Personnalisation])\FR
617 \stoptabulate
618
619 \blank
620 N.B.: in \CONTEXT, the syntax is
621
622 \startalignment[middle]
623 \starttypingTEX
624 \definechronoperiode[1.][...=...]
625 \definechronoevent[1.][...=...]
626 \stoptypingTEX
627 \stopalignment
628
629 The commands \tex{chrono<name of the command>} are now defined. For instance,
630
631 \starttypingTEX
632 \definechronoperiode{MyPeriod}[color=yellow, textstyle=\it]
633 \definechronoevent{MyEvent}[textstyle=\it, barre=false]
634 \startchronology[color=darkgreen]
635 \chronoMyPeriod{100}{500}{Something}
636 \chronoMyEvent{800}{Anything else}
637 \stopchronology
638 \stoptypingTEX
639
640
641 \definechronoperiode[MyPeriod] [color=yellow, textstyle=\it]
642 \definechronoevent[MyEvent][textstyle=\it, barre=false]
643 \startchronology[color=darkgreen]
644 \chronoMyPeriod{100}{500}{Something}
645 \chronoMyEvent{800}{Anything else}
646 \stopchronology
647
648 \section[setupdefaultvalues]{Modify the default values}
649 You can apply changes on default values with using \tex{setupchronology},\crlf \tex{setupchronoevent} and \tex{setupchronoperiode}. You use the
650 same name for each option you want to change.
651 \index{setupchronology}\index{setupchronoevent} \index{setupchronoperiode}.
652
653 \startalignment[middle]
654 \starttypingTEX
655 \setupchrono<text>[...]{1.}
656 \stoptypingTEX
657 \stopalignment
658
659 \starttabulate[|l|l|]
660 \NC \color[blue] <text> \NC \type{periode} \em or \type{event} or \type{logy} or \type{graduation}\FR
661 \NC \color[blue] ...\NC name of the command to customize (except for \tex{setupchronology}, and\FR
662 \NC \NC for\tex{setupchronograduation} it is the style of the graduation ; see \in[definecommands])\FR
663 \NC \color[blue] 1. \NC options (see \in[Personnalisation])\FR
664 \stoptabulate
665
666 N.B.: Again, in \CONTEXT, the syntax is :
667
668 \startalignment[middle]
669 \starttypingTEX
670 \setupchrono<text>[...][1.]
671 \stoptypingTEX
672 \stopalignment
673
674 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}).
675
676 If it is not given, the changes will affect \type {\chronoperiode} and \tex{chronoevent} , otherwise they will affect the command given in
677 option.
678
679 For example,
680
681 \starttypingTEX
682 \setupchronology{startyear=1000,color=darkblue,stopdate=false}
683 \setupchronoperiode{color=darkgreen}
684 \setupchronoevent{textstyle=\it}
685 \setupchronograduation[event]{markdepth=2cm}
686 \startchronology
687 \chronograduation{250}
688 \chronoperiode{1050}{1450}{Anything you want}
689 \chronoevent{1600}{Anything else}
690 \chronoperiode{1800}{1899}{19\high{th} century}
691 \stopchronology
692 \stoptypingTEX
693
694 \setupchronology[startyear=1000,color=darkblue,stopdate=false]
695 \setupchronoperiode[color=darkgreen]
696 \setupchronoevent[textstyle=\it]
697 \setupchronograduation[event][markdepth=2cm]
698 \startchronology
699 \chronograduation{250}
700 \chronoperiode{1050}{1450}{Anything you want}
701 \chronoevent{1600}{Anything else}
702 \chronoperiode{1800}{1899}{19\high{th} century}
703 \stopchronology\bigskip
704 \bigskip N.B.: if you want to reapply the automatic colour's alternation of the periods, use
705
706 \startalignment[middle]
707 \starttypingTEX
708 \setupchronoperiode{color=\chronoperiodcolor}
709 \stoptypingTEX
710 \stopalignment
711
712 \setupchronoperiode[color=\chronoperiodcolor]
713 \startchronology
714 \chronograduation{250}
715 \chronoperiode{1050}{1450}{Anything you want}
716 \chronoperiode{1800}{1899}{19\high{th} century}
717 \chronoevent{1600}{Anything else}
718 \stopchronology
719
720 \completeindex
721 \midaligned{\button{Go to table of contents}[content]}
722 \midaligned{\button{Exit}[ExitViewer]}
723 \stoptext