diff options
author | Karl Berry <karl@freefriends.org> | 2012-05-28 22:27:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-05-28 22:27:04 +0000 |
commit | 097e14d036c498af65a65ad9501810a71477215f (patch) | |
tree | a0050d8c078ec8e008bcc7ee23eb5a87d8390f80 /Master/texmf-dist/tex/generic | |
parent | a3c59f0c6c658a1ea96c996c4ff141dae1e7277b (diff) |
chronosys (29may12)
git-svn-id: svn://tug.org/texlive/trunk@26700 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
4 files changed, 786 insertions, 351 deletions
diff --git a/Master/texmf-dist/tex/generic/chronosys/chronosys.sty b/Master/texmf-dist/tex/generic/chronosys/chronosys.sty index 5129513124f..8ce02a813f3 100644 --- a/Master/texmf-dist/tex/generic/chronosys/chronosys.sty +++ b/Master/texmf-dist/tex/generic/chronosys/chronosys.sty @@ -26,20 +26,22 @@ \NeedsTeXFormat{LaTeX2e} \RequirePackage{tikz} %\RequirePackage{xcolor} - \makeatletter\catcode`\!=11 \def\!chr@verif#1#2{\ifdefined#2\error!message \fi #1#2} % \input chronosyschr.tex - +% %\newenvironment{chronology}{\startchronology}{\stopchronology} -\let\starttikzpicture\tikzpicture \let\stoptikzpicture\endtikzpicture -\let\chronology\startchronology \let\endchronology\stopchronology -\def\!chrdefaultwidth{\textwidth} -\def\!chreventcolorbox{\colorbox{\!chr@eventcolorbox}} -\def\!chrperiodcolorbox{\colorbox{\!chr@periodcolorbox}} -\ProvidesPackage{chronosys} -\setupchronoevent[!!eventgradu@tion]{datesstyle=\tiny} -\setupchronoperiode[!!periodegradu@tion]{datesstyle=\tiny} +\!chrverif\let\chronology\startchronology \!chrverif\let\endchronology\stopchronology +\!chrverif\def\!chrstarttikzpicture{\tikzpicture}\!chrverif\def\!chrstoptikzpicture{\endtikzpicture}% +\!chrverif\def\!chrdraw{\draw}\!chrverif\def\!chrfill{\fill}\!chrverif\def\!chrfilldraw{\filldraw}% +\def\!chrdefaultwidth{\textwidth}% +\!chrverif\def\!chreventcolorbox{\colorbox{\!chr@eventcolorbox}}% +\!chrverif\def\!chrperiodcolorbox{\colorbox{\!chr@periodcolorbox}}% +\ProvidesPackage{chronosys}% +\setupchronoevent[!!eventgradu@tion]{datesstyle=\tiny}% +\setupchronoperiode[!!periodegradu@tion]{datesstyle=\tiny}% +\!chrverif\let\!chrusecolor\color +% \makeatother -\catcode`\!=12 +\catcode`\!=12\relax \endinput diff --git a/Master/texmf-dist/tex/generic/chronosys/chronosys.tex b/Master/texmf-dist/tex/generic/chronosys/chronosys.tex index be7967a9bc7..57a4cdd408b 100644 --- a/Master/texmf-dist/tex/generic/chronosys/chronosys.tex +++ b/Master/texmf-dist/tex/generic/chronosys/chronosys.tex @@ -23,34 +23,49 @@ % % The Current Maintainer of this work is Mathieu Long. % -\catcode`\@=11 +% % % % +%Changement de catcode +\catcode`\@=11\relax +% \unless\ifdefined\tikzpicture -\catcode`\!=12\input tikz.tex \relax\fi -\catcode`\!=11 +\catcode`\!=12\input tikz.tex\relax\fi +% +\catcode`\!=11\relax +% +%DEFINITION DE \!CHR@VERIF \let\!chr@verif\relax -\def\starttikzpicture{\tikzpicture} \def\stoptikzpicture{\endtikzpicture} -\def\!chrperiodcolorbox#1{% +% +%CHARGEMENT DE CHRONOSYSCHR +\input chronosyschr.tex\relax +% +%DEFINITION POUR MOTEUR DE DESSIN +\def\!chrstarttikzpicture{\tikzpicture}\def\!chrstoptikzpicture{\endtikzpicture}% +\!chrverif\def\!chrdraw{\draw}\!chrverif\def\!chrfill{\fill}\!chrverif\def\!chrfilldraw{\filldraw}% +% +% DEFINITION DES SSTEMES DE COLORISATION DU FOND DES EVENTS ET PERIODES +\!chrverif\def\!chrperiodcolorbox#1{% \setbox\z@ \hbox{\kern2pt#1\kern2pt}% \dimen@i\dp\z@ -\advance\dimen@i\ht\z@ \advance\dimen@i 6pt +\advance\dimen@i\ht\z@ \advance\dimen@i 6pt\relax \dimen@ii\wd\z@ -\advance\dimen@ii 4pt -\setbox\@ne\hbox{\tikz\fill[color=\!chr@periodcolorbox]% -(\z@,\z@)--(\dimen@ii,\z@)--(\dimen@ii,\dimen@i)--(\z@,\dimen@i); -\kern-\dimen@ii\box\z@}\raise0.5\dimen@ii\vbox to\z@{\box\@ne\vss}} - - -\def\!chreventcolorbox#1{% +\advance\dimen@ii 4pt\relax +\setbox\@ne\hbox{{\color{\!chr@periodcolorbox}% +\vrule height\dimen@i width\dimen@ii \relax% +\kern-\dimen@ii}\box\z@}\raise0.5\dimen@ii\vbox to\z@{\box\@ne\vss}}% +% +% +\!chrverif\def\!chreventcolorbox#1{% \setbox\z@ \hbox{\kern2pt#1\kern2pt}% \dimen@i\dp\z@ \advance\dimen@i\ht\z@ \dimen@ii\wd\z@ -\advance\dimen@ii 4pt -\setbox\@ne\hbox {\tikz\fill[color=\!chr@eventcolorbox]% -(\z@,\z@)--(\dimen@ii,\z@)--(\dimen@ii,\dimen@i)--(\z@,\dimen@i); -\kern-\dimen@ii\box\z@}\raise0.5\dimen@ii\vbox to\z@{\box\@ne\vss}} -\input chronosyschr.tex - -\catcode`\!=12 -\catcode`\@=12 +\advance\dimen@ii 4pt\relax +\setbox\@ne\hbox {{\color{\!chr@eventcolorbox}% +\vrule height\dimen@i width\dimen@ii depth\z@\relax% +\kern-\dimen@ii}\box\z@}\raise0.5\dimen@ii\vbox to\z@{\box\@ne\vss}}% +% +\!chrverif\let\!chrusecolor\color +% +\catcode`\!=12\relax +\catcode`\@=12\relax \endinput
\ No newline at end of file diff --git a/Master/texmf-dist/tex/generic/chronosys/chronosyschr.tex b/Master/texmf-dist/tex/generic/chronosys/chronosyschr.tex index 26ac5aab586..299c5a75aa0 100644 --- a/Master/texmf-dist/tex/generic/chronosys/chronosyschr.tex +++ b/Master/texmf-dist/tex/generic/chronosys/chronosyschr.tex @@ -25,152 +25,270 @@ % \expandafter\ifx\csname chronosys @\endcsname\relax\else\immediate\write16{Le fichier a deja ete charge}\endinput\fi \ifx\numexpr\UNDEFINED\immediate\write16{Desole, mais ce fichier utilise les primitives E-TeX, vous ne pouvez pas utiliser le moteur TeX.}\endinput\fi -\expandafter\edef\csname chronosys @\endcsname{\the\catcode`\@} -\def\chron@sysversion{1.15} -\catcode`\@=11 -\catcode`\!=11 - -\newhelp\chrhelpmessage{Contactez l'auteur par mail.} -\newhelp\chrerrormessage{La commande a deja ete definie.} +\expandafter\edef\csname chronosys @\endcsname{\the\catcode`\@}% +\catcode`\@=11% +\catcode`\!=11% +\def\chron@sysversion{1.2}% +% +\newhelp\chrhelpmessage{Contactez l'auteur par mail.}% +\newhelp\chrerrormessage{La commande a deja ete definie.}% \def\error!message{\errhelp{\the\chrhelpmessage}\errmessage{\the\chrerrormessage}} % % -\def\!chrverif#1#2{\ifdefined#2\expandafter\error!message \fi #1#2} % -% -\def\!gobblethree#1#2#3{} -\def\!gobble#1{} -\ifdefined\@ifnextchar \def\:{\let\ifnexttoken\@ifnextchar}\expandafter\:\else -\ifdefined\doifnextcharelse \def\:{\let\ifnexttoken\doifnextcharelse}\expandafter\:\else -\long\def\@ifnextchar#1#2#3{% - \let\reserved@d=#1% - \def\reserved@a{#2}% - \def\reserved@b{#3}% - \futurelet\@let@token\@ifnch} -\let\kernel@ifnextchar\@ifnextchar -\def\@ifnch{% - \ifx\@let@token\@sptoken - \let\reserved@c\@xifnch - \else - \ifx\@let@token\reserved@d - \let\reserved@c\reserved@a - \else - \let\reserved@c\reserved@b - \fi - \fi - \reserved@c} -\def\:{\let\@sptoken= } \: % this makes \@sptoken a space token -\def\:{\@xifnch} \expandafter\def\: {\futurelet\@let@token\@ifnch} +\def\!chrverif#1#2{\ifdefined#2\expandafter\error!message \fi #1#2}% +% +%Commandes utilis\'ees +% +% +\def\!gobblethree#1#2#3{}% +\def\!gobble#1{}% +\ifdefined\@ifnextchar %LATEX + \def\:{\let\ifnexttoken\@ifnextchar}\expandafter\: +\else + \ifdefined\doifnextcharelse %CONTEXT + \def\:{\let\ifnexttoken\doifnextcharelse}\expandafter\: + \else + \long\def\@ifnextchar#1#2#3{% + \let\reserved@d=#1% + \def\reserved@a{#2}% + \def\reserved@b{#3}% + \futurelet\@let@token\@ifnch}% + \let\kernel@ifnextchar\@ifnextchar + \def\@ifnch{% + \ifx\@let@token\@sptoken + \let\reserved@c\@xifnch + \else + \ifx\@let@token\reserved@d + \let\reserved@c\reserved@a + \else + \let\reserved@c\reserved@b + \fi + \fi + \reserved@c}% +\def\:{\let\@sptoken= }\: % this makes \@sptoken a space token +\def\:{\@xifnch}\expandafter\def\: {\futurelet\@let@token\@ifnch}% \let\ifnexttoken\@ifnextchar \fi\fi - +% \newif\if!chronearg \newif\if!chrtwoarg -\!chrverif\def\!chrtraiteoneargument#1{\ifnexttoken[{\!chroneargtrue#1}{\!chroneargfalse#1[]}} - +\!chrverif\def\!chrtraiteoneargument#1{\ifnexttoken[{\!chroneargtrue#1}{\!chroneargfalse#1[]}}% +% \!chrverif\def\!chrtraitetwoargument#1{\let\todoafterarg#1% -\ifnexttoken[{\!chroneargtrue\savefirsttwoarg}{\!chroneargfalse\!chrtwoargfalse#1[][]}} -\!chrverif\def\savefirsttwoarg[#1]{\ifnexttoken[{\!chrtwoargtrue \todoafterarg[#1]}{\!chrtwoargfalse \todoafterarg[#1][]}} - -\!chrverif\def\!chrtraitingargvirgule#1#2{\def\!tr@itintargvirgule{#2} \!chrtr@itingargvirgule#1,\end} -\!chrverif\def\!chrtr@itingargvirgule#1,{\!chrdotraiteargvirgule#1,=\end,\ifnexttoken\end\!gobble\!chrtr@itingargvirgule} -\!chrverif\def\!chrdotraiteargvirgule#1=#2,{\ifx\end#2\relax\else \!chrdotr@iteargvirgule#1=#2,\expandafter\!gobblethree\fi} -\!chrverif\def\!chrdotr@iteargvirgule#1=#2,{\ifcsname \!tr@itintargvirgule#1\endcsname \expandafter\def\csname \!tr@itintargvirgule#1\endcsname{#2} \else \immediate\write16{chronosys : option #1 non reconnue, impossible de lui affecter la valeur #2}\fi } - -\!chrverif\def\startchronology{\!chrtraiteoneargument\dostartchronology} - -\!chrverif\def\!chrdefaultstartyear{0} \!chrverif\def\!chrdefaultstopyear{\the\year} \!chrverif\def\!chrdefaultwidth{\the\hsize} % - \!chrverif\def\!chrdefaultheight{0.7pc} \!chrverif\def\!chrdefaultdates{true} \!chrverif\def\!chrdefaultarrow{true} \!chrverif\def\!chrdefaultarrowwidth{0.1\!chrwidth} -\!chrverif\def\!chrdefaultarrowheight{\!chrheight} \!chrverif\def\!chrdefaultcolor{black} \!chrverif\def\!chrdefaultarrowcolor{\!chr@color} -\!chrverif\def\!chrdefaultdatesstyle{} \!chrverif\def\!chrdefaultstartdate{true} \!chrverif\def\!chrdefaultstopdate{true} \!chrverif\def\!chrdefaultdateselevation{20pt} -\!chrverif\def\!chrdefaultbox{false} \!chrverif\def\!chrdefaultalign{center} - -\!chr@verif\newdimen\!chrheight \!chr@verif\newif\if!chrdates \!chr@verif\newif\if!chrarrow \!chr@verif\newcount\!chrstartyear \!chr@verif\newcount\!chrstopyear \!chr@verif\newdimen\!chrwidth \!chr@verif\newdimen\!chrarrowwidth \!chr@verif\newdimen\!chrarrowheight \!chr@verif\newbox\!chrflechebox +\ifnexttoken[{\!chroneargtrue\savefirsttwoarg}{\!chroneargfalse\!chrtwoargfalse#1[][]}}% +\!chrverif\def\savefirsttwoarg[#1]{\ifnexttoken[{\!chrtwoargtrue \todoafterarg[#1]}{\!chrtwoargfalse \todoafterarg[#1][]}}% +% +\!chrverif\def\!chrtraitingargvirgule#1#2{\def\!tr@itintargvirgule{#2}\!chrtr@itingargvirgule#1,\end}% +\!chrverif\def\!chrtr@itingargvirgule#1,{% +\!chrdotraiteargvirgule#1,=\end,\ifnexttoken\end \!gobble \!chrtr@itingargvirgule}% +\!chrverif\def\!chrdotraiteargvirgule#1=#2,{% +\ifx \end#2\relax +\else \!chrdotr@iteargvirgule#1=#2,\expandafter\!gobblethree +\fi}% +\!chrverif\def\!chrdotr@iteargvirgule#1=#2,{% +\ifcsname \!tr@itintargvirgule#1\endcsname + \expandafter\def\csname \!tr@itintargvirgule#1\endcsname{#2}% +\else \immediate\write16{chronosys : option #1 ligne \number\inputlineno\space non reconnue, impossible de lui affecter la valeur #2}% +\fi }% +% +%STARTCHRONOLOGY +% +\!chrverif\def\startchronology{\!chrtraiteoneargument\dostartchronology}% +% +%OPTIONS DE STARTCHRONOLOGY +% +\!chrverif\def\!chrdefaultstartyear{0}\!chrverif\def\!chrdefaultstopyear{\the\year}\!chrverif\def\!chrdefaultwidth{\the\hsize}% +\!chrverif\def\!chrdefaultheight{0.7pc}\!chrverif\def\!chrdefaultdates{true}\!chrverif\def\!chrdefaultarrow{true}% +\!chrverif\def\!chrdefaultarrowwidth{0.1\!chrwidth}\!chrverif\def\!chrdefaultdateselevation{20pt}% +\!chrverif\def\!chrdefaultarrowheight{\!chrheight}\!chrverif\def\!chrdefaultcolor{black}\!chrverif\def\!chrdefaultarrowcolor{\!chr@color}% +\!chrverif\def\!chrdefaultdatesstyle{}\!chrverif\def\!chrdefaultstartdate{true}\!chrverif\def\!chrdefaultstopdate{true}% +\!chrverif\def\!chrdefaultbox{false}\!chrverif\def\!chrdefaultalign{center}% +% +\!chr@verif\newdimen\!chrheight \!chr@verif\newif\if!chrdates \!chr@verif\newif\if!chrarrow \!chr@verif\newcount\!chrstartyear +\!chr@verif\newcount\!chrstopyear \!chr@verif\newdimen\!chrwidth \!chr@verif\newdimen\!chrarrowwidth \!chr@verif\newdimen\!chrarrowheight +\!chr@verif\newbox\!chrflechebox \!chr@verif\newdimen\!chr!realwidth \!chr@verif\newdimen\!chr!unitperyear \!chr@verif\newif\if!chrstartdate \!chr@verif\newif\if!chrstopdate \!chr@verif\newdimen\!chrdateselevation \!chr@verif\newif\if!chrbox - -\!chrverif\def\!chr!periodeschwarzodergrau{\def\!chr!stringtest{black}\ifx\!chr@color\!chrstringtest\def\!chr!periodeschwarzodergr@u{gray}\else\def\!chr!periodeschwarzodergr@u{black}\fi} - +% +\!chrverif\def\!chr!periodeschwarzodergrau{\def\!chr!stringtest{black}% +\ifx\!chr@color\!chrstringtest + \def\!chr!periodeschwarzodergr@u{gray}% +\else + \def\!chr!periodeschwarzodergr@u{black}% +\fi}% +% +% +\!chr@verif\newdimen\!chrskipbefore +\!chr@verif\newdimen\!chrskipafter +% \!chrverif\def\!chrdefaultoptions{startyear=\!chrdefaultstartyear, stopyear=\!chrdefaultstopyear, startdate=\!chrdefaultstartdate, stopdate=\!chrdefaultstopdate, height=\!chrdefaultheight, width=\!chrdefaultwidth, dates=\!chrdefaultdates, arrow=\!chrdefaultarrow, arrowwidth=\!chrdefaultarrowwidth, arrowheight=\!chrdefaultarrowheight, color=\!chrdefaultcolor, arrowcolor=\!chrdefaultarrowcolor, datesstyle=\!chrdefaultdatesstyle, dateselevation=\!chrdefaultdateselevation, -box=\!chrdefaultbox, align=\!chrdefaultalign} - -\!chrverif\def\!chr@startyear{} \!chrverif\def\!chr@startdate{}% -\!chrverif\def\!chr@stopyear{} \!chrverif\def\!chr@stopdate{} -\!chrverif\def\!chr@height{} \!chrverif\def\!chr@width{} +box=\!chrdefaultbox, align=\!chrdefaultalign}% +% +\!chrverif\def\!chr@startyear{}\!chrverif\def\!chr@startdate{}% +\!chrverif\def\!chr@stopyear{}\!chrverif\def\!chr@stopdate{}% +\!chrverif\def\!chr@height{}\!chrverif\def\!chr@width{}% \!chrverif\def\!chr@dates{true}% -\!chrverif\def\!chr@arrow{} \!chrverif\def\!chr@arrowwidth{} \!chrverif\def\!chr@arrowheight{} -\!chrverif\def\!chr@color{} -\!chrverif\def\!chr@arrowcolor{} \!chrverif\def\!chr@datesstyle{} +\!chrverif\def\!chr@arrow{}\!chrverif\def\!chr@arrowwidth{}\!chrverif\def\!chr@arrowheight{}% +\!chrverif\def\!chr@color{}% +\!chrverif\def\!chr@arrowcolor{}\!chrverif\def\!chr@datesstyle{}% \!chrverif\def\!chr@dateselevation{}% -\!chrverif\def\!chr@box{} \!chrverif\def\!chr@align{}% - +\!chrverif\def\!chr@box{}\!chrverif\def\!chr@align{}% +% +%DOSTARTCHRONOLOGY +% \!chrverif\def\dostartchronology[#1]{\begingroup\parindent\z@\par -\expandafter\expandafter\expandafter\!chrtraitingargvirgule\expandafter{\!chrdefaultoptions}{!chr@} -\if!chronearg \!chrtraitingargvirgule{#1}{!chr@}\fi \!chrheight\!chr@height \!chrstartyear\!chr@startyear \!chrstopyear\!chr@stopyear \!chrwidth\!chr@width % -\csname !chrdates\!chr@dates\endcsname \csname !chrarrow\!chr@arrow\endcsname \csname !chrstartdate\!chr@startdate\endcsname -\csname !chrbox\!chr@box\endcsname % -\csname !chrstopdate\!chr@stopdate\endcsname \!chrarrowwidth\!chr@arrowwidth \!chrarrowheight\!chr@arrowheight \!chrdateselevation\!chr@dateselevation% +\global\!chrskipafter\z@ +\global\!chrskipbefore\z@ +\expandafter\expandafter\expandafter\!chrtraitingargvirgule\expandafter{\!chrdefaultoptions}{!chr@}% +\if!chronearg \!chrtraitingargvirgule{#1}{!chr@}\fi +\!chrheight\!chr@height \!chrstartyear\!chr@startyear +\!chrstopyear\!chr@stopyear \!chrwidth\!chr@width % +\csname !chrdates\!chr@dates\endcsname \csname !chrarrow\!chr@arrow\endcsname +\csname !chrstartdate\!chr@startdate\endcsname \csname !chrbox\!chr@box\endcsname +\csname !chrstopdate\!chr@stopdate\endcsname \!chrarrowwidth\!chr@arrowwidth +\!chrarrowheight\!chr@arrowheight \!chrdateselevation\!chr@dateselevation% \!chr!periodeschwarzodergrau% -\dostartchronologyfinal} - -\!chrverif\def\dostartchronologyfinal{\unless\if!chrarrow\!chrarrowwidth\z@\relax\!chrarrowheight\z@\fi\!chr!realwidth\dimexpr\!chrwidth-\!chrarrowwidth\relax \ifdim\!chr!realwidth<0pt \advance\!chrwidth\dimen@ \advance\!chrarrowwidth-\!chr!realwidth \!chr!realwidth\z@\fi % +\dostartchronologyfinal}% +% +\!chrverif\def\dostartchronologyfinal{% +\unless\if!chrarrow + \!chrarrowwidth\z@\relax \!chrarrowheight\z@ +\fi +\!chr!realwidth\dimexpr\!chrwidth-\!chrarrowwidth\relax +\ifdim\!chr!realwidth<0pt\relax + \advance\!chrwidth\dimen@ + \advance\!chrarrowwidth-\!chr!realwidth + \!chr!realwidth\z@ +\fi \dimen@\dimexpr\!chrheight-\!chrarrowheight\relax -\dimen@ii\dimen@\relax\ifdim\dimen@ii>0pt\relax\dimen@ii\z@\fi \dimen@i\dimexpr\!chrheight-\dimen@ii+\!chrdateselevation\relax% -% % +\dimen@ii\dimen@\relax +\ifdim\dimen@ii>0pt\relax + \dimen@ii\z@ +\fi +\dimen@i\dimexpr\!chrheight-\dimen@ii+\!chrdateselevation\relax +% % %AFFICHAGE DE LA FRISE \setbox\!chrflechebox\hbox{% -\if!chrdates\if!chrstartdate\raise\dimen@i\relax % % -\hbox to\z@{\hss\!chr@datesstyle{\the\!chrstartyear}\hss}\fi\fi% -\starttikzpicture\filldraw[color=\!chr@color](0,0)--(\!chr!realwidth,0)--(\!chr!realwidth,\!chrheight)--(0,\!chrheight)--cycle;\if!chrbox\draw[color=black](-0.4pt,-0.4pt)--(\!chr!realwidth+0.4pt,-0.4pt)--(\!chr!realwidth+0.4pt,\!chrheight+0.4pt)--(-0.4pt,\!chrheight)--cycle;\fi % -\if!chrarrow\ifx\!chr@color\!chr@arrowcolor\else\draw[color=\!chr!periodeschwarzodergr@u](\!chr!realwidth,0)--(\!chr!realwidth,\!chrheight);\fi\fi\stoptikzpicture % -\if!chrdates\if!chrstopdate\raise\dimen@i\hbox to\z@{\hss\!chr@datesstyle{\the\!chrstopyear}\hss}\fi\fi% -% -\if!chrarrow\raise0.5\dimen@\hbox{\starttikzpicture\filldraw[color=\!chr@arrowcolor](0,0.5\!chrarrowheight)--(\!chrarrowwidth,0)--(0,-0.5\!chrarrowheight)--cycle;\if!chrbox\draw[color=black](-0.4pt,0.5\!chrarrowheight+0.4pt)--(\!chrarrowwidth+0.4pt,0)--(-0.4pt,-0.5\!chrarrowheight-0.4pt)--cycle;\fi \stoptikzpicture}\fi}% -\count@\numexpr\!chrstopyear-\!chrstartyear\relax \ifnum\count@<0\relax\immediate\write16{Erreur avec les dates donn\'ees}\fi \!chr!unitperyear\dimexpr\!chr!realwidth/\count@\relax} - - -\!chrverif\def\setupchronology#1{\!chrtraitingargvirgule{#1}{!chrdefault}} + \if!chrdates + \if!chrstartdate\raise\dimen@i\relax % % + \hbox to\z@{\hss\!chr@datesstyle{\the\!chrstartyear}\hss}% + \fi + \fi% +% \!chrstarttikzpicture\!chrfilldraw[color=\!chr@color](0,0)--(\the\!chr!realwidth,0)--(\the\!chr!realwidth,\the\!chrheight)--(0,\the\!chrheight)--cycle; +% \if!chrbox +% \!chrdraw[color=black](-0.4pt,-0.4pt)--(\the\!chr!realwidth+0.4pt,-0.4pt)--(\the\!chr!realwidth+0.4pt,\the\!chrheight+0.4pt)--(-0.4pt,\the\!chrheight)--cycle; +% \fi % +% \if!chrarrow +% \ifx\!chr@color\!chr@arrowcolor +% \else \!chrdraw[color=\!chr!periodeschwarzodergr@u](\the\!chr!realwidth,0)--(\the\!chr!realwidth,\the\!chrheight); +% \fi +% \fi +% \!chrstoptikzpicture % + \begingroup{% + \!chrusecolor{\!chr@color}% + \vrule width\!chr!realwidth height\!chrheight depth\z@\relax \kern-\!chr!realwidth\relax + \if!chrbox + \!chrusecolor{black}% + \hbox to\z@{\vrule width\!chr!realwidth height0.4pt\relax\hss}% + \raise\!chrheight\hbox to\z@{\vrule width\!chr!realwidth height0.4pt\relax\hss}% + \vrule height\!chrheight depth\z@\relax\kern-0.4pt\relax + \kern\!chr!realwidth \vrule height\!chrheight\relax\kern-0.4pt\relax + \kern-\!chr!realwidth + \fi + %\if!chrarrow + %\fi + \kern\!chr!realwidth + }% + \endgroup + \if!chrdates + \if!chrstopdate + \raise\dimen@i\hbox to\z@{\hss\!chr@datesstyle{\the\!chrstopyear}\hss}% + \fi + \fi% +% + \if!chrarrow + \raise0.5\dimen@\hbox{% + \!chrstarttikzpicture + \!chrfilldraw[color=\!chr@arrowcolor](0,0.5*\the\!chrarrowheight-0.4pt)--(\the\!chrarrowwidth,0)--(0,-0.5*\the\!chrarrowheight)--cycle; + \if!chrbox + \!chrdraw[color=black](-0.4pt,0.5*\the\!chrarrowheight+0.4pt)--(\the\!chrarrowwidth+0.4pt,0)--(-0.4pt,-0.5*\the\!chrarrowheight-0.4pt)--cycle; + \fi + \!chrstoptikzpicture + \edef\@@string@a{\!chr@color}% + \edef\@@string@b{\!chr@arrowcolor}% + \ifx\@@string@a\@@string@b + \else + {\!chrusecolor{\!chr!periodeschwarzodergr@u}% + \kern-\!chrarrowwidth\kern-0.2pt\relax \hbox to\z@{\vrule height\dimexpr(\!chrarrowheight-\!chrheight)/2 + \!chrheight\relax depth\dimexpr(\!chrheight-\!chrarrowheight)/2\relax\hss}% + \kern\!chrarrowwidth\kern-0.2pt\relax}% + \fi + }% + \fi}% + \count@\numexpr\!chrstopyear-\!chrstartyear\relax + \ifnum\count@<0\relax + \immediate\write16{Erreur avec les dates donn\'ees}% + \fi + \!chr!unitperyear\dimexpr\!chr!realwidth/\count@\relax}% +% +% +\!chrverif\def\setupchronology#1{\!chrtraitingargvirgule{#1}{!chrdefault}}% +% +%PERIODES +% \!chr@verif\newcount\!chr!periodecolornum\!chr@verif\newcount\!chr!starttingtraitement \!chr@verif\newdimen\!chr!dimentraitement -\!chr@verif\newdimen\!chrperiodtextdepth \!chrverif\def\!chrperiodedefaulttextdepth{15pt} +\!chr@verif\newdimen\!chrperiodtextdepth \!chrverif\def\!chrperiodedefaulttextdepth{15pt}% \!chr@verif\newif\if!chrperioddates \!chr@verif\newif\if!chrperiodbox \!chr@verif\newif\if!chrperiodstartdate \!chr@verif\newif\if!chrperiodstopdate \!chrverif\def\!chrperiodedefaultstartdate{true} \!chr@verif\newif\if!chrperiodifcolorbox \!chr@verif\newdimen\!chrperioddateselevation \!chr@verif\newdimen\!chrperiodeventtextwidth \!chr@verif\newdimen\!chrperiodbottomdepth \!chr@verif\newdimen\!chrperiodtopheight - +% %alternance des couleurs \!chr@verif\newcount\!chrperiodecoloralternancetotalnum -\!chrverif\def\!chrperiodedefaultcolor{\chron@periodcolor} -\!chrverif\def\!chrperiodedefa@@ultcolor{\chron@periodcolor} -\!chrverif\def\!chrperiodedef@ultcolor{\!chrperiodedefaultcolor} -\!chrverif\def\chron@periodcolor{\ifcase\!chr!periodecolornum blue\or red\or cyan\or purple\or yellow\fi} +\!chrverif\def\!chrperiodedefaultcolor{\chronoperiodcolor}% +\!chrverif\def\!chrperiodedefa@@ultcolor{\chronoperiodcolor}% +\!chrverif\def\!chrperiodedef@ultcolor{\!chrperiodedefaultcolor}% +\!chrverif\def\chronoperiodcolor{\ifcase\!chr!periodecolornum blue\or red\or cyan\or purple\or yellow\fi}% \!chrperiodecoloralternancetotalnum5% -\!chrverif\def\!chr!periodecolor{\edef\!chrperiodedef@ultcolor{\!chrperiodedefaultcolor}\ifx\!chrperiodedefaultcolor\!chrperiodedefa@@ultcolor\ifx\!chrperiodedef@ultcolor\!chr@color\!chr!periodecoloradvance\!chr!periodecolor \fi\fi} +\!chrverif\def\!chr!periodecolor{\edef\!chrperiodedef@ultcolor{\!chrperiodedefaultcolor}% + \ifx\!chrperiodedefaultcolor\!chrperiodedefa@@ultcolor + \ifx\!chrperiodedef@ultcolor\!chr@color + \!chr!periodecoloradvance\!chr!periodecolor + \fi + \fi}% \!chrverif\def\!chr!periodecoloradvance{\global\advance\!chr!periodecolornum\@ne\relax -\ifnum\!chr!periodecolornum=\!chrperiodecoloralternancetotalnum\relax\global\!chr!periodecolornum\z@\fi} - -\!chrverif\def\restartchronoperiodecolor{\!chrtraiteoneargument\dorestartchronoperiodecolor} +\ifnum\!chr!periodecolornum=\!chrperiodecoloralternancetotalnum\relax\global\!chr!periodecolornum\z@\fi}% +% +\!chrverif\def\restartchronoperiodecolor{\!chrtraiteoneargument\dorestartchronoperiodecolor}% \!chrverif\def\dorestartchronoperiodecolor[#1]{% -\if!chronearg \def\@@string@a{#1}% -\!chr!periodecolornum\z@ % -\dorestartchronoperiodecolor@ux -\else\!chr!periodecolornum\z@\fi} -\!chrverif\def\dorestartchronoperiodecolor@ux{\edef\@@string@b{\chron@periodcolor}\ifnum\!chr!periodecolornum<\!chrperiodecoloralternancetotalnum -\unless\ifx\@@string@a\@@string@b -\global\advance\!chr!periodecolornum\@ne -\dorestartchronoperiodecolor@ux\fi\else\global\!chr!periodecolornum\z@\fi} - +\if!chronearg + \def\@@string@a{#1}% + \!chr!periodecolornum\z@ % + \dorestartchronoperiodecolor@ux +\else + \!chr!periodecolornum\z@ +\fi}% +\!chrverif\def\dorestartchronoperiodecolor@ux{\edef\@@string@b{\chronoperiodcolor}% +\ifnum\!chr!periodecolornum<\!chrperiodecoloralternancetotalnum + \unless\ifx\@@string@a\@@string@b + \global\advance\!chr!periodecolornum\@ne + \dorestartchronoperiodecolor@ux + \fi +\else\global\!chr!periodecolornum\z@\fi}% +% \!chrverif\def\chronoperiodecoloralternation#1{% \def\@@string@s{\ifcase\!chr!periodecolornum}% -\!chrperiodecoloralternancetotalnum\z@\!chr!chronoperiodecoloralternance#1,\end \let\chron@periodcolor\@@string@s} - +\!chrperiodecoloralternancetotalnum\z@\!chr!chronoperiodecoloralternance#1,\end \let\chronoperiodcolor\@@string@s +\!chr!periodecolornum\z@}% +% \!chrverif\def\!chr!chronoperiodecoloralternance#1,{\advance\!chrperiodecoloralternancetotalnum\@ne \expandafter\def\expandafter\@@string@s\expandafter{\@@string@s#1}% -\ifnexttoken\end{\expandafter\def\expandafter\@@string@s\expandafter{\@@string@s\fi}\!gobble}% -{\expandafter\def\expandafter\@@string@s\expandafter{\@@string@s\or}\!chr!chronoperiodecoloralternance}} - - +\ifnexttoken\end {\expandafter\def\expandafter\@@string@s\expandafter{\@@string@s\fi}\!gobble}% +{\expandafter\def\expandafter\@@string@s\expandafter{\@@string@s\or}\!chr!chronoperiodecoloralternance}}% +% +% \!chrverif\def\!chr@periodtextdepth{}\!chrverif\def\!chr@perioddates{}% \!chrverif\def\!chr@periodcolor{}\!chrverif\def\!chr@perioddatesstyle{}% \!chrverif\def\!chr@periodstartdate{}\!chrverif\def\!chr@periodstopdate{}% @@ -178,220 +296,475 @@ box=\!chrdefaultbox, align=\!chrdefaultalign} \!chrverif\def\!chr@perioddateselevation{}% \!chrverif\def\!chr@periodifcolorbox{}\!chrverif\def\!chr@periodcolorbox{}% \!chrverif\def\!chr@periodbottomdepth{}\!chrverif\def\!chr@periodtopheight{}% -\!chrverif\def\!chr@periodbox{}% - +\!chrverif\def\!chr@periodbox{}\!chrverif\def\!chr@periodtextwidth{}% +% +\!chrverif\def\!chreventdefaulttesttextwidth{\relax}% +% +%DOCHRONOPERIODE +% +% \!chrverif\def\dochronoperiode[#1]#2#3#4{% -\!chr!periodecolor -\if!chronearg -\!chrtraitingargvirgule{#1}{!chr@period}\fi +\!chr!periodecolor %alternance automqatique des couleurs +\if!chronearg \!chrtraitingargvirgule{#1}{!chr@period}\fi +% % % \!chrperiodtextdepth\!chr@periodtextdepth \!chrperiodtopheight\!chr@periodtopheight \!chrperiodbottomdepth\!chr@periodbottomdepth -\csname !chrperioddates\!chr@perioddates\endcsname \csname !chrperiodstartdate\!chr@periodstartdate\endcsname \csname !chrperiodstopdate\!chr@periodstopdate\endcsname -\csname !chrperiodifcolorbox\!chr@periodifcolorbox\endcsname +\csname !chrperioddates\!chr@perioddates\endcsname \csname !chrperiodstartdate\!chr@periodstartdate\endcsname +\csname !chrperiodstopdate\!chr@periodstopdate\endcsname \csname !chrperiodifcolorbox\!chr@periodifcolorbox\endcsname \csname !chrperiodbox\!chr@periodbox\endcsname -\!chrperioddateselevation\!chr@perioddateselevation \advance\!chrperioddateselevation 1.25\!chrheight\relax -\ifnum#2>\numexpr\!chrstartyear-1\relax\ifnum#2<\numexpr\!chrstopyear+1\relax\ifnum#3<\numexpr\!chrstopyear+1\relax \ifnum#3>\numexpr\!chrstartyear-1\relax\count@\numexpr#3-#2\relax\ifnum\count@>\z@\relax +\ifx\!chr@periodtextwidth\!chreventdefaulttesttextwidth + \!chrperiodeventtextwidth=-1pt% +\else + \!chrperiodeventtextwidth=\!chr@periodtextwidth% +\fi +\!chrperioddateselevation\!chr@perioddateselevation +\advance\!chrperioddateselevation 1.25\!chrheight\relax +% % %On s'assure que les dates sont biebn dans l'intervalle +\ifnum#2>\numexpr\!chrstartyear-1\relax +\ifnum#2<\numexpr\!chrstopyear+1\relax +\ifnum#3<\numexpr\!chrstopyear+1\relax +\ifnum#3>\numexpr\!chrstartyear-1\relax +\count@\numexpr#3-#2\relax +% % %Et que la seconde est post\'erieure \`a la pr\'emi\`ere +\ifnum\count@>\z@\relax +% % \!chr!starttingtraitement\numexpr#2-\!chrstartyear\relax\dimen@\dimexpr\count@\!chr!unitperyear\relax \!chr!dimentraitement\dimexpr\!chr!starttingtraitement\!chr!unitperyear\relax -% % +% %AFFICHAGE \dimen@i\wd\!chrflechebox -\setbox\!chrflechebox\hbox{\unhbox\!chrflechebox\kern-\dimen@i\kern\!chr!dimentraitement -\lower\dimexpr\!chrperiodtextdepth-\!chrperiodbottomdepth\relax\hbox to\z@ -{\hbox to\dimen@ -{\hss \if!chrperiodifcolorbox\expandafter\!chrperiodcolorbox\fi{\!chr@periodtextstyle{#4}}\hss}\hss}% -\if!chrperioddates\if!chrperiodstartdate -\raise\dimexpr\!chrperioddateselevation +(\!chrperiodtopheight-\!chrheight)\relax -\hbox to\z@{\hss\!chr@perioddatesstyle{#2}\hss}\fi\fi -\raise\!chrperiodbottomdepth \hbox{\starttikzpicture \filldraw [color=\!chr@periodcolor](\z@,\!chrperiodbottomdepth)--(\dimen@,\!chrperiodbottomdepth)--(\dimen@,\!chrperiodtopheight)--(\z@,\!chrperiodtopheight)--cycle;\draw[color=\!chr!periodeschwarzodergr@u](\z@,\!chrperiodbottomdepth)--(\z@,\!chrperiodtopheight);% -\draw [color=\!chr!periodeschwarzodergr@u](\dimen@,\!chrperiodbottomdepth)--(\dimen@,\!chrperiodtopheight);% -\if!chrbox\draw[color=black](\z@,-0.2pt)--(\dimen@,-0.2pt)\fi -\if!chrperiodbox \draw[color=black](\z@,\!chrperiodbottomdepth)--(\dimen@,\!chrperiodbottomdepth);% -\draw[color=black](\dimen@,\!chrperiodtopheight)--(\z@,\!chrperiodtopheight);\fi -\stoptikzpicture} -\if!chrperioddates\if!chrperiodstopdate -\raise\dimexpr\!chrperioddateselevation+(\!chrperiodtopheight-\!chrheight)\relax -\hbox to\z@ -{\hss \!chr@perioddatesstyle{#3}\hss}\fi\fi}\!chr!periodecoloradvance\fi\fi\fi\fi\fi} - - -\!chrverif\def\setupchronoperiode{\def\@@string@a{periode}\!chrtraiteoneargument\dosetupchronoeventandperiode} - - +\setbox\!chrflechebox\hbox{% + \unhbox\!chrflechebox\kern-\dimen@i\kern\!chr!dimentraitement + \lower\dimexpr\!chrperiodtextdepth-\!chrperiodbottomdepth\relax\hbox to\z@{% + \ifdim\!chrperiodeventtextwidth < \z@ \hbox to\dimen@{% + \hss \if!chrperiodifcolorbox\expandafter\!chrperiodcolorbox\fi{\!chr@periodtextstyle{#4}}\hss + }% + \else + \setbox\z@\hbox to\dimen@{\hss\vbox{% + \hsize\!chrperiodeventtextwidth {\!chr@periodtextstyle{#4}} + }\hss}% + \dimen@i\wd\z@ + \dimen@ii\dimexpr\ht\z@+\dp\z@\relax + \lower\dimexpr\dimen@ii-10pt\relax\hbox to\dimen@{% + \hss\setbox\z@\hbox{% + \vbox{% + \hsize\!chrperiodeventtextwidth\relax\!chr@periodtextstyle{#4}% + \vskip1pt + }% + }% + \dimen@i\dimexpr\wd\z@+4pt\relax + \dimen@ii\dimexpr\ht\z@+\dp\z@+2pt\relax + \setbox\z@\hbox to\z@{% + \hss\begingroup{\!chrusecolor{\!chr@periodcolorbox}\vrule height\dimen@ii width\dimen@i depth2pt}\endgroup\kern-\dimen@i\kern2pt\relax% + \box\z@\hss + }% + \box\z@\hss + }% + \fi + \hss + }% + \if!chrperioddates + \if!chrperiodstartdate + \raise\dimexpr\!chrperioddateselevation +(\!chrperiodtopheight-\!chrheight)\relax + \hbox to\z@{% + \hss\!chr@perioddatesstyle{#2}\hss + }% + \fi + \fi + \raise\!chrperiodbottomdepth \hbox{% + \begingroup {\!chrusecolor{\!chr@periodcolor}% + \dimen@i\dimexpr\!chrperiodtopheight-\!chrperiodbottomdepth\relax% + \vrule width\dimen@ height\dimen@i depth\z@\kern-\dimen@% +% \!chrusecolor{black}% +% \raise\dimen@i\hbox to\z@{\vrule height0.1pt depth0.3pt width\dimen@\hss}% +% \hbox to\z@{\vrule height0.1pt depth0.3pt width\dimen@\hss}% + }\endgroup%% + \begingroup{% + \dimen@i\dimexpr\!chrperiodtopheight-\!chrperiodbottomdepth\relax% + \!chrusecolor{\!chr!periodeschwarzodergr@u}% + \kern-0.2pt\relax\vrule height\dimen@i width0.4pt\relax \kern-0.2pt\relax% + \kern\dimen@\relax + \kern-0.2pt\relax\vrule height\dimen@i width0.4pt\relax \kern-0.2pt\relax + \kern-\dimen@\relax + }% + \endgroup + \begingroup{% + \!chrusecolor{black} + \if!chrbox + \lower 0.2pt\hbox to\z@{\vrule width\dimen@\hss}% + \fi + \if!chrperiodbox + \raise \!chrperiodbottomdepth \hbox to\z@{\vrule width\dimen@\hss}% + \raise \!chrperiodtopheight \hbox to\z@{\vrule width\dimen@\hss}% + \fi + }% + \endgroup + \kern\dimen@\relax + }% + \if!chrperioddates + \if!chrperiodstopdate + \raise\dimexpr\!chrperioddateselevation+(\!chrperiodtopheight-\!chrheight)\relax + \hbox to\z@{% + \hss \!chr@perioddatesstyle{#3}\hss + }% + \fi + \fi +}% +\!chr!periodecoloradvance +\fi\fi\fi\fi\fi}% +% +% +\!chrverif\def\setupchronoperiode{\def\@@string@a{periode}\!chrtraiteoneargument\dosetupchronoeventandperiode}% +% +%EVENTS +% +% \!chr@verif\newif\if!chreventspecifiedday\!chr@verif\newif\if!chreventspecifiedmonth \!chr@verif\newif\if!chreventbarre \!chr@verif\newif\if!chreventdate \!chr@verif\newif\if!chreventmark \!chr@verif\newif\if!chreventifcolorbox \!chr@verif\newif\if!chreventconversionmonth \!chr@verif\newdimen\!chreventmarkdepth \!chr@verif\newif\if!chreventyear \!chr@verif\newdimen\!chreventiconheight - \!chrverif\def\!chreventdefaultbarre{true} -\!chrverif\def\!chreventdefaulticon{} -\!chrverif\def\!chreventdefaultmarkdepth{10pt} -\!chrverif\def\!chreventdefaulttextstyle{} - - - \!chrverif\def\!chreventdefaulttesttextwidth{\relax} - -\!chrverif\def\!chreventevalspecification#1{\count@\z@\relax\!chreventev@lspecification#1/\end} -\!chrverif\def\!chreventev@lspecification#1/{\advance\count@\@ne\relax\expandafter\def\csname !chreventspecifiedargument\number\count@\endcsname{#1}\ifnexttoken\end\!gobble\!chreventev@lspecification} - -\!chrverif\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} - -\!chrverif\def\!chr@eventbarre{} \!chrverif\def\!chr@eventicon{} \!chrverif\def\!chr@eventmarkdepth{}% -\!chrverif\def\!chr@eventtextstyle{} \!chrverif\def\!chr@eventmark{}% -\!chrverif\def\!chr@eventdate{} \!chrverif\def\!chr@eventdatesseparation{}% -\!chrverif\def\!chr@eventconversionmonth{} \!chrverif\def\!chr@eventdatestyle{}% -\!chrverif\def\!chr@eventdatesstyle{} \!chrverif\def\!chr@eventyear{} \!chrverif\def\!chr@eventiconheight{}% -\!chrverif\def\!chr@eventifcolorbox{} \!chrverif\def\!chr@eventcolorbox{}%. + \!chrverif\def\!chreventdefaultbarre{true}% +\!chrverif\def\!chreventdefaulticon{}% +\!chrverif\def\!chreventdefaultmarkdepth{10pt}% +\!chrverif\def\!chreventdefaulttextstyle{}% +% +% +% +\!chrverif\def\!chreventevalspecification#1{\count@\z@\relax\!chreventev@lspecification#1/\end}% +\!chrverif\def\!chreventev@lspecification#1/{\advance\count@\@ne\relax\expandafter\def\csname +!chreventspecifiedargument\number\count@\endcsname{#1}\ifnexttoken\end \!gobble \!chreventev@lspecification}% +% +\!chrverif\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}% +% +\!chrverif\def\!chr@eventbarre{}\!chrverif\def\!chr@eventicon{}\!chrverif\def\!chr@eventmarkdepth{}% +\!chrverif\def\!chr@eventtextstyle{}\!chrverif\def\!chr@eventmark{}% +\!chrverif\def\!chr@eventdate{}\!chrverif\def\!chr@eventdatesseparation{}% +\!chrverif\def\!chr@eventconversionmonth{}\!chrverif\def\!chr@eventdatestyle{}% +\!chrverif\def\!chr@eventdatesstyle{}\!chrverif\def\!chr@eventyear{}\!chrverif\def\!chr@eventiconheight{}% +\!chrverif\def\!chr@eventifcolorbox{}\!chrverif\def\!chr@eventcolorbox{}%. \!chrverif\def\!chr@eventtextwidth{}% - +% +\!chr@verif\newif\if!chreventlocationup +% +% +%DOCHRONOEVENT +% +% \!chrverif\def\dochronoevent[#1]#2#3{% \if!chronearg \!chrtraitingargvirgule{#1}{!chr@event}\fi +% % % \csname !chreventbarre\!chr@eventbarre\endcsname \csname !chreventmark\!chr@eventmark\endcsname \csname !chreventdate\!chr@eventdate\endcsname \csname !chreventconversionmonth\!chr@eventconversionmonth\endcsname \csname !chreventyear\!chr@eventyear\endcsname \csname !chreventifcolorbox\!chr@eventifcolorbox\endcsname -\!chreventmarkdepth\!chr@eventmarkdepth \!chreventiconheight\!chr@eventiconheight -\ifx\!chr@eventtextwidth\!chreventdefaulttesttextwidth \!chrperiodeventtextwidth=-1pt% -\else \!chrperiodeventtextwidth\!chr@eventtextwidth\fi -\!chreventevalspecification{#2}\ifnum\count@<4\relax -\ifcase\count@\or\!chreventspecifieddayfalse\!chreventspecifiedmonthfalse -\edef\!chreventyear{\csname !chreventspecifiedargument1\endcsname}\or \!chreventspecifieddayfalse\!chreventspecifiedmonthtrue -\edef\!chreventyear{\csname !chreventspecifiedargument2\endcsname}\edef\!chreventmonth{\csname !chreventspecifiedargument1\endcsname}% -\or \!chreventspecifieddaytrue\!chreventspecifiedmonthtrue -\edef\!chreventyear{\csname !chreventspecifiedargument3\endcsname}\edef\!chreventmonth{% -\csname !chreventspecifiedargument2\endcsname}\edef\!chreventday{\csname !chreventspecifiedargument1\endcsname}\fi % -\ifnum\!chreventyear>\numexpr\!chrstartyear-1\relax\ifnum\!chreventyear<\numexpr\!chrstopyear+1\relax -\if!chreventspecifiedmonth\if!chreventspecifiedday \count@\numexpr\!chreventday+\!chreventmonth*30\relax\else % -\count@\numexpr\!chreventmonth*30\relax\fi\else\count@\z@\fi % -\!chr!dimentraitement\dimexpr(\!chr!unitperyear)/365*\count@\relax% -\count@\numexpr\!chreventyear-\!chrstartyear\relax \advance\!chr!dimentraitement\dimexpr\count@\!chr!unitperyear\relax -% % -\dimen@i\wd\!chrflechebox -\setbox\!chrflechebox\hbox{\unhbox\!chrflechebox\kern-\dimen@i\kern\!chr!dimentraitement -\if!chreventbarre -\starttikzpicture \draw[color=black](0,0)--(0,\!chrheight); \stoptikzpicture \fi -\kern-0.4pt\raise\!chreventiconheight \hbox to\z@{\hss\!chr@eventicon\hss}\lower\dimexpr\!chreventmarkdepth+2pt\relax\hbox to\z@{\vbox -to\z@{\ifdim\!chreventmarkdepth<0pt\relax\vss\fi -\if!chreventdate\hbox to\z@ -{\hss \if!chreventifcolorbox \expandafter\!chreventcolorbox\fi {\!chr@eventdatestyle{\if!chreventspecifiedday % -{\!chr@eventdatesstyle{\!chreventday}}\!chr@eventdatesseparation\fi{\!chr@eventdatesstyle{\if!chreventspecifiedmonth -\if!chreventconversionmonth\expandafter \chron@selectmonth\fi \!chreventmonth\fi}}\if!chreventspecifiedmonth\if!chreventyear \!chr@eventdatesseparation\fi\fi \if!chreventyear{\!chr@eventdatesstyle{\!chreventyear}}\fi% -}}\hss}\fi -\ifdim\!chrperiodeventtextwidth > \z@ -\vbox to \z@{ -\hbox to\z@{\hss\setbox\z@\hbox{\vbox -{\hsize\!chrperiodeventtextwidth\relax\!chr@eventtextstyle{#3}}}% -\dimen@i\wd\z@ -\dimen@ii\dimexpr\ht\z@+\dp\z@\relax -\setbox\z@\hbox to\z@{\hss\starttikzpicture \fill[color=\!chr@eventcolorbox]% -(\z@,\z@)--(\dimen@i,\z@)--(\dimen@i,\dimen@ii)--(\z@,\dimen@ii);\stoptikzpicture\kern-\dimen@i -\box\z@\hss}\box\z@}\vss} -\else \hbox to\z@ -{\hss\if!chreventifcolorbox\expandafter\!chreventcolorbox\fi{% -\!chr@eventtextstyle{#3}}\hss}% -\fi \ifdim\!chreventmarkdepth>0pt\relax\vss\fi}}\if!chreventmark\ifdim\!chreventmarkdepth<0pt\starttikzpicture \draw(0,0)--(0,\!chreventmarkdepth+5pt);\stoptikzpicture\else \vrule height0pt depth\!chreventmarkdepth\fi\fi -\setbox0\vbox{\if!chreventdate\hbox{#2}\fi\hbox{% -\ifdim\!chrperiodeventtextwidth > \z@ \vbox {\hsize\!chrperiodeventtextwidth #3}% -\else #3\fi }}\lower\dimexpr\dp0+\ht0+\!chreventmarkdepth+2pt\relax\hbox{}% -} -\fi\fi\fi} - -\!chrverif\def\setupchronoevent{\def\@@string@a{event}\!chrtraiteoneargument\dosetupchronoeventandperiode} +\!chreventmarkdepth\!chr@eventmarkdepth +\!chreventiconheight\!chr@eventiconheight +\ifx\!chr@eventtextwidth\!chreventdefaulttesttextwidth + \!chrperiodeventtextwidth=-1pt% +\else \!chrperiodeventtextwidth\!chr@eventtextwidth +\fi +\ifdim\!chreventmarkdepth<\z@\relax + \!chreventlocationuptrue +\else + \!chreventlocationupfalse +\fi +% % % Evaluation de la precision de la date de l'evenement +\!chreventevalspecification{#2}% +\ifnum\count@<4\relax + \ifcase\count@ + \or \!chreventspecifieddayfalse\!chreventspecifiedmonthfalse + \edef\!chreventyear{\csname !chreventspecifiedargument1\endcsname}% + \or \!chreventspecifieddayfalse\!chreventspecifiedmonthtrue + \edef\!chreventyear{\csname !chreventspecifiedargument2\endcsname}% + \edef\!chreventmonth{\csname !chreventspecifiedargument1\endcsname}% + \or \!chreventspecifieddaytrue\!chreventspecifiedmonthtrue + \edef\!chreventyear{\csname !chreventspecifiedargument3\endcsname}% + \edef\!chreventmonth{\csname !chreventspecifiedargument2\endcsname}% + \edef\!chreventday{\csname !chreventspecifiedargument1\endcsname}% + \fi % +% %On s'assure que les dates sont bien comprises dans les bornes +\ifnum\!chreventyear>\numexpr\!chrstartyear-1\relax +\ifnum\!chreventyear<\numexpr\!chrstopyear+1\relax + \if!chreventspecifiedmonth + \if!chreventspecifiedday + \count@\numexpr\!chreventday+\!chreventmonth*30\relax + \else % + \count@\numexpr\!chreventmonth*30\relax + \fi + \else \count@\z@ + \fi % + \!chr!dimentraitement\dimexpr(\!chr!unitperyear)/365*\count@\relax% + \count@\numexpr\!chreventyear-\!chrstartyear\relax + \advance\!chr!dimentraitement\dimexpr\count@\!chr!unitperyear\relax +% % % Affichage + \dimen@i\wd\!chrflechebox + \setbox\!chrflechebox\hbox{% + \unhbox\!chrflechebox\kern-\dimen@i\kern\!chr!dimentraitement + \if!chreventbarre + \begingroup{% + \!chrusecolor{black}% + \kern-0.4pt\relax\vrule width0.4pt height\!chrheight depth\z@\relax + }% + \endgroup + \fi + \kern-0.4pt\raise\!chreventiconheight \hbox to\z@{\hss\!chr@eventicon\hss}% + \lower\dimexpr\!chreventmarkdepth+2pt\relax + \hbox to\z@{% + \vbox to\z@{% + \if!chreventlocationup\relax\vss\fi + \if!chreventdate\hbox to\z@{% + \hss \if!chreventifcolorbox \expandafter\!chreventcolorbox\fi + {\!chr@eventdatestyle{% + \if!chreventspecifiedday % + {\!chr@eventdatesstyle{\!chreventday}}\!chr@eventdatesseparation + \fi + {\!chr@eventdatesstyle{% + \if!chreventspecifiedmonth + \if!chreventconversionmonth\expandafter \chron@selectmonth + \fi + \!chreventmonth + \fi + }% + }% + \if!chreventspecifiedmonth\if!chreventyear \!chr@eventdatesseparation\fi\fi + \if!chreventyear{\!chr@eventdatesstyle{\!chreventyear}}\fi% + }}% + \hss + }% + \fi + \ifdim\!chrperiodeventtextwidth > \z@ + \hbox to\z@{% + \hss\setbox\z@\hbox{% + \vbox{% + \hsize\!chrperiodeventtextwidth\relax\!chr@eventtextstyle{#3}% + \vskip1pt\relax + }% + }% + \dimen@i\dimexpr\wd\z@+4pt\relax + \dimen@ii\dimexpr\ht\z@+\dp\z@+2pt\relax + \setbox\z@\hbox to\z@{% + \hss\begingroup{\!chrusecolor{\!chr@eventcolorbox}\vrule height\dimen@ii width\dimen@i depth2pt\relax}\endgroup \kern-\dimen@i\kern2pt\relax% + \box\z@\hss + }% + \box\z@ + }% + \else + \hbox to\z@{% + \hss\if!chreventifcolorbox\expandafter\!chreventcolorbox\fi{% + \!chr@eventtextstyle{#3}}\hss + }% + \fi + \unless\if!chreventlocationup\relax\vss\fi + }% + }% + \if!chreventmark + \if!chreventlocationup\relax + %\!chrstarttikzpicture \!chrdraw(0,0)--(0,\the\!chreventmarkdepth+5pt);\!chrstoptikzpicture + \vrule height\dimexpr-\!chreventmarkdepth-5pt\relax depth\z@ \kern-0.4pt\relax + \else \vrule height\z@ depth\!chreventmarkdepth + \fi + \kern-0.4pt\relax + \fi + \setbox0\vbox{% + \if!chreventdate + \hbox{#2}% + \fi + \hbox{% + \ifdim\!chrperiodeventtextwidth > \z@ + \vbox {% + \hsize\!chrperiodeventtextwidth #3% + }% + \else #3% + \fi + }% + }% + \begingroup\dimen@\dimexpr\dp0+\ht0+2pt\relax + \dimen@i\dimexpr\dimen@-\!chreventmarkdepth\relax + \if!chreventlocationup + \ifdim \dimen@i >\!chrskipbefore \global\!chrskipbefore\dimen@i \fi + \else + \ifdim \dimen@ >\!chrskipafter \global\!chrskipafter\dimen@ \fi + \fi + \endgroup + }% +\fi\fi\fi}% +% +% +% +% +% +% +% +\!chrverif\def\setupchronoevent{\def\@@string@a{event}\!chrtraiteoneargument\dosetupchronoeventandperiode}% \!chrverif\def\dosetupchronoeventandperiode[#1]#2{\if!chronearg -\def\@@string@a{#1}\fi \!chr@parcoursoptions#2,\end} - +\def\@@string@a{#1}\fi \!chr@parcoursoptions#2,\end}% +% +%STOPCHRONOLOGY +% +% \!chr@verif\newdimen\!chrstopwidth -\!chrverif\def\!chrstopcenteralign{\!chrstopwidth\dimexpr(\hsize-\!chrwidth)/2\relax} -\!chrverif\def\!chrstopleftalign{\!chrstopwidth\z@} -\!chrverif\def\!chrstoprightalign{\!chrstopwidth\dimexpr\hsize-\!chrwidth\relax} - -\!chrverif\def\stopchronology{\goodbreak\ifcsname !chrstop\!chr@align align\endcsname \csname !chrstop\!chr@align align\endcsname \else\!chrstopwidth\z@\fi \moveright\!chrstopwidth\box\!chrflechebox\endgroup\bigskip} - +\!chrverif\def\!chrstopcenteralign{\!chrstopwidth\dimexpr(\hsize-\!chrwidth)/2\relax}% +\!chrverif\def\!chrstopleftalign{\!chrstopwidth\z@}% +\!chrverif\def\!chrstoprightalign{\!chrstopwidth\dimexpr\hsize-\!chrwidth\relax}% +% +\!chrverif\def\stopchronology{\goodbreak +\ifcsname !chrstop\!chr@align align\endcsname + \csname !chrstop\!chr@align align\endcsname +\else\!chrstopwidth\z@ +\fi +\vskip\!chrskipbefore +\moveright\!chrstopwidth\box\!chrflechebox +\vskip\!chrskipafter +\endgroup\bigskip}% +% \!chr@verif\newif\if!chrverifdefines -\!chrverif\def\!chrverifdefines{\ifcsname chrono\@@string@a\endcsname \!chrverifdefinesfalse \immediate\write16{Attention : macro \expandafter\noexpand\csname chrono\@@string@a\endcsname deja definie.}\expandafter\!gobble \else\!chrverifdefinestrue\expandafter\!chrverifdefines@ux\fi} -\!chrverif\def\!chrverifdefines@ux{\expandafter\def\csname chrono\@@string@a\endcsname} - +\!chrverif\def\!chrverifdefines{% + \ifcsname chrono\@@string@a\endcsname + \!chrverifdefinesfalse \immediate\write16{Attention : macro \expandafter\noexpand\csname chrono\@@string@a\endcsname deja definie.}% + \expandafter\!gobble + \else + \!chrverifdefinestrue + \expandafter\!chrverifdefines@ux + \fi}% +\!chrverif\def\!chrverifdefines@ux{\expandafter\def\csname chrono\@@string@a\endcsname}% +% +% +%DEFINECHRONOEVENT +% +% \!chrverif\def\definechronoevent#1{% \def\@@string@a{#1}% \!chrverifdefines{% \expandafter\expandafter\expandafter\!chrtraitingargvirgule\expandafter\expandafter\expandafter{\csname !chr#1defaultoptions\endcsname}{!chr@event}% \!chrtraiteoneargument\dochronoevent}% \if!chrverifdefines -\expandafter\def\csname !chr#1defaultoptions\endcsname{barre=true, icon=\relax, -markdepth=10pt, textstyle=\relax, mark=true, -date=true, datesseparation=\space, conversionmonth=true, -datestyle=\relax, datesstyle=\relax, year=true, -iconheight=0.5\!chrheight, ifcolorbox=true, colorbox=white, -textwidth=\relax}\fi -\ifnexttoken[{\!chr@defineorsetupoptions}{}} - + \expandafter\def\csname !chr#1defaultoptions\endcsname{barre=true, icon=\relax,% + markdepth=10pt, textstyle=\relax, mark=true,% + date=true, datesseparation=\space, conversionmonth=true,% + datestyle=\relax, datesstyle=\relax, year=true,% + iconheight=0.5\!chrheight, ifcolorbox=true, colorbox=white,% + textwidth=\relax}% +\fi +\ifnexttoken[{\!chr@defineorsetupoptions}{}}% +% +% +%DEFINECHRONOPERIODE +% +% \!chrverif\def\definechronoperiode#1{% \def\@@string@a{#1}% \!chrverifdefines{% \expandafter\expandafter\expandafter\!chrtraitingargvirgule\expandafter\expandafter\expandafter{\csname !chr#1defaultoptions\endcsname}{!chr@period}% \!chrtraiteoneargument\dochronoperiode}% \if!chrverifdefines -\expandafter\def\csname !chr#1defaultoptions\endcsname{textdepth=15pt, dates=true, -color=\!chrperiodedef@ultcolor, datesstyle=\relax, -startdate=true, stopdate=true, textstyle=\relax, -dateselevation=0pt, ifcolorbox=true, -colorbox=white, bottomdepth=0pt, topheight=\!chrheight, box=false}\fi -\ifnexttoken[{\!chr@defineorsetupoptions}{}} - + \expandafter\def\csname !chr#1defaultoptions\endcsname{textdepth=15pt, dates=true,% + color=\!chrperiodedef@ultcolor, datesstyle=\relax,% + startdate=true, stopdate=true, textstyle=\relax,% + dateselevation=0pt, ifcolorbox=true,% + colorbox=white, bottomdepth=0pt, topheight=\!chrheight, box=false,% + textwidth=\relax}% +\fi +\ifnexttoken[{\!chr@defineorsetupoptions}{}}% +% +%pour modifier les valeurs par d\'efaut +% \!chrverif\def\!chr@defineorsetupoptions[#1]{% \!chr@parcoursoptions#1,\end -} - -\!chrverif\def\!chr@parcoursoptions#1,{\!chr@replaceoptions#1,=\end,\ifnexttoken\end\!gobble\!chr@parcoursoptions} -\!chrverif\def\!chr@replaceoptions#1=#2,{\ifx#2\end\relax\else -\def\@@string@f{}% -\def\@@string@c{#1}\def\@@string@d{#2}% -\expandafter\let\expandafter\@@string@@b\csname !chr\@@string@a defaultoptions\endcsname -\expandafter\!chr@replaceoptionsaux\@@string@@b,\end% -\expandafter\let\csname !chr\@@string@a defaultoptions\endcsname\@@string@f -\expandafter\!gobblethree\fi} - -\!chrverif\def\!chr@replaceoptionsaux#1,{\!chr@replaceoptions@ux#1,=\end, \ifnexttoken\end\!gobble\!chr@replaceoptionsaux} +}% +% +\!chrverif\def\!chr@parcoursoptions#1,{\!chr@replaceoptions#1,=\end,\ifnexttoken\end \!gobble \!chr@parcoursoptions}% +\!chrverif\def\!chr@replaceoptions#1=#2,{% +\ifx#2\end\relax +\else + \def\@@string@f{}% + \def\@@string@c{#1}\def\@@string@d{#2}% + \expandafter\let\expandafter\@@string@@b\csname !chr\@@string@a defaultoptions\endcsname + \expandafter\!chr@replaceoptionsaux\@@string@@b,\end% + \expandafter\let\csname !chr\@@string@a defaultoptions\endcsname\@@string@f + \expandafter\!gobblethree +\fi}% +% +\!chrverif\def\!chr@replaceoptionsaux#1,{\!chr@replaceoptions@ux#1,=\end,\ifnexttoken\end\!gobble\!chr@replaceoptionsaux}% \!chrverif\def\!chr@replaceoptions@ux#1=#2,{% -\ifx#2\end\relax\else -\def\@@string@e{#1} \ifx\@@string@c\@@string@e -\expandafter\def\expandafter\@@string@f\expandafter{\@@string@f , #1=}% -\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\@@string@f\expandafter\expandafter\expandafter{\expandafter\@@string@f\@@string@d}% -\else \expandafter\def\expandafter\@@string@f\expandafter{\@@string@f , #1=#2}\fi\expandafter\!gobblethree\fi -} - - +\ifx#2\end\relax +\else + \def\@@string@e{#1}% + \ifx\@@string@c\@@string@e + \expandafter\def\expandafter\@@string@f\expandafter{\@@string@f , #1=}% + \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\@@string@f\expandafter\expandafter\expandafter{\expandafter\@@string@f\@@string@d}% + \else + \expandafter\def\expandafter\@@string@f\expandafter{\@@string@f , #1=#2}% + \fi + \expandafter\!gobblethree +\fi +}% +% +% \!chr@verif\newcount\!chrgraduationcount \!chr@verif\newcount\!chrgraduationcount@ux \newif\if!chrgradu@tionevent \!chrgradu@tioneventtrue -\!chrverif\def\chronograduation{\!chrtraitetwoargument\dochronograduation} +\!chrverif\def\chronograduation{\!chrtraitetwoargument\dochronograduation}% \!chrverif\def\dochronograduation[#1][#2]#3{% \if!chrtwoarg -\def\@@string@a{#2}% -\def\@@string@b{#1}\def\@@string@c{event}\def\@@string@d{periode}% -\ifx\@@string@b\@@string@c \!chrgradu@tioneventtrue \else -\ifx\@@string@b\@@string@d \!chrgradu@tioneventfalse\else \immediate\write16{chronosys : style #1 non défini}\fi\fi -\else \def\@@string@a{#1}\fi + \def\@@string@a{#2}% + \def\@@string@b{#1}\def\@@string@c{event}% + \def\@@string@d{periode}% + \ifx\@@string@b\@@string@c + \!chrgradu@tioneventtrue + \else + \ifx\@@string@b\@@string@d + \!chrgradu@tioneventfalse + \else + \def\@@string@e{}\unless\ifx\@@string@b\@@string@e\immediate\write16{chronosys : style #1 non défini ligne \number\inputlineno}\fi + \fi + \fi +\else \def\@@string@a{#1}% +\fi \!chrgraduationcount\!chrstartyear \if!chrgradu@tionevent -\loop \advance\!chrgraduationcount#3\ifnum\!chrgraduationcount<\!chrstopyear \expandafter\chrono!!eventgradu@tion\expandafter[\@@string@a]{\number\!chrgraduationcount}{}\repeat -\else \def\@@string@e{startdate=true,}% -\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\@@string@e\expandafter\expandafter\expandafter{\expandafter\@@string@e\@@string@a}% -\expandafter\chrono!!periodegradu@tion\expandafter[\@@string@e]{\number\!chrgraduationcount}{#3}{}\restartchronoperiodecolor -\loop \advance\!chrgraduationcount#3\ifnum\!chrgraduationcount<\!chrstopyear \!chrgraduationcount@ux\numexpr\!chrgraduationcount-#3\relax \expandafter\chrono!!periodegradu@tion\expandafter[\@@string@a]{\number\!chrgraduationcount@ux}{\number\!chrgraduationcount}{}\repeat -\fi} - -\!chrverif\def\setupchronograduation{\!chrtraiteoneargument\dosetupchronograduation} + \loop + \advance\!chrgraduationcount#3% + \ifnum\!chrgraduationcount<\!chrstopyear + \expandafter\chrono!!eventgradu@tion + \expandafter[\@@string@a]{\number\!chrgraduationcount}{}% + \repeat +\else + \def\@@string@e{startdate=true,}% + \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\@@string@e\expandafter\expandafter\expandafter{\expandafter\@@string@e\@@string@a}% + \expandafter\chrono!!periodegradu@tion\expandafter[\@@string@e]{\number\!chrgraduationcount}{#3}{}% + \restartchronoperiodecolor + \loop + \advance\!chrgraduationcount#3% + \ifnum\!chrgraduationcount<\!chrstopyear + \!chrgraduationcount@ux\numexpr\!chrgraduationcount-#3\relax \expandafter\chrono!!periodegradu@tion\expandafter[\@@string@a]{\number\!chrgraduationcount@ux}{\number\!chrgraduationcount}{}% + \repeat +\fi}% +% +\!chrverif\def\setupchronograduation{\!chrtraiteoneargument\dosetupchronograduation}% \!chrverif\def\dosetupchronograduation[#1]{% \if!chronearg -\def\@@string@b{#1}\def\@@string@c{event}\def\@@string@d{periode}% -\ifx\@@string@b\@@string@c \!chrgradu@tioneventtrue \else -\ifx\@@string@b\@@string@d \!chrgradu@tioneventfalse\fi\fi \fi -\if!chrgradu@tionevent \def\@@string@a{[!!eventgradu@tion]}\else\def\@@string@a{[!!periodegradu@tion]}\fi -\expandafter\setupchronoevent\@@string@a} - -\definechronoevent{event} -\definechronoevent{!!eventgradu@tion}[markdepth=5pt,barre=false, ifcolorbox=false] -\definechronoperiode{periode} -\definechronoperiode{!!periodegradu@tion}[dateselevation=-10pt, -startdate=false, ifcolorbox=false] + \def\@@string@b{#1}\def\@@string@c{event}\def\@@string@d{periode}% + \ifx\@@string@b\@@string@c + \!chrgradu@tioneventtrue + \else + \ifx\@@string@b\@@string@d + \!chrgradu@tioneventfalse + \fi + \fi +\fi +\if!chrgradu@tionevent + \def\@@string@a{[!!eventgradu@tion]}% +\else \def\@@string@a{[!!periodegradu@tion]}% +\fi +\expandafter\setupchronoevent\@@string@a}% +% +\definechronoevent{event}% +\definechronoevent{!!eventgradu@tion}[markdepth=5pt,barre=false, ifcolorbox=false]% +\definechronoperiode{periode}% +\definechronoperiode{!!periodegradu@tion}[dateselevation=-10pt,% +startdate=false, ifcolorbox=false]% +% +\endinput +% +%
\ No newline at end of file diff --git a/Master/texmf-dist/tex/generic/chronosys/x-chronosys.tex b/Master/texmf-dist/tex/generic/chronosys/x-chronosys.tex index db9456b2527..0e647c91738 100644 --- a/Master/texmf-dist/tex/generic/chronosys/x-chronosys.tex +++ b/Master/texmf-dist/tex/generic/chronosys/x-chronosys.tex @@ -23,41 +23,57 @@ % % The Current Maintainer of this work is Mathieu Long. % -\usemodule[tikz] -\catcode`\@=11 -\catcode`\!=11 -\def\!chr@verif#1#2{\ifdefined#2\error!message \fi #1#2} % -\defineframed[chreventframedcolorbox][background=color,backgroundcolor=\!chr@eventcolorbox,frame=off,backgroundoffset=\z@,location=low] -\defineframed[chrperiodframedcolorbox][background=color,backgroundcolor=\!chr@periodcolorbox,frame=off,backgroundoffset=\z@,location=low] +% % % % +% +%Charger Tikz si MKII ou non si MKIV +\startnotmode[mkiv]% +\usemodule[tikz]% +\stopnotmode +% +%CHANGEMENT DES CATCODES +\catcode`\@=11% +\catcode`\!=11% +% +%DEFINITION DE \!CHR@VERIF +\def\!chr@verif#1#2{\ifdefined#2\error!message \fi #1#2}% +% +%DEFINITION DES SYSTEMES DE COLORISATION DU FOND DES EVENEMENTS ET PERIODE +\defineframed[chreventframedcolorbox][background=color,backgroundcolor=\!chr@eventcolorbox,frame=off,backgroundoffset=\z@,location=low]% +\defineframed[chrperiodframedcolorbox][background=color,backgroundcolor=\!chr@periodcolorbox,frame=off,backgroundoffset=\z@,location=low]% \let\!chreventcolorbox\chreventframedcolorbox \let\!chrperiodcolorbox\chrperiodframedcolorbox -\input chronosyschr.tex - -\def\setupchronology{\dosingleempty\dosetupchronology} -\def\dosetupchronology[#1]{\iffirstargument \!chrtraitingargvirgule{#1}{!chrdefault}\fi} - -\def\setupchronoevent{\def\@@string@a{event}\dodoubleempty\dosetupchronoeventandperiode} +% +%CHARGER CHRONOSYSCHR +\input chronosyschr.tex% +% +%READAPTER LA SYNTAXE A CELLE DE CONTEXT +% +\def\setupchronology{\dosingleempty\dosetupchronology}% +\def\dosetupchronology[#1]{\iffirstargument \!chrtraitingargvirgule{#1}{!chrdefault}\fi}% +% +\def\setupchronoevent{\def\@@string@a{event}\dodoubleempty\dosetupchronoeventandperiode}% \def\dosetupchronoeventandperiode[#1][#2]{\iffirstargument \ifsecondargument -\def\@@string@a{#1}\def\@@string@b{#2}\else\def\@@string@b{#1}\fi \expandafter\!chr@parcoursoptions\@@string@b,\end\fi} - -\def\setupchronoperiode{\def\@@string@a{periode}\dodoubleempty\dosetupchronoeventandperiode} -\def\definechronoperiode{\dosingleempty\dodefinechronoperiode} -\!chrverif\def\dodefinechronoperiode[#1]{% +\def\@@string@a{#1}\def\@@string@b{#2}\else\def\@@string@b{#1}\fi \expandafter\!chr@parcoursoptions\@@string@b,\end\fi}% +% +\def\setupchronoperiode{\def\@@string@a{periode}\dodoubleempty\dosetupchronoeventandperiode}% +\def\definechronoperiode{\dosingleempty\dodefinechronoperiode}% +\def\dodefinechronoperiode[#1]{% \iffirstargument \def\@@string@a{#1}% \!chrverifdefines{% \expandafter\expandafter\expandafter\!chrtraitingargvirgule\expandafter\expandafter\expandafter{\csname !chr#1defaultoptions\endcsname}{!chr@period}% \!chrtraiteoneargument\dochronoperiode}% \if!chrverifdefines -\expandafter\def\csname !chr#1defaultoptions\endcsname{textdepth=15pt, dates=true, -color=\!chrperiodedef@ultcolor, datesstyle=\relax, -startdate=true, stopdate=true, textstyle=\relax, -dateselevation=0pt, ifcolorbox=true, -colorbox=white, bottomdepth=0pt, topheight=\!chrheight}\fi\fi -\ifnexttoken[{\!chr@defineorsetupoptions}{}} - -\def\definechronoevent{\dosingleempty\dodefinechronoevent} +\expandafter\def\csname !chr#1defaultoptions\endcsname{textdepth=15pt, dates=true,% + color=\!chrperiodedef@ultcolor, datesstyle=\relax,% + startdate=true, stopdate=true, textstyle=\relax,% + dateselevation=0pt, ifcolorbox=true,% + colorbox=white, bottomdepth=0pt, topheight=\!chrheight, box=false,% + textwidth=\relax}\fi\fi +\ifnexttoken[{\!chr@defineorsetupoptions}{}}% +% +\def\definechronoevent{\dosingleempty\dodefinechronoevent}% \!chrverif\def\dodefinechronoevent[#1]{% \iffirstargument \def\@@string@a{#1}% @@ -65,18 +81,47 @@ colorbox=white, bottomdepth=0pt, topheight=\!chrheight}\fi\fi \expandafter\expandafter\expandafter\!chrtraitingargvirgule\expandafter\expandafter\expandafter{\csname !chr#1defaultoptions\endcsname}{!chr@event}% \!chrtraiteoneargument\dochronoevent}% \if!chrverifdefines -\expandafter\def\csname !chr#1defaultoptions\endcsname{barre=true, icon=\relax, -markdepth=10pt, textstyle=\relax, mark=true, -date=true, datesseparation=\space, conversionmonth=true, -datestyle=\relax, datesstyle=\relax, year=true, -iconheight=0.5\!chrheight, ifcolorbox=true, colorbox=white, +\expandafter\def\csname !chr#1defaultoptions\endcsname{barre=true, icon=\relax,% +markdepth=10pt, textstyle=\relax, mark=true,% +date=true, datesseparation=\space, conversionmonth=true,% +datestyle=\relax, datesstyle=\relax, year=true,% +iconheight=0.5\!chrheight, ifcolorbox=true, colorbox=white,% textwidth=\relax}\fi\fi -\ifnexttoken[{\!chr@defineorsetupoptions}{}} - -\setupchronoevent[!!eventgradu@tion][datesstyle=\tfxx] -\setupchronoperiode[!!periodegradu@tion][datesstyle=\tfxx] - - -\catcode`\@=12 -\catcode`\!=12 +\ifnexttoken[{\!chr@defineorsetupoptions}{}}% +% +\setupchronoevent[!!eventgradu@tion][datesstyle=\tfxx]% +\setupchronoperiode[!!periodegradu@tion][datesstyle=\tfxx]% +% +%DEFINITION DE \!CHRUSECOLOR ET DES COULEURS A UTILISER NON EXISTANTES DANS LE FORMAT +\def\!chrusecolor#1{\color[#1]}% +\definecolor[purple][r=0.5, g=0, b=0.5]% +\definecolor[violet][r=0.75, g=0, b=0.25]% +% +%SYSTEME DE CHANGEMENT DE MOTEUR DE DESSIN +% +\!chrverif\def\chronoswitchtomodeMP{\long\def\!chrstarttikzpicture##1\!chrstoptikzpicture{\begingroup\edef\@@string@d{##1}\edef\@@string@d{\@@string@d}\expandafter\startMPcode\@@string@d\stopMPcode\endgroup}% +\def\!chrstoptikzpicture{\stopMPcode}% +\def\!chrfill[color=##1]##2;{fill ##2 withcolor \MPcolor{##1};}% +\def\!chrfilldraw[color=##1]##2;{filldraw ##2 withcolor \MPcolor{##1};}% +\def\!chrdraw[color=##1]##2;{draw ##2 withcolor \MPcolor{##1};}}% +% +\!chrverif\def\chronoswitchtomodeTikz{% +\unless\ifdefined\starttikzpicture + \usemodule[tikz]% +\fi +\let\!chrstarttikzpicture\starttikzpicture +\let\!chrstoptikzpicture\stoptikzpicture +\def\!chrfill{\fill}% +\def\!chrfilldraw{\filldraw}% +\def\!chrdraw{\draw}}% +% +\startmode[mkiv]% +\chronoswitchtomodeMP +\stopmode +\startnotmode[mkiv]% +\chronoswitchtomodeTikz +\stopnotmode +% +\catcode`\@=12% +\catcode`\!=12% \endinput
\ No newline at end of file |