Difference between revisions of "Command/framed"

From Wiki
Jump to navigation Jump to search
m (cleanup)
Line 20: Line 20:
  
  
== Description ==  
+
== Description ==
  
 +
There are three variants of this command:
 +
 +
* <code>\framed</code>
 +
* <code>\inframed</code>
 +
* <code>\startframed</code>...<code>\stopframed</code>
 +
 +
As its name suggests, <code>\framed</code> draws a frame around its argument. For example
 +
 +
<context text="yields" source="yes">
 +
surrounding text \framed{framed text} surrounding text
 +
</context>
 +
 +
Notice that the bottom line of the frame is aligned with the baseline of text. Framed little cousin, <code>\inframed</code> can be used to align the baseline of framed text with the baseline of surrounding text. For example,
 +
 +
<context text="yields" source="yes">
 +
surrounding text \inframed{framed text} surrounding text
 +
</context>
  
 
== Example ==
 
== Example ==

Revision as of 02:21, 21 April 2010

\framed

Syntax

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


Description

There are three variants of this command:

  • \framed
  • \inframed
  • \startframed...\stopframed

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 can be used to align the baseline of framed text with the baseline of surrounding text. For example,

surrounding text \inframed{framed text} surrounding text

yields

Example

% this example demonstrates the different baselines of 
% \framed and \inframed

\starttext
\showstruts    % let us see where ConTeXt adjusts the size of the box
\hbox{this is a very \framed{good} \inframed{morning}, isn't it?}
\stoptext


Example

\starttext
% most simple framed
\framed{Hello}
\stoptext


See also

See also \inframed and \startframedtext.