From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/boites/boites.dtx | 676 +++++++++++++++++++++++++++++++++ 1 file changed, 676 insertions(+) create mode 100644 macros/latex/contrib/boites/boites.dtx (limited to 'macros/latex/contrib/boites/boites.dtx') diff --git a/macros/latex/contrib/boites/boites.dtx b/macros/latex/contrib/boites/boites.dtx new file mode 100644 index 0000000000..a2d8f82348 --- /dev/null +++ b/macros/latex/contrib/boites/boites.dtx @@ -0,0 +1,676 @@ +%\CheckSum{242} +%\iffalse ^^A meta-comment +% boites.dtx +% +%% Copyright (c) José Romildo Malaquias , 2013 +%% (maintainer) +%% Copyright (c) Markus Kohm , 2009 +%% (boites.dtx only) +%% Copyright (c) Susan Dittmar , 2009 +%% (english translation) +%% Copyright (c) Vincent Zoonekynd , 1998-1999 +%% (boites.sty) +%% +%% This work was derived from Susan Dittmar's translated version of +%% Vincent Zoonekynd's boites.sty. +%% +%% This file is distributed unter the same license like the orignal +%% boites.sty from March 1999: The GNU Public Licence. +%% +% +%<*dtx|driver|package> +%<*dtx> +\ifx\ProvidesFile\undefined +\def\batchfile{boites.dtx} +\input docstrip.tex +\keepsilent +\askforoverwritefalse +\preamble +\endpreamble +\generate{% + \file{boites-fr.drv}{\from{boites.dtx}{driver,french}}% + \file{boites-en.drv}{\from{boites.dtx}{driver,english}}% +% \file{boites-p.sty}{\from{boites.dtx}{package}}% just use original boites.sty! +} +\ifToplevel{\csname fi\endcsname\csname fi\endcsname} +\csname endinput\endcsname +\fi +\ProvidesFile{boites.dtx}[% +% +%\ProvidesFile{boites-en.tex}[% +%\ProvidesFile{boites-fr.tex}[% +%\ProvidesPackage{boites-p}[% +2009/05/06 v1.0a from boites.sty derived +%<*dtx> +dtx file] +% +%<*driver> +%english +%french +%documentation] +% +%package] +% +%<*dtx|driver> +\documentclass{ltxdoc} +\usepackage[utf8]{inputenc} +%<*dtx> +\usepackage[french,english]{babel} +% +%\usepackage[english]{babel} +%\usepackage[french]{babel} +\expandafter\newif\csname ifenglish\endcsname +\expandafter\newif\csname iffrench\endcsname +\newcommand*{\selectenglish}{% + \selectlanguage{english}% + \englishtrue + \frenchfalse +} +\newcommand*{\selectfrench}{% + \selectlanguage{french}% + \englishfalse + \frenchtrue +} +\usepackage{hyperref}\renewcommand*{\theHsection}{\theHpart.\thesection} +\begin{document} +\RecordChanges +%<*dtx|english> +\selectenglish +\DocInput{boites.dtx} +% +%<*dtx|french> +\selectfrench +\DocInput{boites.dtx} +% +\end{document} +% +%\fi ^^A meta-comment +% +% \GetFileInfo{boites.dtx} +% +%\iffrench +% \title{\textsf{boites}\thanks{\fileversion, \filedate}} +% \author{Vincent Zoonekynd\thanks{\texttt{zoonek@math.jussieu.fr}}} +% \date{\filedate} +%\fi +%\ifenglish +% \title{Package \textsf{boites}\thanks{\fileversion, \filedate}} +% \author{Vincent Zoonekynd\thanks{\texttt{zoonek@math.jussieu.fr}}% +% \and +% Susan Dittmar (translation of the documentation)% +% \thanks{\texttt{Susan.Dittmar@gmx.de}}} +%\fi +% \let\Title\title +% \let\Author\author +% \let\Maketitle\maketitle +% \maketitle +% \setcounter{section}{0} +% \let\maketitle\Maketitle +% \let\author\Author +% \let\title\Title +% +% \iffrench \setcounter{part}{2}\part{Franzaise}\fi +% \ifenglish \setcounter{part}{1}\part{English}\fi +% +%\iffrench\section{Modifiations par VZ, Juillet 1998}\fi +%\ifenglish\section{Modifications by VZ, July 1998}\fi +% +% \begin{description} +% \ifenglish\item[May 2009:] Original file \texttt{README} included\fi +% \ifenglish\item[January 2009:] Translations of the french comments by +% Susan Dittmar.\fi +% \iffrench\item[Mars 1999:] Il y a certaines lignes à ne pas numéroter (par +% exemple, celles qui ne contiennent que des espaces +% verticaux avant ou après une énumération).\fi +% \ifenglish\item[March 1999:] Some lines are not taken in correctly (for +% example those that contain only vertical space before or after +% an enumeration).\fi +% \iffrench\item[Mars 1999:] commentaires\fi +% \ifenglish\item[March 1999:] comments\fi +% \end{description} +% +%\iffrench +% Il y a quelques bugs, en particulier des traits qui sont trop +% longs, trop courts, trop épais ou trop fins. Si Quelqu'un sait à +% quoi c'est dû, qu'il me le dise. +% +% Il ne devrait plus y avoir de problème à cause d'un environement de +% type liste (itemize, enumerate, etc.) à l'intérieur des boites. +% +% D'après : +%\fi +%\ifenglish +% There are some bugs, in particular some lengths that are too long, +% too short, too low, or too fine. If someone knows what causes this, +% please tell me. +% +% The problem with list environments (itemize, enumerate, etc.) inside +% the boite environment should not longer exist. +% +% Based upon: +%\fi +% \textsf{eclbkbox.sty} by Hideki Isozaki, 1992; +% Date: May 28, 1993. +% +% \ifenglish +% \section{User Documentation} +% \begin{flushleft} +% \texttt{boites.sty} (boxes that may break across pages)\\ +% \copyright\ 1998--1999 Vincent Zoonekynd \textless +% zoonek@math.jussieu.fr\textgreater\\ +% Distributed under the GNU Public Licence +% \end{flushleft} +% +% \subsection{Description} +% These environments allow page breaks inside framed boxes. +% They include a few examples (shaded box, box with a wavy +% line on its side, etc.) +% +% See also +% \href{http://www.ctan.org/pkg/framed} +% {macros/latex/contrib/other/misc/framed.sty}. +% +% \subsection{Usage} +% +% \paragraph{In the preamble:} +% \begin{verbatim} +% \usepackage{boites,boites_examples,graphicx} +% \end{verbatim} +% +% \paragraph{Before using the various environments:} +% \begin{description} +% \item[\cs{bkcounttrue}:] the lines will be numbered +% \item[\cs{bkcountfalse}:] the lines will not be numbered +% \end{description} +% +% \paragraph{Boxed text with a title:} +% \begin{verbatim} +% \begin{boiteepaisseavecuntitre} +% ... +% \end{boiteepaisseavecuntitre} +% \end{verbatim} +% +% \paragraph{Text with a double vertical line on the left and a number} +% (17, in this example): +% \begin{verbatim} +% \begin{boitenumeroteeavecunedoublebarre}{17} +% ... +% \end{boitenumeroteeavecunedoublebarre} +% \end{verbatim} +% +% \paragraph{Text with a wavy line on the left:} +% \begin{verbatim} +% \begin{boiteavecunelignequiondulesurlecote} +% ... +% \end{boiteavecunelignequiondulesurlecote} +% \end{verbatim} +% +% \paragraph{Shaded box:} +% \begin{verbatim} +% \begin{boitecoloriee} +% ... +% \end{boitecoloriee} +% \end{verbatim} +% +% If you wish other kinds of boxes, have a look at +% \texttt{boites\_examples.sty} and feel free to adapt the macros. Examples +% for several kinds of boxes are shown at +% \href{boites_exemples.pdf}{\texttt{boites\_exemples.pdf}}. +% +% \subsection{Features} +% \begin{itemize} +% \item These environments may be nested. +% \item They may appear in a multicols environment. +% \item Floating material, footnotes, marginpars appearing inside +% them will be lost. +% \end{itemize} +% \fi +% +% \iffrench\section{Guide d'utilisateur} +% Cette section n'existe malheureusement que dans la version anglaise.\fi +% +% \StopEventually{\PrintIndex\PrintChanges} +% +% \section{Implementation} +% +%\iffalse +%<*package> +%\fi +% +% \begin{macrocode} +\newbox\bk@bxb +\newbox\bk@bxa +\newif\if@bkcont +\newif\ifbkcount +\newcount\bk@lcnt + +\def\breakboxskip{2pt} +\def\breakboxparindent{1.8em} +% \end{macrocode} +% +% \iffrench\subsection{Paramètres modifiables}\fi +% \ifenglish\subsection{parameters that can be modified}\fi +% \begin{macrocode} +\def\bkvz@before@breakbox{\ifhmode\par\fi\vskip\breakboxskip\relax} +% \end{macrocode} +% +% \iffrench +% Ce que l'on met à gauche du texte, par exemple, une ligne verticale +% pour faire un cadre, ou une ligne qui ondule. +% \fi +% \ifenglish +% What should be put on the left of the text, for example a vertical +% line for a frame, or a wavy line. +% \fi +% \begin{macrocode} +\def\bkvz@left{\vrule \@width\fboxrule\hskip\fboxsep} +% \end{macrocode} +% +% \iffrench De même, ce que l'on met à droite,\fi +% \ifenglish Analog; what should be put on the right,\fi +% \begin{macrocode} +\def\bkvz@right{\hskip\fboxsep\vrule \@width\fboxrule} +% \end{macrocode} +% +% \iffrench en haut\fi +% \ifenglish above\fi +% \begin{macrocode} +\def\bkvz@top{\hrule\@height\fboxrule} +% \end{macrocode} +% +% \iffrench ou en bas\fi +% \ifenglish and below.\fi +% \begin{macrocode} +\def\bkvz@bottom{\hrule\@height\fboxrule} +% \end{macrocode} +% +% \iffrench +% Si vous modifiez l'une de ces macros, il ne faut pas oublier de +% modifier aussi la suivante, qui change la valeur de \cs{linewidth} en +% lui retirant la largeur de tout ce que l'on vient de mettre sur le +% côté. +% \fi +% \ifenglish +% If you modify one of those macros, don't forget to modify also +% the following. It reduces the value of \cs{linewidth} by the width +% of all that will be put on the edges. +% \fi +% \begin{macrocode} +\def\bkvz@set@linewidth{\advance\linewidth -2\fboxrule + \advance\linewidth -2\fboxsep} +% \end{macrocode} +% +% \iffrench FIN DES PARAMÈTRES MODIFIABLES\fi +% \ifenglish END OF PARAMETERS THAT CAN BE MODIFIED\fi +% +% \iffrench \subsection{Le début de l'environement}\fi +% \ifenglish \subsection{The start of the environment}\fi +% \begin{macrocode} +\def\breakbox{% +% \end{macrocode} +% \iffrench +% On n'est pas nécessairement en mode vertical. +% C'est \cs{bkvz@before@breakbox} qui s'en occupe (ou non). +% \fi +% \ifenglish +% Start is not necessarily in vertical mode. +% \cs{bkvz@before@breakbox} deals with this (if necessary). +% \fi +% \begin{macrocode} + \bkvz@before@breakbox +% \end{macrocode} +% \iffrench on met tout dans une \cs{vbox} (\cs{bk@bxb})\fi +% \ifenglish put all in one \cs{vbox} (\cs{bk@bxb})\fi +% \begin{macrocode} + \setbox\bk@bxb\vbox\bgroup +% \end{macrocode} +% \iffrench +% À l'intérieur de cette \cs{vbox}, on change la valeur de \cs{hsize} (et +% aussi \cs{linewidth}). +% \fi +% \ifenglish Inside this \cs{vbox}, change \cs{hsize} (and \cs{linewidth}).\fi +% \begin{macrocode} + \bkvz@set@linewidth + \hsize\linewidth +% \end{macrocode} +% \iffrench je ne sais pas ce que fait la commande \cs{@parboxrestore}.\fi +% \ifenglish I do not know what \cs{@parboxrestore} does.\fi +% \begin{macrocode} + \@parboxrestore +% \end{macrocode} +% \iffrench On indente éventuellement, si l'utilisateur le désire.\fi +% \ifenglish Indent if the user so desires.\fi +% \begin{macrocode} + \parindent\breakboxparindent\relax} +% \end{macrocode} +% +% \iffrench On coupe la boite\fi +% \ifenglish Cut the box\fi +% +% \cs{@tempdimb}: amount of vertical skip +% between the first line (\cs{bk@bxa}) and the rest (\cs{bk@bxb}) +% \begin{macrocode} +\def\bk@split{% +% \end{macrocode} +% \iffrench On calcule la hauteur totale (hauteur + profondeur) de la boite.\fi +% \ifenglish Calculate the total height (height + depth) of the box.\fi +% \begin{macrocode} + \@tempdimb\ht\bk@bxb % height of original box + \advance\@tempdimb\dp\bk@bxb +% \end{macrocode} +% \iffrench +% On coupe, à l'aide de la commande \cs{vsplit}\dots to 0pt +% Le morceau du haut se retrouve dans \cs{bk@bxa}, +% celui du bas dans \cs{bk@bxb}. +% \fi +% \ifenglish +% Cut with the help of \cs{vsplit}\dots to 0pt +% The height can then be found in \cs{bk@bxa}, +% the depth in \cs{bk@bxb}. +% \fi +% \begin{macrocode} +\setbox\bk@bxa\vsplit\bk@bxb to\z@ % split it +% \end{macrocode} +% \iffrench +% L'un des problèmes, c'est que la première boite a une hauteur vide. +% On peut lui redonner sa hauteur initiale grace à |\vbox{\unvbox...}| +% \fi +% \ifenglish +% A problem arises if the first box has an empty height. +% It can be given back its initial height via |\vbox{\unvbox...}| +% \fi +% \begin{macrocode} + \setbox\bk@bxa\vbox{\unvbox\bk@bxa}% recover height & depth of \bk@bxa +% \end{macrocode} +% \iffrench +% L'autre problème, c'est que l'on a perdu l'espace (interligne) entre +% nos deux boites. Pour le récupérer, on ajoute la hauteur de ces deux +% boites, et on fait la différence avec la hauteur initiale. +% \fi +% \ifenglish +% The other problem is to forget the (interline) space between our +% our two boxes. To regain it, add the height of the two boxes +% and subtract that from the initial height. +% \fi +% \begin{macrocode} + \setbox\@tempboxa\vbox{\copy\bk@bxa\copy\bk@bxb}% naive concatenation + \advance\@tempdimb-\ht\@tempboxa + \advance\@tempdimb-\dp\@tempboxa +% \end{macrocode} +% \iffrench +% Désormais, \cs{@tempdimb} contient l'espace entre les deux boites, que +% l'on utilisera avec \cs{bk@addskipdp}. +% \fi +% \ifenglish +% Now, \cs{@tempdimb} contains the space between the two boxes, +% which will be used with \cs{bk@addskipdp}. +% \fi +% \begin{macrocode} +}% gap between two boxes +% \end{macrocode} +% +% \iffrench Rajouter \cs{fboxsep} à la première ligne\fi +% \ifenglish Add \cs{fboxsep} to the first line\fi +% +% \cs{@tempdima}: height of the first line (\cs{bk@bxa}) + \cs{fboxsep} +% \begin{macrocode} +\def\bk@addfsepht{% + \setbox\bk@bxa\vbox{\vskip\fboxsep\box\bk@bxa}} +% \end{macrocode} +% +% \iffrench Cette macro n'est pas utilisée\fi +% \ifenglish This macro is not used anywhere\fi +% \begin{macrocode} +\def\bk@addskipht{% + \setbox\bk@bxa\vbox{\vskip\@tempdimb\box\bk@bxa}} +% \end{macrocode} +% +% \iffrench Rajouter \cs{fboxsep} à la dernière ligne\fi +% \ifenglish Add \cs{fboxsep} to the last line\fi +% +% \cs{@tempdima}: depth of the first line (\cs{bk@bxa}) + \cs{fboxsep} +% \begin{macrocode} +\def\bk@addfsepdp{% + \@tempdima\dp\bk@bxa + \advance\@tempdima\fboxsep + \dp\bk@bxa\@tempdima} +% \end{macrocode} +% +% \iffrench Rajouter l'espace qui a été perdu par \cs{vsplit}\dots\ to 0pt\fi +% \ifenglish Add the space that had been lost by \cs{vsplit}\dots\ to 0pt\fi +% +% \cs{@tempdima}: depth of the first line (\cs{bk@bxa}) + vertical skip +% \begin{macrocode} +\def\bk@addskipdp{% + \@tempdima\dp\bk@bxa + \advance\@tempdima\@tempdimb + \dp\bk@bxa\@tempdima} +% \end{macrocode} +% +% \iffrench +% On ne compte pas toutes les lignes, mais uniquement celles qui en +% sont vraiment. J'ai pris comme critère une largeur supérieure à +% 1mm. La même distance se retrouve un peu plus loin, dans +% \cs{bk@line}. +% \fi +% \ifenglish +% Not all lines are computed, only cells that truely are there. +% I have taken as criterion a size of minimum 1mm. +% The same distance can be found further on, in \cs{bk@line}. +% \fi +% \begin{macrocode} +\def\bkvz@countlines{% + \ifdim\wd\bk@bxa>1mm\advance\bk@lcnt\@ne\fi +} +% \end{macrocode} +% +% \iffrench Afficher la ligne que l'on vient de couper\fi +% \ifenglish show the line we had cut\fi +% \begin{macrocode} +\def\bk@line{% + \hbox to \linewidth{% + \ifdim\wd\bk@bxa>1mm + \ifbkcount\smash{\llap{\the\bk@lcnt\ }}\fi + \fi + \bkvz@left + \box\bk@bxa +% \end{macrocode} +% \iffrench +% Il arrive que la boite ne soit pas aussi large que la ligne +% (par exemple, espace avant une énumération) +% \fi +% \ifenglish +% Sometimes the box is not big enough for a line (for example, +% space before an enumeration) +% \fi +% \begin{macrocode} + \hfil + \bkvz@right}} +% \end{macrocode} +% +% \iffrench La fin de l'environement\fi +% \ifenglish The end of the environment\fi +% \begin{macrocode} +\def\endbreakbox{% +% \end{macrocode} +% \iffrench On ferme la \cs{vbox} (\cs{bk@bxb})\fi +% \ifenglish Close the \cs{vbox} (\cs{bk@bxb})\fi +% \begin{macrocode} + \egroup +% \ifhmode\par\fi + {\noindent +% \end{macrocode} +% \iffrench On remet le compteur de lignes à un.\fi +% \ifenglish Set line count back to one.\fi +% \begin{macrocode} + \bk@lcnt 0 +% \end{macrocode} +% \iffrench Le booléen que nous allons utiliser dans la boucle plus loin.\fi +% \ifenglish The boolean we will use in the following loop.\fi +% \begin{macrocode} + \@bkconttrue +% \end{macrocode} +% \iffrench +% Comme on va empiler des boites, on met certains ressorts à zéro, +% pour éviter les espaces verticaux non désirés. +% \fi +% \ifenglish +% While putting together the boxes, some ajustable lengths are set +% to zero to avoid undesired vertical space. +% \fi +% \begin{macrocode} + \baselineskip\z@ + \lineskiplimit\z@ + \lineskip\z@ + \vfuzz\maxdimen +% \end{macrocode} +% \iffrench On coupe la boite\fi +% \ifenglish split the boxes\fi +% \begin{macrocode} + \bk@split +% \end{macrocode} +% \iffrench On ajoute un peu d'espace vertical (\cs{fboxsep}) au dessus\fi +% \ifenglish Add a bit of vertical space (\cs{fboxsep}) above\fi +% \begin{macrocode} + \bk@addfsepht +% \end{macrocode} +% \iffrench +% On ajoute en dessous l'espace qui avait été perdu par la commande +% \cs{vsplit}. +% \fi +% \ifenglish +% Add below the space that had been forgotten due to the use of +% the \cs{vsplit} command. +% \fi +% \begin{macrocode} + \bk@addskipdp +% \end{macrocode} +% \iffrench De deux choses l'une,\fi +% \ifenglish First of two,\fi +% \begin{macrocode} + \ifvoid\bk@bxb +% \end{macrocode} +% \iffrench Soit, il n'y a qu'une ligne\fi +% \ifenglish In case there's only one line\fi +% \begin{macrocode} + \def\bk@fstln{% +% \end{macrocode} +% \iffrench On rajoute un peu d'espace (\cs{fboxsep}) en dessous.\fi +% \ifenglish Add a bit of space (\cs{fboxsep}) below.\fi +% \begin{macrocode} + \bk@addfsepdp +% \end{macrocode} +% \iffrench +% On construit la boite : le haut, le milieu (qui contient la gauche +% et la droite) et le bas. +% \fi +% \ifenglish +% Construct the box: the top, the middle (which contains +% the left and right parts) and the foot. +% \fi +% \begin{macrocode} + \bkvz@countlines + \vbox{\bkvz@top\bk@line\bkvz@bottom}}% +% \end{macrocode} +% \iffrench Soit, il y en a plusieurs.\fi +% \ifenglish In case there's more to do.\fi +% \begin{macrocode} + \else + \def\bk@fstln{% +% \end{macrocode} +% \iffrench On met le haut\fi +% \ifenglish Put in the top\fi +% \begin{macrocode} + \bkvz@countlines + \vbox{\bkvz@top\bk@line}% +% \end{macrocode} +% \iffrench ??? (Si on l'enlève, ça ne marche plus.)\fi +% \ifenglish ??? (If this is removed, it does not work any more.)\fi +% \begin{macrocode} + \hfil +% \end{macrocode} +% \iffrench On commence à compter les lignes\fi +% \ifenglish Continue counting lines\fi +% \begin{macrocode} +% \advance\bk@lcnt\@ne %%%%%%%%%%%%%%%%%%%% Voir \bkvz@countlines +% \end{macrocode} +% \iffrench Début de la boucle\fi +% \ifenglish Begin of the loop\fi +% \begin{macrocode} + \loop +% \end{macrocode} +% \iffrench On coupe ce qui reste de la boite.\fi +% \ifenglish Cut out the next bit of the box.\fi +% \begin{macrocode} + \bk@split +% \end{macrocode} +% \iffrench On rajoute l'espace vertical qui a été perdu.\fi +% \ifenglish Add the vertical space that has been left out.\fi +% \begin{macrocode} + \bk@addskipdp +% \end{macrocode} +% \iffrench Éventuellement, on augmente le numéro de la ligne\fi +% \ifenglish advance number of lines if necessary\fi +% \begin{macrocode} + \bkvz@countlines +% \end{macrocode} +% ??? +% \begin{macrocode} + leavevmode +% \end{macrocode} +% \iffrench S'il s'agit de la dernière ligne\fi +% \ifenglish If it's the last line\fi +% \begin{macrocode} + \ifvoid\bk@bxb +% \end{macrocode} +% \iffrench On met le booléen indiquant que la boucle doit se poursuivre à +% FAUX.\fi +% \ifenglish Set the boolean that indicates continuing the loop to FALSE.\fi +% \begin{macrocode} + \@bkcontfalse +% \end{macrocode} +% \iffrench On met un peu d'espace vertical (\cs{fboxsep})\fi +% \ifenglish Add a bit of vertical space (\cs{fboxsep})\fi +% \begin{macrocode} + \bk@addfsepdp +% \end{macrocode} +% \iffrench En envoie la dernière ligne.\fi +% \ifenglish Add the last line.\fi +% \iffrench POURQUOI \cs{vtop} ??? Pour que l'éventuel numéro de ligne soit à +% la bonne hauteur.\fi +% \ifenglish WHY \cs{vtop}??? Because the line number has correct height.\fi +% \begin{macrocode} + \vtop{\bk@line\bkvz@bottom}% + \else % 2,...,(n-1) + \bk@line + \fi + \hfil +% \end{macrocode} +% \iffrench Voir \cs{bkvz@countlines}\fi +% \ifenglish See \cs{bkvz@countlines}\fi +% \begin{macrocode} +% \advance\bk@lcnt\@ne + \if@bkcont\repeat}% + \fi + \leavevmode\bk@fstln\par}\vskip\breakboxskip\relax} +% \end{macrocode} +% \begin{macrocode} +\bkcountfalse +% \end{macrocode} +% +%\iffalse +% +%\fi +% +% \Finale +% +\endinput +% +% end of `boites.dtx' +% +% \iffalse +%%% Local Variables: +%%% mode: doc-tex +%%% TeX-master: t +%%% End: +% \fi -- cgit v1.2.3