Difference between revisions of "Command/setupframed"

From Wiki
Jump to navigation Jump to search
m (add more corner options)
 
(2 intermediate revisions by 2 users not shown)
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 112: Line 114:
 
       <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>
 
       <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>
+
       <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 121: Line 123:
 
     <cd:parameter name="backgroundcolor">
 
     <cd:parameter name="backgroundcolor">
 
       <cd:paramdoc>A color, only used if <cd:iref name="background" type="color"/></cd:paramdoc>
 
       <cd:paramdoc>A color, only used if <cd:iref name="background" type="color"/></cd:paramdoc>
       <cd:constant name="cd:color"></cd:constant>
+
       <cd:constant type="cd:color"></cd:constant>
 
     </cd:parameter>
 
     </cd:parameter>
 
     <cd:parameter name="component">
 
     <cd:parameter name="component">
Line 152: Line 154:
 
     </cd:parameter>
 
     </cd:parameter>
 
     <cd:parameter name="width">
 
     <cd:parameter name="width">
       <cd:paramdoc>Specifies the width of the frame. </cd:paramdoc>
+
       <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 172: 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:iref name="align"/> is specified, {{cmd|framed}} will produce a {{cmd|vbox}}.</cd:paramdoc>
+
       <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 258: 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 300: 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 '''28'''
+
| Other values: any number between '''0''' and '''33'''
 
| <context>
 
| <context>
 
     \setuppapersize[A5]
 
     \setuppapersize[A5]
Line 338: 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 351: 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:seealso>
 
</cd:commandgroup>
 
</cd:commandgroup>

Latest revision as of 21:17, 22 February 2024


\setupframed

Summary

The command \setupframed is used for configuring \framed and instances of framed

Settings

\setupframed[...,...][...=...,...]
[...,...]name
cornerrectangular round number
framecornerrectangular round number
backgroundcornerrectangular round number
radiusdimension
frameradiusdimension
backgroundradiusdimension
depthdimension
framedepthdimension
backgrounddepthdimension
framecolorcolor
topframeon off small name
bottomframeon off small name
leftframeon off small name
rightframeon off small name
regionyes no
rulethicknessdimension
frameoffsetdimension
frameon off overlay small closed none
backgroundforeground color name
backgroundoffsetframe dimension
backgroundcolor
componentname
extrascommand
foregroundstylestyle command
foregroundcolorcolor
setupsname
offsetdefault overlay none dimension
widthlocal fit max broad fixed dimension
heightfit max broad dimension
minheightdimension
alignsee \setupalign
strutyes no none local global
autostrutyes no
locationheight depth high low top middle bottom line lohi hanging keep formula mathematics normal
autowidthyes no force
linesnumber
topcommand
bottomcommand
blankyes no
profilename
emptyyes no
loffsetdimension
roffsetdimension
toffsetdimension
boffsetdimension
orientationnumber
anchoringnormal up down left right top bottom name
xanchordimension
yanchordimension
linedirectionnormal reverse

OptionExplanation
corner
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.
rectangular square corners
round rounded corners
framecorner
This option applies only to the frame corners.
backgroundcorner
This option applies only to the background corners.
radius
background and frame corner radius, if corner=round
frameradius
frame radius, if framecorner=round
backgroundradius
background radius, if backgroundcorner=round
framecolor
line color
topframe
on show upper border
off don’t show
bottomframe
on show lower border
off don’t show
leftframe
on show left border
off don’t show
rightframe
on show right border
off don’t show
rulethickness
sets the thickness of the frame border (line width).
frameoffset
Gives frame an extra offset without affecting surrounding text.
frame
This option determines whether a frame is drawn or not. Option "dash" for dashed lines is new since LMTX 2024-02-22, set dashstep to a dimension to change the pattern.
on show border
off don’t show
background
color a color, to be set with backgroundcolor
name a named background, use \defineoverlay
backgroundoffset
Gives background an extra offset without affecting surrounding text.
backgroundcolor
A color, only used if background=color
offset
This is the offset around the framed content. The frame itself is controlled by frameoffset
default set to 0.25ex.
overlay set to 0pt. If the frame is inside another one then the frame lines will overlap.
none set to 0pt. If the frame is inside another frame then the frame lines are doubled.
width
Specifies the width of the element.
local inherit the width from parent box
fit according to content
broad sets width to approximately \textwidth
fixed like fit, but with an implied autowidth=no
height
Specifies the height of the frame.
align
If the align parameter is unspecified, \framed produces a \hbox, inside which linebreaks (if any) will appear as spaces; when align is specified, \framed will produce a \vbox that allows for multi line text.
strut
ensure that the height is at least a full line height including height and depth
location
depth lower framed box about \strutdp.
low (resembles \inframed): lowers the framed box by about \strutdp+offset+framelinewidth.
hanging lower framed box by approx. its own height (baseline is on the top).
empty
yes do not display contents of the box.
loffset
override the left value of offset
roffset
override the right value of offset
toffset
override the top value of offset
boffset
override the bottom value of offset
orientation
rotation in degrees

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

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: