Difference between revisions of "Command/framed"

From Wiki
Jump to navigation Jump to search
m (→‎Options: dont't really need to show usage in each case)
Line 144: Line 144:
  
 
* The option <code>frame=on</code> (which is default) must be set, otherwise the frame will not be shown.
 
* The option <code>frame=on</code> (which is default) must be set, otherwise the frame will not be shown.
* The option <code>backgroundcolor=...</code> works with <code>corner=&lt;number&gt;</code> only if the shape is closed. Otherwise the background color is silently ignored.
+
* The option <code>backgroundcolor=...</code> works with <code>corner=&lt;number&gt;</code> only if the shape is closed (i.e., the number is less than or equal to 8). Otherwise the background color is silently ignored.
 
* The options <code>offset</code> and <code>frameoffset</code> can be used to increase the distance between the frame and the text.
 
* The options <code>offset</code> and <code>frameoffset</code> can be used to increase the distance between the frame and the text.
  

Revision as of 03:25, 21 April 2010

\framed

Syntax

\framed[...,...=...,...]{...}
[...,...=...,...] see \setupframed
{...} text


Description

There are two variants of this command:

As its name suggests, \framed draws a frame around its argument. For example

surrounding text \framed{framed text} surrounding text

yields

Notice that the bottom line of the frame is aligned with the baseline of text.

Framed little cousin, \inframed aligns the baseline of framed text with the baseline of surrounding text. For example,

surrounding text \inframed{framed text} surrounding text

yields

The following example contrast the difference between framed and inframed.

\setuplayout[width=10em]
\setupalign[flushleft]

Notice the difference between
\framed{framed} and \inframed{inframed},
especially considering its effect on linespacing...

Options

The first argument of framed takes the same key-value options as \setupframed.

height

Specifies the height of the frame.

  • Default value: broad
  • Most common alternative: fit
  • Other alternatives: any valid TeX dimension

width

Specifies the width of the frame.


frame

This option determines whether a frame is drawn or not.

Default value: on
Alternate value: off

Notes

  • frame=off is useful when background=... is used.

corner

This option determines whether or not the corners are round. It also allows drawing only selective corners.

Default value: rectangular
Most common alternative: round
Other values: any number between 0 and 28

Notes

  • The option frame=on (which is default) must be set, otherwise the frame will not be shown.
  • The option backgroundcolor=... works with corner=<number> only if the shape is closed (i.e., the number is less than or equal to 8). Otherwise the background color is silently ignored.
  • The options offset and frameoffset can be used to increase the distance between the frame and the text.

See also