Changes

Jump to navigation Jump to search
15,839 bytes added ,  13:32, 29 August 2020
Created page with "Documentation for \setupframed"
<cd:commandgroup name="setupframed" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc><!-- a short command summary goes here -->
The command <tt>\setupframed</tt> is used for configuring {{cmd|framed}} and instances of {{gen|framed}}
</cd:shortdesc>
<cd:variants>
<cd:command category="rules" file="pack-rul.mkiv" interfacedate="2020-07-14T09:24" interfacefile="i-framed.xml" keywords="background" level="style" name="setupframed" variantnumber="1">
<cd:arguments>
<cd:keywords list="yes" optional="yes" ordinal="1">
<cd:keywordsdoc>The name of an instance of {{gen|framed}}. Not needed for the {{cmd|framed}} command itself.</cd:keywordsdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:keywords>
<cd:assignments list="yes" ordinal="2">
<cd:assignmentsdoc></cd:assignmentsdoc>
<cd:parameter name="corner">
<cd:paramdoc>This option determines whether or not the corners of the frame and background are rounded. It also allows drawing only selected corners. See the example below.</cd:paramdoc>
<cd:constant default="yes" type="rectangular">square corners</cd:constant>
<cd:constant type="round">rounded corners</cd:constant>
<cd:constant type="cd:number"></cd:constant>
</cd:parameter>
<cd:parameter name="framecorner">
<cd:paramdoc>This option applies only to the frame corners.</cd:paramdoc>
<cd:constant default="yes" type="rectangular"></cd:constant>
<cd:constant type="round"></cd:constant>
<cd:constant type="cd:number"></cd:constant>
</cd:parameter>
<cd:parameter name="backgroundcorner">
<cd:paramdoc>This option applies only to the background corners.</cd:paramdoc>
<cd:constant default="yes" type="rectangular"></cd:constant>
<cd:constant type="round"></cd:constant>
<cd:constant type="cd:number"></cd:constant>
</cd:parameter>
<cd:parameter name="radius">
<cd:paramdoc>background and frame corner radius, if <cd:iref name="corner" type="round"/></cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="frameradius">
<cd:paramdoc>frame radius, if <cd:iref name="framecorner" type="round"/></cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="backgroundradius">
<cd:paramdoc>background radius, if <cd:iref name="backgroundcorner" type="round"/></cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="depth">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="framedepth">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="backgrounddepth">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="framecolor">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:color"></cd:constant>
</cd:parameter>
<cd:parameter name="topframe">
<cd:paramdoc></cd:paramdoc>
<cd:constant default="yes" type="on"></cd:constant>
<cd:constant type="off"></cd:constant>
<cd:constant type="small"></cd:constant>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="bottomframe">
<cd:paramdoc></cd:paramdoc>
<cd:constant default="yes" type="on"></cd:constant>
<cd:constant type="off"></cd:constant>
<cd:constant type="small"></cd:constant>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="leftframe">
<cd:paramdoc></cd:paramdoc>
<cd:constant default="yes" type="on"></cd:constant>
<cd:constant type="off"></cd:constant>
<cd:constant type="small"></cd:constant>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="rightframe">
<cd:paramdoc></cd:paramdoc>
<cd:constant default="yes" type="on"></cd:constant>
<cd:constant type="off"></cd:constant>
<cd:constant type="small"></cd:constant>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="region">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="yes"></cd:constant>
<cd:constant default="yes" type="no"></cd:constant>
</cd:parameter>
<cd:parameter name="rulethickness">
<cd:paramdoc>sets the thickness of the frame border.</cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="frameoffset">
<cd:paramdoc>Gives frame an extra offset without affecting surrounding text.</cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="frame">
<cd:paramdoc>This option determines whether a frame is drawn or not.</cd:paramdoc>
<cd:constant default="yes" type="on"></cd:constant>
<cd:constant type="off"></cd:constant>
<cd:constant type="overlay"></cd:constant>
<cd:constant type="small"></cd:constant>
<cd:constant type="closed"></cd:constant>
<cd:constant type="none"></cd:constant>
</cd:parameter>
<cd:parameter name="background">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="foreground"></cd:constant>
<cd:constant type="color">a color, to be set with <cd:iref name="backgroundcolor"/> {{todo|backgroundcolor is not documented.}}</cd:constant>
<cd:constant type="cd:name">a named background ??</cd:constant>
</cd:parameter>
<cd:parameter name="backgroundoffset">
<cd:paramdoc>Gives background an extra offset without affecting surrounding text.</cd:paramdoc>
<cd:constant type="frame"></cd:constant>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="component">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="extras">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:command"></cd:constant>
</cd:parameter>
<cd:parameter name="foregroundstyle">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:style"></cd:constant>
<cd:constant type="cd:command"></cd:constant>
</cd:parameter>
<cd:parameter name="foregroundcolor">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:color"></cd:constant>
</cd:parameter>
<cd:parameter name="setups">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="offset">
<cd:paramdoc>This is the offset around the framed content. The frame itself is controlled by <cd:iref name="frameoffset"/></cd:paramdoc>
<cd:constant type="default">set to 0.25ex.</cd:constant>
<cd:constant type="overlay">set to 0pt. If the frame is inside another one then the frame lines will overlap.</cd:constant>
<cd:constant type="none">set to 0pt. If the frame is inside another frame then the frame lines are doubled. </cd:constant>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="width">
<cd:paramdoc>Specifies the width of the frame. </cd:paramdoc>
<cd:constant type="local">inherit the width from parent box</cd:constant>
<cd:constant default="yes" type="fit">according to content</cd:constant>
<cd:constant type="max"></cd:constant>
<cd:constant type="broad">sets width to approximately <code>\textwidth</code></cd:constant>
<cd:constant type="fixed">like <cd:iref name="fit"/>, but with an implied <cd:iref name="autowidth" type="no"/></cd:constant>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="height">
<cd:paramdoc>Specifies the height of the frame. </cd:paramdoc>
<cd:constant type="fit"></cd:constant>
<cd:constant type="max"></cd:constant>
<cd:constant default="yes" type="broad"></cd:constant>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="minheight">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="align">
<cd:paramdoc>If the <cd:iref name="align"/> parameter is unspecified, {{cmd|framed}} produces a {{cmd|hbox}}, inside which linebreaks (if any) will appear as spaces; when <cd:iref name="align"/> is specified, {{cmd|framed}} will produce a {{cmd|vbox}}.</cd:paramdoc>
<cd:inherit name="setupalign"></cd:inherit>
</cd:parameter>
<cd:parameter name="strut">
<cd:paramdoc></cd:paramdoc>
<cd:constant default="yes" type="yes"></cd:constant>
<cd:constant type="no"></cd:constant>
<cd:constant type="none"></cd:constant>
<cd:constant type="local"></cd:constant>
<cd:constant type="global"></cd:constant>
</cd:parameter>
<cd:parameter name="autostrut">
<cd:paramdoc></cd:paramdoc>
<cd:constant default="yes" type="yes"></cd:constant>
<cd:constant type="no"></cd:constant>
</cd:parameter>
<cd:parameter name="location">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="height"></cd:constant>
<cd:constant type="depth">lower framed box about <tt>\strutdp</tt>.</cd:constant>
<cd:constant type="high"></cd:constant>
<cd:constant type="low">(resembles {{cmd|inframed}}): lowers the framed box by about <tt>\strutdp+offset+framelinewidth</tt>.</cd:constant>
<cd:constant type="top"></cd:constant>
<cd:constant type="middle"></cd:constant>
<cd:constant type="bottom"></cd:constant>
<cd:constant type="line"></cd:constant>
<cd:constant type="lohi"></cd:constant>
<cd:constant type="hanging">lower framed box by approx. its own height (baseline is on the top).</cd:constant>
<cd:constant type="keep"></cd:constant>
<cd:constant type="formula"></cd:constant>
<cd:constant type="mathematics"></cd:constant>
<cd:constant default="yes" type="normal"></cd:constant>
</cd:parameter>
<cd:parameter name="autowidth">
<cd:paramdoc></cd:paramdoc>
<cd:constant default="yes" type="yes"></cd:constant>
<cd:constant type="no"></cd:constant>
<cd:constant type="force"></cd:constant>
</cd:parameter>
<cd:parameter name="lines">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:number"></cd:constant>
</cd:parameter>
<cd:parameter name="top">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:command"></cd:constant>
</cd:parameter>
<cd:parameter name="bottom">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:command"></cd:constant>
</cd:parameter>
<cd:parameter name="blank">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="yes"></cd:constant>
<cd:constant default="yes" type="no"></cd:constant>
</cd:parameter>
<cd:parameter name="profile">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="empty">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="yes">do not display contents of the box.</cd:constant>
<cd:constant default="yes" type="no"></cd:constant>
</cd:parameter>
<cd:parameter name="loffset">
<cd:paramdoc>override the left value of <cd:iref name="offset"/>
</cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="roffset">
<cd:paramdoc>override the right value of <cd:iref name="offset"/>
</cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="toffset">
<cd:paramdoc>override the top value of <cd:iref name="offset"/>
</cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="boffset">
<cd:paramdoc>override the bottom value of <cd:iref name="offset"/>
</cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="orientation">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:number"></cd:constant>
</cd:parameter>
<cd:parameter name="anchoring">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="normal"></cd:constant>
<cd:constant type="up"></cd:constant>
<cd:constant type="down"></cd:constant>
<cd:constant type="left"></cd:constant>
<cd:constant type="right"></cd:constant>
<cd:constant type="top"></cd:constant>
<cd:constant type="bottom"></cd:constant>
<cd:constant type="cd:name"></cd:constant>
</cd:parameter>
<cd:parameter name="xanchor">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
<cd:parameter name="yanchor">
<cd:paramdoc></cd:paramdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description>Set the default parameters for {{cmd|framed}}. The {{cmd|framed}} command produces a box with (optionally) a frame, certain dimensions, a background, etc.

</cd:description>
<cd:examples><cd:example title="corner option values">This option determines whether or not the corners are round. It also allows drawing only selected corners.
{| cellpadding="10"
| Default value: '''rectangular'''
| <context>\setuppapersize[A5]\framed[corner=rectangular]{corner=rectangular}</context>
|-
| Most common alternative: '''round'''
| <context>\setuppapersize[A5]\framed[corner=round]{corner=round}</context>
|- valign="top"
| Other values: any number between '''0''' and '''28'''
| <context>
\setuppapersize[A5]
\dontleavehmode\framed
[corner=0,frame=on,
]{\tttf corner=\twodigits\recurselevel}%
\vskip1em
\dontleavehmode\dostepwiserecurse {1} {4}{1}{\framed
[corner=\recurselevel,frame=on]
{\tttf corner=\twodigits\recurselevel}%
\quad}
\vskip1em
\dontleavehmode\dostepwiserecurse {5} {8}{1}{\framed
[corner=\recurselevel,frame=on]
{\tttf corner=\twodigits\recurselevel}%
\quad}
\vskip1em
\dontleavehmode\dostepwiserecurse {9}{12}{1}{\framed
[corner=\recurselevel,frame=on]
{\tttf corner=\twodigits\recurselevel}%
\quad}
\vskip1em
\dontleavehmode\dostepwiserecurse{13}{16}{1}{\framed
[corner=\recurselevel,frame=on]
{\tttf corner=\twodigits\recurselevel}%
\quad}
\vskip1em
\dontleavehmode\dostepwiserecurse{17}{20}{1}{\framed
[corner=\recurselevel,frame=on]
{\tttf corner=\twodigits\recurselevel}%
\quad}
\vskip1em
\dontleavehmode\dostepwiserecurse{21}{24}{1}{\framed
[corner=\recurselevel,frame=on]
{\tttf corner=\twodigits\recurselevel}%
\quad}
\vskip1em
\dontleavehmode\dostepwiserecurse{25}{28}{1}{\framed
[corner=\recurselevel,frame=on]
{\tttf corner=\twodigits\recurselevel}%
\quad}

</context>
|}</cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:commandref name="defineframed" originator="system"></cd:commandref>
<cd:commandref name="setupalign" 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="setupframedtext"></cd:commandref></cd:seealso>
</cd:commandgroup>

Navigation menu