% % % VECT4.STY : Graphisme pour Plain TeX, adapte de LaTeX             %
%                           Adapte de LATEX.TEX                         %
%                 Conception: Robert CABANE, avril 2003                 %
%                 Contact: 19 rue de Lyon 33000 BORDEAUX                %
%                 Mail: rcabane@free.fr                                 %
% Si necessaire inclure apres VECT4.STY                                 %
%         CIRCLE.STY, DASHBOX.STY ou BEZIER.STY                         %
% VECT4.STY ne contient que le strict necessaire pour tracer            %
% des droites et des rectangles.                                        %
% Pour le trace de droites de pentes quelconques, choisir EMteX ou TPIC %
% par une commande                                                      %
% \initvect{emtex} ou \initvect{tpic} ou initvect{dvips} ...            %
% La commande \thicklines sera adaptee en consequence                   %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

\catcode`\@=11
\newdimen\fboxrule
\newdimen\fboxsep
\newdimen\@wholewidth
\newdimen\@halfwidth
\newdimen\unitlength \unitlength =1pt
\newdimen\@picht
\newdimen\@tempdima
\newdimen\@tempdimb
\newdimen\@xdim
\newdimen\@ydim
\newdimen\@linelen
\newdimen\@clnwd
\newdimen\@clnht
\newcount\@tempcnta
\newcount\@tempcntb
\newcount\@xarg
\newcount\@yarg
\newcount\@yyarg
\newcount\@multicnt
\newcount\@xx\@xx=0
\newcount\@yy\@yy=0
\newbox\@tempboxa
\newbox\@tempboxb
\newbox\@picbox
\newbox\@linechar
% line & circle fonts
\font\tenln    = line10
\font\tenlnw   = linew10
% Les fontes "cercles" doivent etre nommees correctement selon le systeme
% d'exploitation !
\font\tencirc  = lcircle10
\font\tencircw = lcirclew10
% Pour le trace de lignes, voir ci-dessous avec EMTEX et TPIC
\def\@{\spacefactor\@m}
\def\@ifnextchar#1#2#3{\let\@tempe #1\def\@tempa{#2}\def\@tempb{#3}\futurelet
    \@tempc\@ifnch}
\def\@ifnch{\ifx \@tempc \@sptoken \let\@tempd\@xifnch
      \else \ifx \@tempc \@tempe\let\@tempd\@tempa\else\let\@tempd\@tempb\fi
      \fi \@tempd}
%
\def\@whilenoop#1{}
\def\@whilenum#1\do #2{\ifnum #1\relax #2\relax\@iwhilenum{#1\relax
     #2\relax}\fi}
\def\@iwhilenum#1{\ifnum #1\let\@nextwhile=\@iwhilenum
	 \else\let\@nextwhile=\@whilenoop\fi\@nextwhile{#1}}

\def\@whiledim#1\do #2{\ifdim #1\relax#2\@iwhiledim{#1\relax#2}\fi}
\def\@iwhiledim#1{\ifdim #1\let\@nextwhile=\@iwhiledim
	\else\let\@nextwhile=\@whilenoop\fi\@nextwhile{#1}}
\def\@nnil{\@nil}
\def\@empty{}
\def\@fornoop#1\@@#2#3{}
%
\def\@tfor#1:=#2\do#3{\xdef\@fortmp{#2}\ifx\@fortmp\@empty \else
    \@tforloop#2\@nil\@nil\@@#1{#3}\fi}
\def\@tforloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil
       \let\@nextwhile=\@fornoop \else
      #4\relax\let\@nextwhile=\@tforloop\fi\@nextwhile#2\@@#3{#4}}
%
\def\savebox#1{\@ifnextchar ({\@savepicbox#1}{\@ifnextchar
     [{\@savebox#1}{\sbox#1}}}
%
\def\sbox#1#2{\setbox#1\hbox{#2}}
%
\def\makebox{\@ifnextchar ({\@makepicbox}{\@ifnextchar
     [{\@makebox}{\mbox}}}
%
\def\mbox#1{\leavevmode\hbox{#1}}
%
\def\@makebox[#1]{\leavevmode\@ifnextchar [{\@imakebox[#1]}{\@imakebox[#1][x]}}
%
\long\def\@imakebox[#1][#2]#3{\hbox to#1{\let\mb@l\hss
\let\mb@r\hss \expandafter\let\csname mb@#2\endcsname\relax
\mb@l #3\mb@r}}
%
\def\@makepicbox(#1,#2){\leavevmode\@ifnextchar
   [{\@imakepicbox(#1,#2)}{\@imakepicbox(#1,#2)[]}}

\long\def\@imakepicbox(#1,#2)[#3]#4{\vbox to#2\unitlength
   {\let\mb@b\vss \let\mb@l\hss\let\mb@r\hss
    \let\mb@t\vss
    \@tfor\@tempa :=#3\do{\expandafter\let
    \csname mb@\@tempa\endcsname\relax}%
\mb@t\hbox to #1\unitlength{\mb@l #4\mb@r}\mb@b}}
%
\long\def\frame#1{\leavevmode
    \hbox{\hskip-\@wholewidth
     \vbox{\vskip-\@wholewidth
	    \hrule \@height\@wholewidth
	  \hbox{\vrule \@width\@wholewidth #1\vrule \@width\@wholewidth}\hrule
	   \@height \@wholewidth\vskip -\@halfwidth}\hskip-\@wholewidth}}
%
\long\def\fbox#1{\leavevmode\setbox\@tempboxa\hbox{#1}\@tempdima\fboxrule
    \advance\@tempdima \fboxsep \advance\@tempdima \dp\@tempboxa
   \hbox{\lower \@tempdima\hbox
  {\vbox{\hrule \@height \fboxrule
	  \hbox{\vrule \@width \fboxrule \hskip\fboxsep
	  \vbox{\vskip\fboxsep \box\@tempboxa\vskip\fboxsep}\hskip
		 \fboxsep\vrule \@width \fboxrule}
		 \hrule \@height \fboxrule}}}}
%
\def\framebox{\@ifnextchar ({\@framepicbox}{\@ifnextchar
     [{\@framebox}{\fbox}}}
%
\def\@framebox[#1]{\@ifnextchar [{\@iframebox[#1]}{\@iframebox[#1][x]}}
%
\long\def\@iframebox[#1][#2]#3{\leavevmode
  \savebox\@tempboxa[#1][#2]{\kern\fboxsep #3\kern\fboxsep}\@tempdima\fboxrule
    \advance\@tempdima \fboxsep \advance\@tempdima \dp\@tempboxa
   \hbox{\lower \@tempdima\hbox
  {\vbox{\hrule \@height \fboxrule
	  \hbox{\vrule \@width \fboxrule \hskip-\fboxrule
	      \vbox{\vskip\fboxsep \box\@tempboxa\vskip\fboxsep}\hskip
		  -\fboxrule\vrule \@width \fboxrule}
		  \hrule \@height \fboxrule}}}}
%
\def\@framepicbox(#1,#2){\@ifnextchar
   [{\@iframepicbox(#1,#2)}{\@iframepicbox(#1,#2)[]}}
%
\long\def\@iframepicbox(#1,#2)[#3]#4{\frame{\@imakepicbox(#1,#2)[#3]{#4}}}
%
\def\@argrsbox#1[#2]{%
\@ifnextchar[{\@iirsbox{#1}[#2]}{\@irsbox{#1}[#2]}}

\long\def\@rsbox#1#2{\leavevmode\hbox{\raise #1\hbox{#2}}}

\long\def\@irsbox#1[#2]#3{\setbox\@tempboxa \hbox
   {\raise #1\hbox{#3}}\ht\@tempboxa#2\leavevmode\box\@tempboxa}

\long\def\@iirsbox#1[#2][#3]#4{\setbox\@tempboxa \hbox
   {\raise #1\hbox{#4}}\ht\@tempboxa#2\dp\@tempboxa#3\leavevmode\box\@tempboxa}

\def\@height{height}
\def\@depth{depth}
\def\@width{width}

\def\rule#1#2{\leavevmode\hbox{\vrule \@width#1 \@height#2 \@depth \z@}}

\def\@beginpicture(#1,#2){\@ifnextchar({\@picture(#1,#2)}{\@picture(#1,#2)(0,0)}}

% On remet le catcode de : a 12 pour que ce ne soit plus un caractere actif
% en effet, on en a besoin dans les \special{xx:yyy zzz} qui autrement ne
% marchent plus ! A la sortie (\endpicture) le catcode sera retabli.
\def\@picture(#1,#2)(#3,#4){\@picht #2\unitlength
\setbox\@picbox\hbox to #1\unitlength\bgroup\catcode`\:=12
\hskip -#3\unitlength \lower #4\unitlength \hbox\bgroup
\let\line=\@@line\ignorespaces}
%
\def\@endpicture{\egroup\hss\egroup\ht\@picbox\@picht
\dp\@picbox\z@\leavevmode\box\@picbox}
%
\let\@@end=\end
\def\begin#1{\xdef\end##1{\csname @end#1\endcsname
\expandafter\endgroup\global\let\end=\@@end\ignorespaces}
\begingroup\csname @begin#1\endcsname}

\long\def\put(#1,#2)#3{\@killglue\raise#2\unitlength\hbox to\z@{\kern
#1\unitlength #3\hss}\ignorespaces}

\long\def\multiput(#1,#2)(#3,#4)#5#6{\@killglue\@multicnt=#5\relax
\@xdim=#1\unitlength\@ydim=#2\unitlength
\@whilenum\@multicnt>0\do{\raise\@ydim\hbox to\z@{\kern
\@xdim #6\hss}\advance\@multicnt \m@ne\advance\@xdim
#3\unitlength\advance\@ydim #4\unitlength}\ignorespaces}

\def\@killglue{\unskip\@whiledim \lastskip >\z@\do{\unskip}}

\newif\if@negarg

\def\@@line(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax
\@linelen #3\unitlength
\ifnum\@xarg =\z@ \@vline
  \else \ifnum\@yarg =\z@ \@hline \else \@sline\fi
\fi}

\def\@sline{\ifnum\@xarg<\z@ \@negargtrue \@xarg -\@xarg \@yyarg -\@yarg
  \else \@negargfalse \@yyarg \@yarg \fi
\ifnum \@yyarg >\z@ \@tempcnta\@yyarg \else \@tempcnta -\@yyarg \fi
\ifnum\@tempcnta>6 \@badlinearg\@tempcnta\z@ \fi
\ifnum\@xarg>6 \@badlinearg\@xarg \@ne \fi
\setbox\@linechar\hbox{\@linefnt\@getlinechar(\@xarg,\@yyarg)}%
\ifnum \@yarg >\z@ \let\@upordown\raise \@clnht\z@
   \else\let\@upordown\lower \@clnht \ht\@linechar\fi
\@clnwd \wd\@linechar
\if@negarg \hskip -\wd\@linechar \def\@tempa{\hskip -2\wd\@linechar}\else
     \let\@tempa\relax \fi
\@whiledim \@clnwd <\@linelen \do
  {\@upordown\@clnht\copy\@linechar
   \@tempa
   \advance\@clnht \ht\@linechar
   \advance\@clnwd \wd\@linechar}%
\advance\@clnht -\ht\@linechar
\advance\@clnwd -\wd\@linechar
\@tempdima\@linelen\advance\@tempdima -\@clnwd
\@tempdimb\@tempdima\advance\@tempdimb -\wd\@linechar
\if@negarg \hskip -\@tempdimb \else \hskip \@tempdimb \fi
\multiply\@tempdima \@m
\@tempcnta \@tempdima \@tempdima \wd\@linechar \divide\@tempcnta \@tempdima
\@tempdima \ht\@linechar \multiply\@tempdima \@tempcnta
\divide\@tempdima \@m
\advance\@clnht \@tempdima
\ifdim \@linelen <\wd\@linechar
   \hskip \wd\@linechar
  \else\@upordown\@clnht\copy\@linechar\fi}

\def\@hline{\ifnum \@xarg <\z@ \hskip -\@linelen \fi
\vrule \@height \@halfwidth \@depth \@halfwidth \@width \@linelen
\ifnum \@xarg <\z@ \hskip -\@linelen \fi}

\def\@getlinechar(#1,#2){\@tempcnta#1\relax\multiply\@tempcnta 8%
\advance\@tempcnta -9\ifnum #2>\z@ \advance\@tempcnta #2\relax\else
\advance\@tempcnta -#2\relax\advance\@tempcnta 64 \fi
\char\@tempcnta}

%% Essai de trace de lignes pointillees (a revoir)
%% \def\@dotlinechar(#1,#2){\@tempcnta#1\relax\multiply\@tempcnta 8%
%% \advance\@tempcnta -9\ifnum #2>\z@ \advance\@tempcnta #2\relax\else
%% \advance\@tempcnta -#2\relax\advance\@tempcnta 64 \fi
%% \phantom{\char\@tempcnta}\hbox to \z@{\smash{\sevenrm .}}}
%%
%% \def\dotline(#1,#2)#3{\bgroup\let\@getlinechar=\@dotlinechar\line(#1,#2){#3}\egroup}
%% Exemple:
%% \put(10,10){\dotline(1,2){40}} % doit arriver en (50,90)
%% En fait pas genial, notamment la limitation de la pente et l'espacement des points

\def\vector(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax
\@tempcnta \ifnum\@xarg<\z@ -\@xarg\else\@xarg\fi
\ifnum\@tempcnta<5\relax
\@linelen #3\unitlength
\ifnum\@xarg =\z@ \@vvector
  \else \ifnum\@yarg =\z@ \@hvector \else \@svector\fi
\fi
\else\@badlinearg\fi}

\def\@hvector{\@hline\hbox to\z@{\@linefnt
\ifnum \@xarg <\z@ \@getlarrow(1,0)\hss\else
    \hss\@getrarrow(1,0)\fi}}

\def\@vvector{\ifnum \@yarg <\z@ \@downvector \else \@upvector \fi}

\def\@svector{\@sline
\@tempcnta\@yarg \ifnum\@tempcnta <\z@ \@tempcnta -\@tempcnta\fi
\ifnum\@tempcnta <5%
  \hskip -\wd\@linechar
  \@upordown\@clnht \hbox{\@linefnt  \if@negarg
  \@getlarrow(\@xarg,\@yyarg)\else \@getrarrow(\@xarg,\@yyarg)\fi}%
\else\@badlinearg\fi}

\def\@getlarrow(#1,#2){\ifnum #2=\z@ \@tempcnta'33 \else
\@tempcnta #1\relax\multiply\@tempcnta \sixt@@n \advance\@tempcnta
-9 \@tempcntb #2\relax\multiply\@tempcntb \tw@
\ifnum \@tempcntb >\z@ \advance\@tempcnta \@tempcntb
\else\advance\@tempcnta -\@tempcntb\advance\@tempcnta 64
\fi\fi\char\@tempcnta}

\def\@getrarrow(#1,#2){\@tempcntb #2\relax
\ifnum\@tempcntb <\z@ \@tempcntb -\@tempcntb\relax\fi
\ifcase \@tempcntb\relax \@tempcnta'55 \or
\ifnum #1<\thr@@ \@tempcnta #1\relax\multiply\@tempcnta
24\advance\@tempcnta -6 \else \ifnum #1=\thr@@ \@tempcnta 49
\else\@tempcnta 58 \fi\fi\or
\ifnum #1<\thr@@ \@tempcnta=#1\relax\multiply\@tempcnta
24\advance\@tempcnta -\thr@@ \else \@tempcnta 51 \fi\or
\@tempcnta #1\relax\multiply\@tempcnta
\sixt@@n \advance\@tempcnta -\tw@ \else
\@tempcnta #1\relax\multiply\@tempcnta
\sixt@@n \advance\@tempcnta 7 \fi\ifnum #2<\z@ \advance\@tempcnta 64 \fi
\char\@tempcnta}

\def\@vline{\ifnum \@yarg <\z@ \@downline \else \@upline\fi}

\def\@upline{\hbox to \z@{\hskip -\@halfwidth \vrule \@width \@wholewidth
   \@height \@linelen \@depth \z@\hss}}

\def\@downline{\hbox to \z@{\hskip -\@halfwidth \vrule \@width \@wholewidth
   \@height \z@ \@depth \@linelen \hss}}

\def\@upvector{\@upline\setbox\@tempboxa\hbox{\@linefnt\char'66}\raise
     \@linelen \hbox to\z@{\lower \ht\@tempboxa\box\@tempboxa\hss}}

\def\@downvector{\@downline\lower \@linelen\hbox to \z@{\@linefnt\char'77\hss}}
%
% dashbox
%
\newdimen\@dashdim
\newbox\@dashbox
\newcount\@dashcnt
%
\def\dashbox#1(#2,#3){\leavevmode\hbox to \z@{\baselineskip \z@%
\lineskip \z@%
\@dashdim=#2\unitlength%
\@dashcnt=\@dashdim \advance\@dashcnt 200
\@dashdim=#1\unitlength\divide\@dashcnt \@dashdim
\ifodd\@dashcnt\@dashdim=\z@%
\advance\@dashcnt \@ne \divide\@dashcnt \tw@
\else \divide\@dashdim \tw@ \divide\@dashcnt \tw@
\advance\@dashcnt \m@ne
\setbox\@dashbox=\hbox{\vrule \@height \@halfwidth \@depth \@halfwidth
\@width \@dashdim}\put(0,0){\copy\@dashbox}%
\put(0,#3){\copy\@dashbox}%
\put(#2,0){\hskip-\@dashdim\copy\@dashbox}%
\put(#2,#3){\hskip-\@dashdim\box\@dashbox}%
\multiply\@dashdim 3
\fi
\setbox\@dashbox=\hbox{\vrule \@height \@halfwidth \@depth \@halfwidth
\@width #1\unitlength\hskip #1\unitlength}\@tempcnta=0
\put(0,0){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt
\do{\copy\@dashbox\advance\@tempcnta \@ne }}\@tempcnta=0
\put(0,#3){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt
\do{\copy\@dashbox\advance\@tempcnta \@ne }}%
\@dashdim=#3\unitlength%
\@dashcnt=\@dashdim \advance\@dashcnt 200
\@dashdim=#1\unitlength\divide\@dashcnt \@dashdim
\ifodd\@dashcnt \@dashdim=\z@%
\advance\@dashcnt \@ne \divide\@dashcnt \tw@
\else
\divide\@dashdim \tw@ \divide\@dashcnt \tw@
\advance\@dashcnt \m@ne
\setbox\@dashbox\hbox{\hskip -\@halfwidth
\vrule \@width \@wholewidth
\@height \@dashdim}\put(0,0){\copy\@dashbox}%
\put(#2,0){\copy\@dashbox}%
\put(0,#3){\lower\@dashdim\copy\@dashbox}%
\put(#2,#3){\lower\@dashdim\copy\@dashbox}%
\multiply\@dashdim 3
\fi
\setbox\@dashbox\hbox{\vrule \@width \@wholewidth
\@height #1\unitlength}\@tempcnta0
\put(0,0){\hskip -\@halfwidth \vbox{\@whilenum \@tempcnta < \@dashcnt
\do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }%
\vskip\@dashdim}}\@tempcnta0
\put(#2,0){\hskip -\@halfwidth \vbox{\@whilenum \@tempcnta< \@dashcnt
\relax\do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }%
\vskip\@dashdim}}}\@makepicbox(#2,#3)}
%
% circles
%
\newif\if@ovt
\newif\if@ovb
\newif\if@ovl
\newif\if@ovr
\newdimen\@ovxx
\newdimen\@ovyy
\newdimen\@ovdx
\newdimen\@ovdy
\newdimen\@ovro
\newdimen\@ovri

\def\@getcirc#1{\@tempdima #1\relax \advance\@tempdima 2pt\relax
  \@tempcnta\@tempdima
  \@tempdima 4pt\relax \divide\@tempcnta\@tempdima
  \ifnum \@tempcnta > 10\relax \@tempcnta 10\relax\fi
  \ifnum \@tempcnta >\z@ \advance\@tempcnta\m@ne
    \else \@warning{Oval too small}\fi
  \multiply\@tempcnta 4\relax
  \setbox \@tempboxa \hbox{\@circlefnt
  \char \@tempcnta}\@tempdima \wd \@tempboxa}

\def\@put#1#2#3{\raise #2\hbox to \z@{\hskip #1#3\hss}}

\def\oval(#1,#2){\@ifnextchar[{\@oval(#1,#2)}{\@oval(#1,#2)[]}}

\def\@oval(#1,#2)[#3]{\begingroup\boxmaxdepth \maxdimen
  \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue
  \@tfor\@tempa :=#3\do{\csname @ov\@tempa false\endcsname}\@ovxx
  #1\unitlength \@ovyy #2\unitlength
  \@tempdimb \ifdim \@ovyy >\@ovxx \@ovxx\else \@ovyy \fi
  \@getcirc \@tempdimb
  \@ovro \ht\@tempboxa \@ovri \dp\@tempboxa
  \@ovdx\@ovxx \advance\@ovdx -\@tempdima \divide\@ovdx \tw@
  \@ovdy\@ovyy \advance\@ovdy -\@tempdima \divide\@ovdy \tw@
  \@circlefnt \setbox\@tempboxa
  \hbox{\if@ovr \@ovvert32\kern -\@tempdima \fi
  \if@ovl \kern \@ovxx \@ovvert01\kern -\@tempdima \kern -\@ovxx \fi
  \if@ovt \@ovhorz \kern -\@ovxx \fi
  \if@ovb \raise \@ovyy \@ovhorz \fi}\advance\@ovdx\@ovro
  \advance\@ovdy\@ovro \ht\@tempboxa\z@ \dp\@tempboxa\z@
  \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa}%
  \endgroup}

\def\@ovvert#1#2{\vbox to \@ovyy{%
    \if@ovb \@tempcntb \@tempcnta \advance \@tempcntb by #1\relax
      \kern -\@ovro \hbox{\char \@tempcntb}\nointerlineskip
    \else \kern \@ovri \kern \@ovdy \fi
    \leaders\vrule width \@wholewidth\vfil \nointerlineskip
    \if@ovt \@tempcntb \@tempcnta \advance \@tempcntb by #2\relax
      \hbox{\char \@tempcntb}%
    \else \kern \@ovdy \kern \@ovro \fi}}

\def\@ovhorz{\hbox to \@ovxx{\kern \@ovro
    \if@ovr \else \kern \@ovdx \fi
    \leaders \hrule height \@wholewidth \hfil
    \if@ovl \else \kern \@ovdx \fi
    \kern \@ovri}}

\def\@ifstar#1#2{\@ifnextchar *{\def\@tempa*{#1}\@tempa}{#2}}

\def\circle{\@ifstar{\@dot}{\@circle}}
\def\@circle#1{\begingroup \boxmaxdepth \maxdimen \@tempdimb #1\unitlength
   \ifdim \@tempdimb >15.5pt\relax \@getcirc\@tempdimb
      \@ovro\ht\@tempboxa
     \setbox\@tempboxa\hbox{\@circlefnt
      \advance\@tempcnta\tw@ \char \@tempcnta
      \advance\@tempcnta\m@ne \char \@tempcnta \kern -2\@tempdima
      \advance\@tempcnta\tw@
      \raise \@tempdima \hbox{\char\@tempcnta}\raise \@tempdima
        \box\@tempboxa}\ht\@tempboxa\z@ \dp\@tempboxa\z@
      \@put{-\@ovro}{-\@ovro}{\box\@tempboxa}%
   \else  \@circ\@tempdimb{96}\fi\endgroup}

\def\@dot#1{\@tempdimb #1\unitlength \@circ\@tempdimb{112}}

\def\@circ#1#2{\@tempdima #1\relax \advance\@tempdima .5pt\relax
   \@tempcnta\@tempdima \@tempdima 1pt\relax
   \divide\@tempcnta\@tempdima
   \ifnum\@tempcnta > 15\relax \@tempcnta 15\relax \fi
   \ifnum \@tempcnta >\z@ \advance\@tempcnta\m@ne\fi
   \advance\@tempcnta #2\relax
   \@circlefnt \char\@tempcnta}
%
% FIGURE a cote du texte: \coteacote{texte}{figure}
%
\long\def\coteacote#1#2{\smallskip\noindent
\setbox1=\hbox{\noindent #2}\hbox{\vbox{\advance\hsize-\wd1\advance\hsize-1mm
#1}\hskip1mm\vbox{\noindent\hsize\wd1\box1}}\par}
%
% INCLUSION de graphique: \dessin{nom}{unite longueur}
%
\def\dessin#1#2{\unitlength#2\linethickness{0.3pt}\input #1.txp}
%
% THICK/THINLINES
%
\def\thinlines{\let\@linefnt\tenln \let\@circlefnt\tencirc
  \@wholewidth\fontdimen8\tenln \@halfwidth .5\@wholewidth\@adjustwidth}
\def\thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw
  \@wholewidth\fontdimen8\tenlnw \@halfwidth .5\@wholewidth\@adjustwidth}
\def\@adjustwidth{\expandafter\@linewidth{\the\@wholewidth}}
\def\linethickness#1{\@wholewidth #1\relax \@halfwidth .5\@wholewidth
  \@linewidth{#1}}
\let\@linewidth=\@whilenoop
%
% EMTEX
%
\def\EM@line(#1,#2,#3,#4){\put(#1,#2){\special{em\string:moveto}}\put(#3,#4){\special{em\string:lineto}}}
\def\EM@width#1{\special{em\string:linewidth #1}}
\def\em@specials{\gdef\emline##1##2##3##4##5##6{\EM@line(##1,##2,##4,##5)}
 \global\let\lI=\EM@line\global\let\@linewidth=\EM@width}
\let\UseEMspecials=\em@specials
%
% TPIC
% Modif pour XDVI :
% conversion en millinches (1 min = 4736sp = 0,00254cm = 0,07227pt)
%
\def\TPIC@boulot{\divide\@xdim by 6\multiply\@xdim by 83%
 \divide\@ydim by 6\multiply\@ydim by 83%
 \setbox\@tempboxb\hbox{\global\@xx=\the\@xdim\global\@yy=\the\@ydim}%
 \special{pa \the\@xx\space\the\@yy}}
\def\TPIC@line(#1,#2,#3,#4){\@killglue\raise\@picht\hbox to\z@{%
 \@xdim=#1\unitlength\@ydim=\@picht\advance\@ydim by-#2\unitlength%
 \TPIC@boulot%
 \@xdim=#3\unitlength\@ydim=\@picht\advance\@ydim by-#4\unitlength%
 \TPIC@boulot%
 \special{fp}\hss}\ignorespaces}
\def\TPIC@width#1{\@xdim=#1\divide\@xdim by 6\multiply\@xdim by 83%
 \setbox\@tempboxb\hbox{\global\@xx=\the\@xdim}\special{pn \the\@xx}}
\def\tpic@specials{\gdef\emline##1##2##3##4##5##6{\TPIC@line(##1,##2,##4,##5)}
 \global\let\lI=\TPIC@line\global\let\@linewidth=\TPIC@width}
%
% PS pour dvips
%
\def\DVIPS@special#1{\special{\string"#1}}
%
% PS pour textures
%
\def\TEXTURES@special#1{\special{postscript gsave #1 grestore}}
%
% POSTSCRIPT
%
\let\PS@special=\DVIPS@special
{\catcode`t=12\catcode`p=12\gdef\no@PT#1pt{#1}}
\def\PS@nopt#1{\expandafter\no@PT\the#1\space}
\def\PSline(#1,#2,#3,#4){\unskip\hbox{%
 \@xdim #1\unitlength\@ydim #2\unitlength%
 \@tempdima #3\unitlength\@tempdimb #4\unitlength%
 \PS@special{\PS@nopt\@wholewidth\PS@nopt\@tempdima%
 \PS@nopt\@tempdimb\PS@nopt\@xdim\PS@nopt\@ydim%
 72 72.27 div dup scale newpath moveto lineto setlinewidth stroke}}%
 \ignorespaces}
%
{\catcode`t=12\catcode`p=12\gdef\no@PT#1pt{#1}}
\def\PS@nopt#1{\expandafter\no@PT\the#1\space}
\def\PS@line(#1,#2,#3,#4){\unskip\hbox{%
\@xdim #1\unitlength\@ydim #2\unitlength%
\@tempdima #3\unitlength\@tempdimb #4\unitlength%
\PS@special{\PS@nopt\@wholewidth%
\PS@nopt\@tempdima\PS@nopt\@tempdimb%
\PS@nopt\@xdim\PS@nopt\@ydim%
72 72.27 div dup scale newpath moveto lineto setlinewidth stroke}%
}\ignorespaces}
\def\dvips@specials{\let\PS@special=\DVIPS@special
\gdef\emline##1##2##3##4##5##6{\PS@line(##1,##2,##4,##5)}
 \global\let\lI=\PS@line\global\let\@linewidth=\@whilenoop}
\def\textures@specials{\dvips@specials\let\PS@special=\TEXTURES@special}

% INITIALISATION OBLIGATOIRE DANS LE DOCUMENT
% \em@specials
\let\ps@specials=\dvips@specials
\let\emtex@specials=\em@specials
\let\dviscr@specials=\em@specials
\let\dvihplj@specials=\em@specials
\let\dvidrv@specials=\em@specials
\let\xdvi@specials=\tpic@specials
\let\yap@specials=\tpic@specials
\let\dviwin@specials=\tpic@specials
\let\dviwindo@specials=\tpic@specials
\def\initvect#1{\csname #1@specials\endcsname}
%
\thinlines\let\@linewidth=\@whilenoop
\catcode`\@=12

