• No results found

The framed package

N/A
N/A
Protected

Academic year: 2021

Share "The framed package"

Copied!
3
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

The framed package

Donald Arseneau (asnd@triumf.ca)

2012/05/31

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 oframed – framed with open top/bottom at page breaks

shaded – shaded background (\colorbox) bleeding into margin shaded* – shaded background (\colorbox) with edge at margin snugshade – shaded with tight fit around text (esp. in lists) snugshade* – like snugshade with shading edge at margin leftbar – thick vertical line in left margin

titled-frame – frame with title-bar; template for others to be used like

\begin{framed} copious text \end{framed}

But the more general purpose of this package is to facilitate the defini-tion of new environments that take multi-line material, wrap it with some non-breakable formatting (some kind of box or decoration) and allow page breaks in the material. Such environments are defined to declare (or use) \FrameCommandfor applying the boxy decoration, and \MakeFramed{〈settings〉} . . . \endMakeFramed wrapped around the main text (environment body).

The “framed” environment uses \fbox, by default, 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.

This manual corresponds to framed v0.96, dated 2011/10/22.

(2)

In fact, the “shaded” environment just redefines \FrameCommand to be \colorbox{shadecolor} (and you have to define the color “shadecolor”: \definecolor{shadecolor}...).

Although the intention is for other packages to define the varieties of decora-tion, a command \OpenFbox is defined for frames with open tops or bottoms, and used for the “oframed” environment. This facility is based on a more com-plex and capable command \CustomFBox which can be used for a wider range of frame styles. One such style of a title-bar frame with continuation marks is pro-vided as an example. It is used by the “titled-frame” environment. To make use of titled-frame in your document, or the \TitleBarFrame command in your own environment definitions, you must define the colors TFFrameColor (for the frame) and a contrasting TFTitleColor (for the title text).

A page break is allowed, and even encouraged, before the framed and other environments. If you want to attach some text (a box title) to the frame, then the text should be inserted by \FrameCommand so it cannot be separated from the body.

The contents of the framed regions are restricted: Floats, footnotes, margin-pars 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 (via a setting of \hsize). Here, the parameter \width gives the measured extra width added by the frame, so a common setting is “\advance\hsize-\width” which reduces the width of the text just enough that the outer edge of the frame aligns with the margins. The “〈settings〉” should also include a ‘restore’ command – \@parboxrestore or \FrameRestoreor something similar; for instance, the snugshade environment uses settings to eliminate list indents and vertical space, but uses \hspace in its \FrameCommand to reproduce the list margin ouside the shading.

There are actually four variants of \FrameCommand to allow different format-ting for each part of an environment broken over pages. Unbroken text is adorned by \FrameCommand, whereas split text first uses \FirstFrameCommand, possibly followed by \MidFrameCommand, and finishing with \LastFrameCommand. The default definitions for these three just invokes \FrameCommand, so that all por-tions are framed the same way. See the oframe environment for use of distinct First/Mid/Last frames.

(3)

Expert commands:

• \MakeFramed, \endMakeFramed: the “MakeFramed” environment • \FrameCommand: command to draw the frame around its argument • \FirstFrameCommand: the frame for the first part of a split environment • \LastFrameCommand: frame for the last portion

• \MidFrameCommand: for any intermediate segments

• \FrameRestore: restore some text settings, but fewer than \@parbox-restore

• \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

• \OuterFrameSep: vertical space before and after the framed env.; defaults to \topsep

This is still a ‘pre-production’ version because I can think of many fea-tures/improvements that should be made. Also, a detailed manual needs to be written. 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.

Referenties

GERELATEERDE DOCUMENTEN

1. Vervoer en ~erblyf van leer1inge gedurende die skool- vakansies.. Kandel: A:m.erican Jl:duc ion in the Tvventieth Century. Lugtenburg~ G-eskieden van die Onderwys

De 2toDrivers zijn niet meer of minder gericht op veiligheid, en ook niet meer of minder gericht op snelheid of op zoek naar spannende zaken dan jonge- ren die niet meedoen

The SPECTACOLOR (Screening Patients for Efficient Clinical Trial Access in COLORectal cancer) study is a new programme of the European Organisation for Research and Treatment of

I used to live online, on my computer, in a virtual world.” Part of this can be attributed to the fact, while Cibele does memorialise certain media objects and technologies and

The participation of women within the South African labour market is one of the variables showing that decent work in respect of equal treatment and

Note that the optional argument for the command counts the lines for the

The study attempts to share the IFC Against AIDS program experiences with the private and public sector, non-governmental organizations and interest business organizations to

In een cirkel trekt men de koorde AB en aan de grootste boog een raaklijn // AB met raakpunt C.. Bewijs: CA