From: couchot Date: Mon, 4 Mar 2013 15:41:09 +0000 (+0100) Subject: modif algo euclide X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/cours-maths-dis.git/commitdiff_plain/dafee37d094618450f1cc0528e013ddfbcb7f32e?ds=sidebyside;hp=-c modif algo euclide --- dafee37d094618450f1cc0528e013ddfbcb7f32e diff --git a/hyperlatex.sty b/hyperlatex.sty new file mode 100644 index 0000000..9fa17a1 --- /dev/null +++ b/hyperlatex.sty @@ -0,0 +1,263 @@ +%% +%% LaTeX style to handle hyperlatex files, version 2.8 +%% +%% This code has GNU copyleft, 1994-2000 Otfried Cheong +%% +\NeedsTeXFormat{LaTeX2e} + +\ProvidesPackage{hyperlatex} +[2004/11/12 v2.8 LaTeX2e package for Hyperlatex mode] + +\typeout{Package: 'hyperlatex' v2.7 Otfried Cheong} + +\RequirePackage{verbatim} +\chardef\other=12 + +%% +%% Comments, +%% +{\obeylines\gdef\Hlx@W#1^^M{\endgroup\ignorespaces}} +\def\W{\begingroup\obeylines\catcode`\{=\other\catcode`\}=\other\Hlx@W} + +\newcommand{\htmlonly}[1]{} +\newcommand{\texorhtml}[2]{#1} +\newenvironment{iftex}{}{} +\newenvironment{latexonly}{}{} +\newcommand{\texonly}[1]{#1} +\newcommand{\T}{} + +%% +%% Treatment of special characters +%% + +\def\Hlx@nonspecials{} +\def\NotSpecial{\def\Hlx@nonspecials} +\def\Hlx@turnon{\let\do=\@makeother\Hlx@nonspecials} +\AtBeginDocument{\Hlx@turnon} + +\let\htmltab=& + +%% +%% \begin{tex} ... \end{tex} escapes into raw Tex temporarily. +%% you can write {\tex .....} as well, if already escaped from Html +%% +\newenvironment{tex}{\catcode `\$=3 \catcode `\&=4 \catcode `\#=6 +\catcode `\^=7 \catcode `\_=8 \catcode `\%=14}{} + +%% +%% \back +%% + +\newcommand{\back}{{\tt\char`\\}} + +%% +%% \math +%% + +\def\math{\@ifnextchar [{\@math}{\@math[]}} +\def\@math[#1]{\begingroup\tex\@@math} +\def\@@math#1{$#1$\endgroup} + +%% +%% Commands that don't do anything interesting in Latex +%% + +\def\Hlx@pass{\begingroup\let\protect\@unexpandable@noexpand\@sanitize} + + +\def\Hlx@directory{.} +%-- Never allow \Hlx@directory to be empty. See \endimage. + +\newcommand{\htmldirectory}[1]{\gdef\Hlx@directory{#1}} +\newcommand{\htmlname}[1]{} +\newcommand{\htmldepth}[1]{} +\newcommand{\htmltopname}[1]{} +\newcounter{htmldepth} +\newcommand{\htmltitle}[1]{} +\newcommand{\htmladdress}[1]{} +\newcommand{\xml}{\Hlx@pass\@html} +\def\@html#1{\endgroup} +\let\html\xml + +\newcommand{\xmlsym}[1]{} +\newcommand{\htmlrule}{} + +\newcommand{\htmlmenu}[1]{} +\newcommand{\htmlautomenu}[1]{} +\newcounter{htmlautomenu} +\newcommand{\htmlprintindex}{} +\newcommand{\htmlfootnotes}{} +\newcommand{\htmlmathitalic}[1]{} +\newcommand{\htmlpanelfield}[2]{} +\newcommand{\htmlcharset}[1]{} +\newcommand{\htmlcss}[1]{} + +\newcommand{\htmlimg}[2]{} + +\newcommand{\xname}{\Hlx@pass\Hlx@ignore} +\def\Hlx@ignore#1{\endgroup} + +\newcommand{\htmlpanel}[1]{} +\newcommand{\htmlheading}{\@ifnextchar[{\@htmlheading}{\@htmlheading[]}} +\def\@htmlheading[#1]#2{} + +\newcommand{\htmlcaption}[1]{} + +\def\xmlattributes{\@ifstar{\@xmlattributes}{\@xmlattributes}} +\def\@xmlattributes{\Hlx@pass\@@xmlattributes} +\def\@@xmlattributes#1#2{\endgroup} +\let\htmlattributes\xmlattributes + +%% +%% Image environment, +%% will generate bitmaps when `\makeimages' is defined +%% `\imagetype' will determine the type of images + +\def\imagetype#1{\def\@imagetype{#1}} + +\@ifundefined{@imagetype}{\def\@imagetype{png}}{} + +\newif\if@makeimages +\@ifundefined{makeimages}{\@makeimagesfalse}{\@makeimagestrue} + +\def\image{\@ifnextchar[{\@image}{\@image[b]}} +\def\@image[#1]{\@ifnextchar[{\@@image}{\@@image[100]}} +\def\@@image[#1]{\gdef\image@resolution{#1}\@ifnextchar[{\@@@image}{\@@@image[300]}} +\def\@@@image[#1]#2{\gdef\image@dpi{#1}\gdef\image@name{#2}\@@@@image} + +\if@makeimages +\typeout{******************************************} +\typeout{* Making bitmaps from Hyperlatex source! *} +\typeout{******************************************} +\newwrite\@makeimagecmds +\immediate\openout\@makeimagecmds=\jobname.makeimage +\newbox\@imagebox +\newdimen\@imageheight +\newcount\@imagecount\@imagecount=10000 +\def\@@@@image{\setbox\@imagebox=\vbox\bgroup\tex} +\def\endimage{\egroup + {\global\advance\@imagecount by 1\count0=\@imagecount + \@imageheight=\ht\@imagebox + \advance\@imageheight by \dp\@imagebox + \immediate\write\@makeimagecmds{dvips\space -f\space -p\space + \the\@imagecount\space -n\space 1\space -D\space \image@dpi\space + -T\the\wd\@imagebox,\the\@imageheight\space-O-72bp,-72bp\space + \jobname.dvi\space>\space\image@name.ps^^J% + ps2image\space -res\space \image@resolution\space \image@name.ps% + \space \Hlx@directory/\image@name.\@imagetype^^J} + \shipout\copy\@imagebox}\unvbox\@imagebox} +\else +\def\@@@@image{\tex} +\def\endimage{} +\fi + +%% For compatibility +\def\gif{\imagetype{gif}\image} +\def\endgif{\endimage} + +%% +%% Font style definitions +%% + +\let\cit=\textit +\let\code=\texttt +\let\kbd=\texttt +\let\samp=\texttt +\let\strong=\textbf +\let\var=\textsl +\let\dfn=\textit +\let\file=\textit + +%% +%% \begin{example} ... \end{example} obeys spaces and lines +%% +\def\Hlx@example{\do\$\do\&\do\#\do\^\do\_\do\~} +{\obeyspaces + \gdef\turnon@spaces{\let =\ \obeyspaces\catcode``=\active\@noligs}} +{\obeylines% + \gdef\turnon@lines{\obeylines\def^^M{\par\def^^M{\leavevmode\par}}}} + +\def\example{\list{}{\leftmargin\z@ + \itemindent\z@ \rightmargin\z@ \parsep \z@ plus\p@}\item[]\tt + \turnon@spaces\turnon@lines\let\do\@makeother\Hlx@example} +\let\endexample=\endlist + +%% +%% font problem: math in example environment seems to need this: +%% +\DeclareFontFamily{OMS}{cmtt}{} +\DeclareFontShape{OMS}{cmtt}{m}{n}{ <-> ssub * cmsy/m/n }{} + +\newenvironment{menu}{\list{$\bullet$}{\itemsep0pt\parsep0pt}}{\endlist} +\newenvironment{ifhtml}{\comment}{\endcomment} +\newenvironment{rawxml}{\comment}{\endcomment} + +\def\xmlinclude#1{} + +\newcommand{\Hlx@empty}{} +\newcommand{\Hlx@zero}{0} +\newif\if@Hlx + +\def\Hlx@setclear#1{\@ifundefined{#1}{\@Hlxfalse}{% + \expandafter\ifx\csname#1\endcsname\Hlx@empty\@Hlxfalse + \else\expandafter\ifx\csname#1\endcsname\Hlx@zero\@Hlxfalse + \else\@Hlxtrue\fi\fi}} + +\def\ifclear#1{\Hlx@setclear{#1} + \if@Hlx + %% arg true -> skip + \let\endifset\endcomment\let\Hlx@comment\comment + \else + %% arg false -> ignore begin and end + \let\endifset\relax\let\Hlx@comment\relax + \fi\Hlx@comment} + +\def\ifset#1{\Hlx@setclear{#1} + \if@Hlx + % arg true -> ignore begin and end + \let\endifclear\relax\let\Hlx@comment\relax + \else + % arg false -> skip environment + \let\endifclear\endcomment\let\Hlx@comment\comment + \fi\Hlx@comment} + +%% +%% Define \link and \xlink macros +%% +\newcommand{\Hlx@label}{} + +\newcommand{\Ref}{\ref{\Hlx@label}} +\newcommand{\Pageref}{\pageref{\Hlx@label}} +\newcommand{\Cite}{\cite{\Hlx@label}} + +\newenvironment{Label}[1]{\def\Hlx@Label@label{\label{#1}}\ignorespaces}% +{\Hlx@Label@label\ignorespaces} + +\newcommand{\htmlcite}[1]{\cite{#1}} + +\def\link{\@ifstar{\@star@link}{\@@link}} +\def\@@link#1{#1\@@@link} +\def\@star@link#1{\@@@link} +\def\@@@link{\@ifnextchar [{\@link}% ] balance + {\@link[]}} +\def\@link[#1]#2{\gdef\Hlx@label{#2}#1} + +\def\xlink{\@ifstar{\@star@xlink}{\@@xlink}} +\def\@@xlink#1{\@@@xlink{#1}} +\def\@star@xlink#1{\@@@xlink{}} +\def\@@@xlink#1{\@ifnextchar [{\@xlink{#1}}{\@xlink{#1}[]}} +\def\@xlink#1[#2]#3{\formatxlink{#1#2}{#3}} +\newcommand{\formatxlink}[2]{#1} + +% +% index from latex.tex, and changed to include optional argument +% +\def\cindex{\@bsphack\begingroup + \let\protect\@unexpandable@noexpand + \@sanitize + \@ifnextchar [{\Hlx@argwrindex}% balance ] + {\@wrindex}} +\def\Hlx@argwrindex[#1]#2{\@wrindex{#1@#2}} + +%% end of hyperlatex.sty + diff --git a/slashbox.sty b/slashbox.sty new file mode 100644 index 0000000..1712c9e --- /dev/null +++ b/slashbox.sty @@ -0,0 +1,77 @@ +% slashbox.sty by Koichi Yasuoka, May 27, 1993 +% minor modification by Toru Sato, May 31, 1993 +\typeout{slashbox style by K.Yasuoka, May 1993.}% +\newbox\@slashboxa +\newbox\@slashboxb +\newbox\@slashboxc +\newcount\@slashboxwd +\newcount\@slashboxht +\newdimen\@slashsepl +\newdimen\@slashsepr +\def\slashbox{% + \def\@slashboxpicture##1{% + \put(0,0){\line(##1,1){\@slashboxwd}}% + \put(0,\@slashboxht){\makebox(0,0)[tl]{\box\@slashboxa}}% + \put(\@slashboxwd,0){\makebox(0,0)[br]{\box\@slashboxb}}% + }% + \@slashbox +}% +\def\backslashbox{% + \def\@slashboxpicture##1{% + \put(0,\@slashboxht){\line(##1,-1){\@slashboxwd}}% + \put(0,0){\makebox(0,0)[bl]{\box\@slashboxa}}% + \put(\@slashboxwd,\@slashboxht){\makebox(0,0)[tr]{\box\@slashboxb}}% + }% + \@slashbox +}% +\def\@slashbox{\@ifnextchar [{\@@slashbox}{\@@slashbox[0pt]}} +\def\@@slashbox[#1]{\@ifnextchar [{\@@@slashbox[#1]}{\@@@slashbox[#1][c]}} +\def\@@@slashbox[#1][#2]#3#4{% +% #1: width, #2: suppression of \tabcolsep on `l', `r', or `lr' side +% #3: left item, #4: right item + \@slashsepl=\tabcolsep + \@slashsepr=\tabcolsep + \@tfor\@tempa :=#2\do{\expandafter\let + \csname @slashsep\@tempa\endcsname=\z@}% + \setbox\@slashboxa=\hbox{\strut\hskip\tabcolsep\shortstack[l]{#3}}% + \setbox\@slashboxb=\hbox{\shortstack[r]{#4}\hskip\tabcolsep\strut}% + \setbox\@slashboxa=\hbox{\raise\dp\@slashboxa\box\@slashboxa}% + \setbox\@slashboxb=\hbox{\raise\dp\@slashboxb\box\@slashboxb}% + \setbox\@slashboxc=\hbox{% + \@tempdima=\wd\@slashboxa + \advance\@tempdima by \wd\@slashboxb + \advance\@tempdima by \@slashsepl + \advance\@tempdima by \@slashsepr + \@tempdimb=#1\relax% + \ifdim\@tempdimb>\@tempdima \@tempdima=\@tempdimb\fi% + \@tempdimb=\ht\@slashboxa + \advance\@tempdimb by \dp\@slashboxa + \advance\@tempdimb by \ht\@slashboxb + \advance\@tempdimb by \dp\@slashboxb + \@tempcnta=\@tempdima + \@tempcntb=\@tempdimb + \advance\@tempcnta by \@tempcntb + \advance\@tempcnta by -1 + \divide\@tempcnta by \@tempcntb + \ifnum\@tempcnta>6 \@tempcnta=6 + \@tempdimb=0.166666666\@tempdima + \else + \ifnum\@tempcnta<1 \@tempcnta=1\fi + \@tempdima=\@tempdimb + \multiply\@tempdima by \@tempcnta + \fi% + \advance\@tempdima by -\@slashsepl + \advance\@tempdima by -\@slashsepr + \@slashboxwd=\@tempdima + \@slashboxht=\@tempdimb + \@tempcntb=\@slashsepl + \setlength{\unitlength}{1sp}% + \begin{picture}(\@slashboxwd,\@slashboxht)(\@tempcntb,0) + \advance\@tempdima by \@slashsepl + \advance\@tempdima by \@slashsepr + \@slashboxwd=\@tempdima + \@slashboxpicture{\@tempcnta} + \end{picture}% + }% + $\vcenter{\box\@slashboxc}$% +}%