EricK a écrit:Apparemment, il n'y a pas de documentation pour ce package sur ctan
La doc est dans le
fichier sty :
%====================== Begin Instructions =======================
%
% framed.sty
% ~~~~~~~~~~
% Create framed, shaded, or differently highlighted regions that can
% break across pages. The environments defined are
% framed -- ordinary frame box (\fbox) with edge at margin
% shaded -- shaded background (\colorbox) bleeding into margin
% snugshade -- similar
% leftbar -- thick vertical line in left margin
% to be used like
% \begin{framed}
% copious text
% \end{framed}
%
% But the more general purpose of this package is to facilitate the
% creation of environments that enable page breaking
% within arbitrary decorations using a simple new-environment definition
% incorporating \FrameCommand and
% \begin{MakeFramed}{settings} ... \end{MakeFramed}
%
% The "framed" environment uses "\fbox" as its "\FrameCommand" with
% the additional settings \fboxrule=\FrameRule and \fboxsep=\FrameSep.
% You can change these lengths (using \setlength) and you can change
% the definition of \FrameCommand to use much fancier boxes.
%
% In fact, the "shaded" environment just redefines \FrameCommand to be
% \colorbox{shadecolor} (and you have to define the color "shadecolor":
% \definecolor{shadecolor}...).
%
% A page break is allowed, and even encouraged, before the framed
% environment. If you want to attach some text (a box title) to the
% frame, then the text should be inserted by \FrameCommand.
%
% The contents of the framed regions are restricted:
% Floats, footnotes, marginpars and head-line entries will be lost.
% (Some of these may be handled in a later version.)
% This package will not work with the page breaking of multicol.sty,
% or other systems that perform column-balancing.
%
% The MakeFramed environment does the work. Its "settings" argument
% should contain any adjustments to the text width (applied to \hsize,
% and using the "\width" of the frame itself) as well as a "restore"
% command -- \@parboxrestore or \FrameRestore or something similar;
% as an example, the snugshade environment shows how to suppress excess
% spacing within the box, copying the code from minipage.
%
% Expert commands:
% \MakeFramed, \endMakeFramed: the "MakeFramed" environment
% \FrameCommand: command to draw the frame around its argument
% \FrameRestore: restore some text settings, but fewer than \@parboxrestore
% \FrameRule: length register; \fboxrule for default "framed".
% \FrameSep: length register; \fboxsep for default "framed".
% \FrameHeightAdjust: macro; height of frame above baseline at top of page
%
% This is still a `pre-production' version because I can think of many
% features/improvements that should be made. Nevertheless, starting
% with version 0.5 it should be bug-free.
%
% ToDo:
% Test more varieties of list
% Improve and correct documentation
% Propagation of \marks
% Handle footnotes (how??) floats (?) and marginpars.
% Stretchability modification.
%======================== End Instructions ========================
L'environnement leftbar, que j'ai un peu modifié, est défini plus bas dans le fichier. La syntaxe de base est que l'argument de \FrameCommand est la boîte du texte découpé, donc pour mettre quelque chose avant et après, il suffit de mettre quelque chose avant et après #1 ; par exemple, pour faire un environnement bracebars qui entoure les boîtes de \left\{ et \right\}, on peut faire ainsi :
- Code: Tout sélectionner
\newcommand{\bracebox}[1]{$\left\{\hspace{5pt}\vcenter{#1}\hspace{5pt}\right\}$}
\newenvironment{bracebars}{%
\def\FrameCommand{\bracebox}%
\MakeFramed {\advance\hsize-\width \FrameRestore}}%
{\endMakeFramed}
(J'ai défini une commande auxilliaire \bracebox pour éviter les problèmes de doublement de # pour les définitions dans un environnement ; le \vcenter est là pour des raisons techniques.)