Open main menu

Changes

2,669 bytes added ,  12:55, 29 August 2020
Created page with "Documentation for \framed"
<cd:commandgroup name="framed" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc>The command <tt>\framed</tt> is used for adding frames, backgrounds and styling to a segment of text.
</cd:shortdesc>
<cd:variants>
<cd:command category="rules" file="pack-rul.mkiv" interfacedate="2020-07-14T09:24" interfacefile="i-framed.xml" keywords="background" level="document" name="framed" variantnumber="1">
<cd:arguments>
<cd:assignments list="yes" optional="yes" ordinal="1">
<cd:assignmentsdoc></cd:assignmentsdoc>
<cd:inherit name="setupframed"></cd:inherit>
</cd:assignments>
<cd:content ordinal="2"></cd:content>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description>There are two variants of this command:

* {{cmd|framed}}
* {{cmd|inframed}}

On top of that, you can define your own versions with:

* {{cmd|defineframed}}

There are quite a lot of options, see

* {{cmd|setupframed}}</cd:description>
<cd:examples><cd:example title="">As its name suggests, <code>\framed</code> draws a frame around its argument. For example

<context source="yes">
\setuppapersize[A5]
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, {{cmd|inframed}} aligns the baseline of framed text with the baseline of surrounding text. For example,

<context source="yes">
\setuppapersize[A5]
surrounding text \inframed{framed text} surrounding text
</context>

The following example contrast the difference between framed and inframed.

<context source="yes">
\setuppapersize[A5]
\setuplayout[width=10em]
\setupalign[flushleft]

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

</context></cd:example><cd:example title="A frame filling the bottom of the page"><context source="yes">
\setuppapersize[A8]
\starttext
\input ward
\blank
\framed[width=\textwidth,height=\dimexpr\pagegoal-\pagetotal-\lineheight\relax]{}
\stoptext
</context></cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:commandref name="defineframed" originator="system"></cd:commandref>
<cd:commandref name="setupframed" originator="system"></cd:commandref>
<cd:source file="pack-rul.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Rules"></cd:wikipage>
<cd:wikipage originator="system" page="Keywords:Background"></cd:wikipage>
<cd:commandref name="_framed"></cd:commandref>
<cd:commandref name="inframed"></cd:commandref>
<cd:commandref name="startframedtext"></cd:commandref></cd:seealso>
</cd:commandgroup>