Difference between revisions of "Command/setupframed"
< Command
Jump to navigation
Jump to search
(Created page with "Documentation for \setupframed") |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
</cd:shortdesc> | </cd:shortdesc> | ||
<cd:variants> | <cd:variants> | ||
− | <cd:command category="rules" file="pack-rul.mkiv" interfacedate=" | + | <cd:command category="rules" file="pack-rul.mkiv" interfacedate="2021-03-02T11:08" interfacefile="i-framed.xml" keywords="background" level="style" name="setupframed" variantnumber="1"> |
<cd:arguments> | <cd:arguments> | ||
<cd:keywords list="yes" optional="yes" ordinal="1"> | <cd:keywords list="yes" optional="yes" ordinal="1"> | ||
− | <cd:keywordsdoc> | + | <cd:keywordsdoc></cd:keywordsdoc> |
<cd:constant type="cd:name"></cd:constant> | <cd:constant type="cd:name"></cd:constant> | ||
</cd:keywords> | </cd:keywords> | ||
Line 55: | Line 55: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="framecolor"> | <cd:parameter name="framecolor"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>line color</cd:paramdoc> |
<cd:constant type="cd:color"></cd:constant> | <cd:constant type="cd:color"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="topframe"> | <cd:parameter name="topframe"> | ||
<cd:paramdoc></cd:paramdoc> | <cd:paramdoc></cd:paramdoc> | ||
− | <cd:constant default="yes" type="on"></cd:constant> | + | <cd:constant default="yes" type="on">show upper border</cd:constant> |
− | <cd:constant type="off"></cd:constant> | + | <cd:constant type="off">don’t show</cd:constant> |
<cd:constant type="small"></cd:constant> | <cd:constant type="small"></cd:constant> | ||
<cd:constant type="cd:name"></cd:constant> | <cd:constant type="cd:name"></cd:constant> | ||
Line 67: | Line 67: | ||
<cd:parameter name="bottomframe"> | <cd:parameter name="bottomframe"> | ||
<cd:paramdoc></cd:paramdoc> | <cd:paramdoc></cd:paramdoc> | ||
− | <cd:constant default="yes" type="on"></cd:constant> | + | <cd:constant default="yes" type="on">show lower border</cd:constant> |
− | <cd:constant type="off"></cd:constant> | + | <cd:constant type="off">don’t show</cd:constant> |
<cd:constant type="small"></cd:constant> | <cd:constant type="small"></cd:constant> | ||
<cd:constant type="cd:name"></cd:constant> | <cd:constant type="cd:name"></cd:constant> | ||
Line 74: | Line 74: | ||
<cd:parameter name="leftframe"> | <cd:parameter name="leftframe"> | ||
<cd:paramdoc></cd:paramdoc> | <cd:paramdoc></cd:paramdoc> | ||
− | <cd:constant default="yes" type="on"></cd:constant> | + | <cd:constant default="yes" type="on">show left border</cd:constant> |
− | <cd:constant type="off"></cd:constant> | + | <cd:constant type="off">don’t show</cd:constant> |
<cd:constant type="small"></cd:constant> | <cd:constant type="small"></cd:constant> | ||
<cd:constant type="cd:name"></cd:constant> | <cd:constant type="cd:name"></cd:constant> | ||
Line 81: | Line 81: | ||
<cd:parameter name="rightframe"> | <cd:parameter name="rightframe"> | ||
<cd:paramdoc></cd:paramdoc> | <cd:paramdoc></cd:paramdoc> | ||
− | <cd:constant default="yes" type="on"></cd:constant> | + | <cd:constant default="yes" type="on">show right border</cd:constant> |
− | <cd:constant type="off"></cd:constant> | + | <cd:constant type="off">don’t show</cd:constant> |
<cd:constant type="small"></cd:constant> | <cd:constant type="small"></cd:constant> | ||
<cd:constant type="cd:name"></cd:constant> | <cd:constant type="cd:name"></cd:constant> | ||
Line 92: | Line 92: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="rulethickness"> | <cd:parameter name="rulethickness"> | ||
− | <cd:paramdoc>sets the thickness of the frame border.</cd:paramdoc> | + | <cd:paramdoc>sets the thickness of the frame border (line width).</cd:paramdoc> |
<cd:constant type="cd:dimension"></cd:constant> | <cd:constant type="cd:dimension"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
Line 100: | Line 100: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="frame"> | <cd:parameter name="frame"> | ||
− | <cd:paramdoc>This option determines whether a frame is drawn or not.</cd:paramdoc> | + | <cd:paramdoc>This option determines whether a frame is drawn or not. |
− | <cd:constant default="yes" type="on"></cd:constant> | + | |
− | <cd:constant type="off"></cd:constant> | + | Option "dash" for dashed lines is new since LMTX 2024-02-22, set `dashstep` to a dimension to change the pattern.</cd:paramdoc> |
+ | <cd:constant default="yes" type="on">show border</cd:constant> | ||
+ | <cd:constant type="off">don’t show</cd:constant> | ||
<cd:constant type="overlay"></cd:constant> | <cd:constant type="overlay"></cd:constant> | ||
<cd:constant type="small"></cd:constant> | <cd:constant type="small"></cd:constant> | ||
Line 111: | Line 113: | ||
<cd:paramdoc></cd:paramdoc> | <cd:paramdoc></cd:paramdoc> | ||
<cd:constant type="foreground"></cd:constant> | <cd:constant type="foreground"></cd:constant> | ||
− | <cd:constant type="color">a color, to be set with <cd:iref name="backgroundcolor"/> | + | <cd:constant type="color">a color, to be set with <cd:iref name="backgroundcolor"/></cd:constant> |
− | <cd:constant type="cd:name">a named background | + | <cd:constant type="cd:name">a named background, use {{cmd|defineoverlay}}</cd:constant> |
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="backgroundoffset"> | <cd:parameter name="backgroundoffset"> | ||
Line 118: | Line 120: | ||
<cd:constant type="frame"></cd:constant> | <cd:constant type="frame"></cd:constant> | ||
<cd:constant type="cd:dimension"></cd:constant> | <cd:constant type="cd:dimension"></cd:constant> | ||
+ | </cd:parameter> | ||
+ | <cd:parameter name="backgroundcolor"> | ||
+ | <cd:paramdoc>A color, only used if <cd:iref name="background" type="color"/></cd:paramdoc> | ||
+ | <cd:constant type="cd:color"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="component"> | <cd:parameter name="component"> | ||
Line 148: | Line 154: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="width"> | <cd:parameter name="width"> | ||
− | <cd:paramdoc>Specifies the width of the | + | <cd:paramdoc>Specifies the width of the element. </cd:paramdoc> |
<cd:constant type="local">inherit the width from parent box</cd:constant> | <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 default="yes" type="fit">according to content</cd:constant> | ||
Line 168: | Line 174: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="align"> | <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: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}} that allows for multi line text.</cd:paramdoc> |
<cd:inherit name="setupalign"></cd:inherit> | <cd:inherit name="setupalign"></cd:inherit> | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="strut"> | <cd:parameter name="strut"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>ensure that the height is at least a full line height including height and depth</cd:paramdoc> |
<cd:constant default="yes" type="yes"></cd:constant> | <cd:constant default="yes" type="yes"></cd:constant> | ||
<cd:constant type="no"></cd:constant> | <cd:constant type="no"></cd:constant> | ||
Line 254: | Line 260: | ||
</cd:parameter> | </cd:parameter> | ||
<cd:parameter name="orientation"> | <cd:parameter name="orientation"> | ||
− | <cd:paramdoc></cd:paramdoc> | + | <cd:paramdoc>rotation in degrees</cd:paramdoc> |
<cd:constant type="cd:number"></cd:constant> | <cd:constant type="cd:number"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
Line 275: | Line 281: | ||
<cd:paramdoc></cd:paramdoc> | <cd:paramdoc></cd:paramdoc> | ||
<cd:constant type="cd:dimension"></cd:constant> | <cd:constant type="cd:dimension"></cd:constant> | ||
+ | </cd:parameter> | ||
+ | <cd:parameter name="linedirection"> | ||
+ | <cd:paramdoc></cd:paramdoc> | ||
+ | <cd:constant default="yes" type="normal"></cd:constant> | ||
+ | <cd:constant type="reverse"></cd:constant> | ||
</cd:parameter> | </cd:parameter> | ||
</cd:assignments> | </cd:assignments> | ||
Line 280: | Line 291: | ||
</cd:command> | </cd:command> | ||
</cd:variants> | </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>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: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. | + | <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" | + | {| cellpadding="10" |
| Default value: '''rectangular''' | | Default value: '''rectangular''' | ||
| <context>\setuppapersize[A5]\framed[corner=rectangular]{corner=rectangular}</context> | | <context>\setuppapersize[A5]\framed[corner=rectangular]{corner=rectangular}</context> | ||
Line 291: | Line 302: | ||
| <context>\setuppapersize[A5]\framed[corner=round]{corner=round}</context> | | <context>\setuppapersize[A5]\framed[corner=round]{corner=round}</context> | ||
|- valign="top" | |- valign="top" | ||
− | | Other values: any number between '''0''' and ''' | + | | Other values: any number between '''0''' and '''33''' |
| <context> | | <context> | ||
\setuppapersize[A5] | \setuppapersize[A5] | ||
Line 329: | Line 340: | ||
\vskip1em | \vskip1em | ||
\dontleavehmode\dostepwiserecurse{25}{28}{1}{\framed | \dontleavehmode\dostepwiserecurse{25}{28}{1}{\framed | ||
+ | [corner=\recurselevel,frame=on] | ||
+ | {\tttf corner=\twodigits\recurselevel}% | ||
+ | \quad} | ||
+ | \vskip1em | ||
+ | \dontleavehmode\dostepwiserecurse{29}{32}{1}{\framed | ||
+ | [corner=\recurselevel,frame=on] | ||
+ | {\tttf corner=\twodigits\recurselevel}% | ||
+ | \quad} | ||
+ | \vskip1em | ||
+ | \dontleavehmode\dostepwiserecurse{33}{36}{1}{\framed | ||
[corner=\recurselevel,frame=on] | [corner=\recurselevel,frame=on] | ||
{\tttf corner=\twodigits\recurselevel}% | {\tttf corner=\twodigits\recurselevel}% | ||
Line 342: | Line 363: | ||
<cd:wikipage originator="system" page="Category:Rules"></cd:wikipage> | <cd:wikipage originator="system" page="Category:Rules"></cd:wikipage> | ||
<cd:wikipage originator="system" page="Keywords:Background"></cd:wikipage> | <cd:wikipage originator="system" page="Keywords:Background"></cd:wikipage> | ||
− | <cd:commandref name="setupframedtext"></cd:commandref></cd:seealso> | + | <cd:commandref name="setupframedtext"></cd:commandref> |
+ | <cd:commandref name="setlayerframed"></cd:commandref> | ||
+ | <cd:wikipage page="Framed"></cd:wikipage></cd:seealso> | ||
</cd:commandgroup> | </cd:commandgroup> |
Latest revision as of 16:04, 2 June 2024
Contents
\setupframed
Summary
Settings
\setupframed[...,...][...=...,...] | |
[...,...] | name |
corner | rectangular round number |
framecorner | rectangular round number |
backgroundcorner | rectangular round number |
radius | dimension |
frameradius | dimension |
backgroundradius | dimension |
depth | dimension |
framedepth | dimension |
backgrounddepth | dimension |
framecolor | color |
topframe | on off small name |
bottomframe | on off small name |
leftframe | on off small name |
rightframe | on off small name |
region | yes no |
rulethickness | dimension |
frameoffset | dimension |
frame | on off overlay small closed none |
background | foreground color name |
backgroundoffset | frame dimension |
backgroundcolor | |
component | name |
extras | command |
foregroundstyle | style command |
foregroundcolor | color |
setups | name |
offset | default overlay none dimension |
width | local fit max broad fixed dimension |
height | fit max broad dimension |
minheight | dimension |
align | see \setupalign |
strut | yes no none local global |
autostrut | yes no |
location | height depth high low top middle bottom line lohi hanging keep formula mathematics normal |
autowidth | yes no force |
lines | number |
top | command |
bottom | command |
blank | yes no |
profile | name |
empty | yes no |
loffset | dimension |
roffset | dimension |
toffset | dimension |
boffset | dimension |
orientation | number |
anchoring | normal up down left right top bottom name |
xanchor | dimension |
yanchor | dimension |
linedirection | normal reverse |
Option | Explanation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
corner |
| ||||||||||
framecorner |
| ||||||||||
backgroundcorner |
| ||||||||||
radius |
| ||||||||||
frameradius |
| ||||||||||
backgroundradius |
| ||||||||||
framecolor |
| ||||||||||
topframe |
| ||||||||||
bottomframe |
| ||||||||||
leftframe |
| ||||||||||
rightframe |
| ||||||||||
rulethickness |
| ||||||||||
frameoffset |
| ||||||||||
frame |
| ||||||||||
background |
| ||||||||||
backgroundoffset |
| ||||||||||
backgroundcolor |
| ||||||||||
offset |
| ||||||||||
width |
| ||||||||||
height |
| ||||||||||
align |
| ||||||||||
strut |
| ||||||||||
location |
| ||||||||||
empty |
| ||||||||||
loffset |
| ||||||||||
roffset |
| ||||||||||
toffset |
| ||||||||||
boffset |
| ||||||||||
orientation |
|
Description
Set the default parameters for \framed. The \framed command produces a box with (optionally) a frame, certain dimensions, a background, etc.
Examples
corner option values
This option determines whether or not the corners are round. It also allows drawing only selected corners.
Default value: rectangular | |
Most common alternative: round | |
Other values: any number between 0 and 33 |