diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/chronosys/x-chronosys.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/chronosys/x-chronosys.tex | 121 |
1 files changed, 83 insertions, 38 deletions
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 |