Difference between revisions of "Command/setupframed"

From ConTeXt wiki
(Syntax)
m (fix typo)
(21 intermediate revisions by 7 users not shown)
Line 3: Line 3:
 
|attributes=
 
|attributes=
 
}}
 
}}
 +
 +
== [[Help:Reference|Syntax]] (autogenerated)] ==
 +
<syntax>setupframed</syntax>
  
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
Line 10: Line 13:
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:height|height]]</td>
+
     <td class="cmd">{{key|height}}</td>
     <td>[[Reference/en/value:fit|fit]] [[Reference/en/value:broad|broad]] [[Reference/en/value:dimension|dimension]] </td>
+
     <td>'''fit''' broad dimension</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:width|width]]</td>
+
     <td class="cmd">{{key|width}}</td>
     <td>[[Reference/en/value:fit|fit]] [[Reference/en/value:broad|broad]] [[Reference/en/value:fixed|fixed]] [[Reference/en/value:local|local]] [[Reference/en/value:dimension|dimension]] </td>
+
     <td>'''fit''' broad fixed local dimension</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:autowidth|autowidth]]</td>
+
     <td class="cmd">{{key|autowidth}}</td>
     <td>[[Reference/en/value:yes|yes]] [[Reference/en/value:no|no]] [[Reference/en/value:force|force]] </td>
+
     <td>'''yes''' no force</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:offset|offset]]</td>
+
     <td class="cmd">{{key|offset}}</td>
     <td>[[Reference/en/value:none|none]] [[Reference/en/value:overlay|overlay]] [[Reference/en/value:default|default]] [[Reference/en/value:dimension|dimension]] </td>
+
     <td>none overlay '''default''' dimension</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:location|location]]</td>
+
     <td class="cmd">{{key|location}}</td>
     <td>[[Reference/en/value:depth|depth]] [[Reference/en/value:hanging|hanging]] [[Reference/en/value:high|high]] [[Reference/en/value:lohi|lohi]] [[Reference/en/value:low|low]] [[Reference/en/value:top|top]] [[Reference/en/value:middle|middle]] [[Reference/en/value:bottom|bottom]] </td>
+
     <td>depth hanging high lohi low top middle bottom</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:option|option]]</td>
+
     <td class="cmd">{{key|option}}</td>
     <td>[[Reference/en/value:none|none]] [[Reference/en/value:empty|empty]] </td>
+
     <td>'''(unset)''' none empty</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:strut|strut]]</td>
+
     <td class="cmd">{{key|strut}}</td>
     <td>[[Reference/en/value:yes|yes]] [[Reference/en/value:no|no]] [[Reference/en/value:global|global]] [[Reference/en/value:local|local]] </td>
+
     <td>'''yes''' no global local</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:align|align]]</td>
+
     <td class="cmd">{{key|align}}</td>
     <td>[[Reference/en/value:no|no]] [[Reference/en/value:left|left]] [[Reference/en/value:right|right]] [[Reference/en/value:middle|middle]] [[Reference/en/value:normal|normal]] [[Reference/en/value:high|high]] [[Reference/en/value:low|low]] [[Reference/en/value:lohi|lohi]] </td>
+
     <td>'''no''' flushleft flushright middle normal high low lohi</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:bottom|bottom]]</td>
+
     <td class="cmd">{{key|bottom}}</td>
     <td>[[Reference/en/value:command|command]] </td>
+
     <td>''command''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:top|top]]</td>
+
     <td class="cmd">{{key|top}}</td>
     <td>[[Reference/en/value:command|command]] </td>
+
     <td>''command''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:frame|frame]]</td>
+
     <td class="cmd">{{key|frame}}</td>
     <td>[[Reference/en/value:on|on]] [[Reference/en/value:off|off]] [[Reference/en/value:none|none]] [[Reference/en/value:overlay|overlay]] </td>
+
     <td>'''on''' off none overlay</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:topframe|topframe]]</td>
+
     <td class="cmd">{{key|topframe}}</td>
     <td>[[Reference/en/value:on|on]] [[Reference/en/value:off|off]] </td>
+
     <td>'''(unset)''' on off</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:bottomframe|bottomframe]]</td>
+
     <td class="cmd">{{key|bottomframe}}</td>
     <td>[[Reference/en/value:on|on]] [[Reference/en/value:off|off]] </td>
+
     <td>'''(unset)''' on off</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:leftframe|leftframe]]</td>
+
     <td class="cmd">{{key|leftframe}}</td>
     <td>[[Reference/en/value:on|on]] [[Reference/en/value:off|off]] </td>
+
     <td>'''(unset)''' on off</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:rightframe|rightframe]]</td>
+
     <td class="cmd">{{key|rightframe}}</td>
     <td>[[Reference/en/value:on|on]] [[Reference/en/value:off|off]] </td>
+
     <td>'''(unset)''' on off</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:frameoffset|frameoffset]]</td>
+
     <td class="cmd">{{key|frameoffset}}</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:framedepth|framedepth]]</td>
+
     <td class="cmd">{{key|framedepth}}</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:framecorner|framecorner]]</td>
+
     <td class="cmd">{{key|framecorner}}</td>
     <td>[[Reference/en/value:round|round]] [[Reference/en/value:rectangular|rectangular]] </td>
+
     <td>round '''rectangular'''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:frameradius|frameradius]]</td>
+
     <td class="cmd">{{key|frameradius}}</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:framecolor|framecolor]]</td>
+
     <td class="cmd">{{key|framecolor}}</td>
     <td>[[Reference/en/value:name|name]] </td>
+
     <td>''name''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:background|background]]</td>
+
     <td class="cmd">{{key|background}}</td>
     <td>[[Reference/en/value:screen|screen]] [[Reference/en/value:color|color]] [[Reference/en/value:none|none]] [[Reference/en/value:foreground|foreground]] [[Reference/en/value:name|name]] </td>
+
     <td>color '''none''' foreground name</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:backgroundscreen|backgroundscreen]]</td>
+
     <td class="cmd">{{key|backgroundcolor}}</td>
     <td>[[Reference/en/value:number|number]] </td>
+
     <td>''name''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:backgroundcolor|backgroundcolor]]</td>
+
     <td class="cmd">{{key|backgroundoffset}}</td>
     <td>[[Reference/en/value:name|name]] </td>
+
     <td>'''frame''' ''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:backgroundoffset|backgroundoffset]]</td>
+
     <td class="cmd">{{key|backgrounddepth}}</td>
     <td>[[Reference/en/value:frame|frame]] [[Reference/en/value:dimension|dimension]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:backgrounddepth|backgrounddepth]]</td>
+
     <td class="cmd">{{key|backgroundcorner}}</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>round '''rectangular'''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:backgroundcorner|backgroundcorner]]</td>
+
     <td class="cmd">{{key|backgroundradius}}</td>
     <td>[[Reference/en/value:round|round]] [[Reference/en/value:rectangular|rectangular]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:backgroundradius|backgroundradius]]</td>
+
     <td class="cmd">{{key|depth}}</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:depth|depth]]</td>
+
     <td class="cmd">{{key|corner}}</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>round '''rectangular'''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:corner|corner]]</td>
+
     <td class="cmd">{{key|radius}}</td>
     <td>[[Reference/en/value:round|round]] [[Reference/en/value:rectangular|rectangular]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:radius|radius]]</td>
+
     <td class="cmd">{{key|empty}}</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>yes '''no'''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:empty|empty]]</td>
+
     <td class="cmd">{{key|foregroundcolor}}</td>
     <td>[[Reference/en/value:yes|yes]] [[Reference/en/value:no|no]] </td>
+
     <td>''name''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:foregroundcolor|foregroundcolor]]</td>
+
     <td class="cmd">{{key|foregroundstyle}}</td>
     <td>[[Reference/en/value:name|name]] </td>
+
     <td>''name''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:rulethickness|rulethickness]]</td>
+
     <td class="cmd">{{key|rulethickness}}</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
  
 
== Description ==  
 
== Description ==  
<pre>
 
width
 
  broad: ~ \textwidth
 
  local: inherit the width from parent box
 
  fixed:
 
  fit: according to content
 
offset
 
  none=0pt: if the frame is inside another frame then
 
            frame line is doubled
 
  overlay: if the frame is inside another one then frame lines overlaped
 
  default=.25ex
 
location
 
  low=\inframed: lower framed box about: \strutdp+offset+framelinewidth
 
  depth: lower framed box about: \strutdp
 
  hanging: lower framed box about: box height (baseline is on the top)
 
empty
 
  yes: do not type contents of the box
 
rulethickness: sets the thickness of the frame border
 
</pre>
 
  
 +
Set the default parameters for {{cmd|framed}}. The {{cmd|framed}} command produces a box with (optionally) a frame, certain dimensions, a background, etc. If the {{code|align}} parameter is unspecified, {{cmd|framed}} produces an {{cmd|hbox}}, inside which linebreaks (if any) will appear as spaces; when {{code|align}} is specified, {{cmd|framed}} will produce a {{cmd|vbox}}.
 +
 +
{| class="wikitable"
 +
|-
 +
!style="text-align: left"| Key
 +
!style="text-align: left"| Possible values
 +
|- style="vertical-align: top"
 +
| {{key|width}}
 +
|
 +
* <tt>broad</tt>: sets width to approximately \textwidth.
 +
* <tt>local</tt>: inherit the width from parent box.
 +
* <tt>fixed</tt>: ??;
 +
* <tt>fit</tt>: according to content.
 +
|- style="vertical-align: top"
 +
| {{key|offset}}
 +
|
 +
* <tt>none</tt>: set to 0pt. If the frame is inside another frame then the frame lines are doubled.
 +
* <tt>overlay</tt>: set to 0pt. If the frame is inside another one then the frame lines will overlap.
 +
* <tt>default</tt>: set to .25ex.
 +
* ''dimension''
 +
|- style="vertical-align: top"
 +
| {{key|location}}
 +
|
 +
* <tt>low</tt> (resembles {{cmd|inframed}}): lowers the framed box by about <br /><tt>\strutdp+offset+framelinewidth</tt>;
 +
* <tt>depth</tt>: lower framed box about <tt>\strutdp</tt>.
 +
* <tt>hanging</tt>: lower framed box by approx. its own height (baseline is on the top).
 +
|- style="vertical-align: top"
 +
| {{key|empty}}
 +
|
 +
* <tt>yes</tt>: do not display contents of the box.
 +
* <tt>no</tt>: display the contents
 +
|- style="vertical-align: top"
 +
| {{key|rulethickness}}
 +
| sets the thickness of the frame border.
 +
|}
  
 
== Example ==
 
== Example ==
Line 169: Line 188:
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
+
<!-- something like {{cmd|goto}} -->
 +
 
 +
* {{cmd|framed}}
 +
* {{cmd|inframed}} (inline)
 +
* {{cmd|mframed}} (math)
 +
* [[Framed]]
 +
 
 +
== Help from ConTeXt-Mailinglist/Forum ==
 +
All issues with:
 +
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Reference/en|setupframed]]
+
[[Category:Command/Frames|setupframed]]

Revision as of 15:29, 7 September 2019

\setupframed

Syntax (autogenerated)]

\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
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


Syntax

\setupframed[...,...=...,...]
height fit broad dimension
width fit broad fixed local dimension
autowidth yes no force
offset none overlay default dimension
location depth hanging high lohi low top middle bottom
option (unset) none empty
strut yes no global local
align no flushleft flushright middle normal high low lohi
bottom command
top command
frame on off none overlay
topframe (unset) on off
bottomframe (unset) on off
leftframe (unset) on off
rightframe (unset) on off
frameoffset dimension
framedepth dimension
framecorner round rectangular
frameradius dimension
framecolor name
background color none foreground name
backgroundcolor name
backgroundoffset frame dimension
backgrounddepth dimension
backgroundcorner round rectangular
backgroundradius dimension
depth dimension
corner round rectangular
radius dimension
empty yes no
foregroundcolor name
foregroundstyle name
rulethickness dimension

Description

Set the default parameters for \framed. The \framed command produces a box with (optionally) a frame, certain dimensions, a background, etc. If the align parameter is unspecified, \framed produces an \hbox, inside which linebreaks (if any) will appear as spaces; when align is specified, \framed will produce a \vbox.

Key Possible values
width
  • broad: sets width to approximately \textwidth.
  • local: inherit the width from parent box.
  • fixed: ??;
  • fit: according to content.
offset
  • none: set to 0pt. If the frame is inside another frame then the frame lines are doubled.
  • overlay: set to 0pt. If the frame is inside another one then the frame lines will overlap.
  • default: set to .25ex.
  • dimension
location
  • low (resembles \inframed): lowers the framed box by about
    \strutdp+offset+framelinewidth;
  • depth: lower framed box about \strutdp.
  • hanging: lower framed box by approx. its own height (baseline is on the top).
empty
  • yes: do not display contents of the box.
  • no: display the contents
rulethickness sets the thickness of the frame border.

Example

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: