Difference between revisions of "Command/setupframed"

From ConTeXt wiki
m (fix typo)
(11 intermediate revisions by 5 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">[[Command/keyword:height|height]]</td>
+
     <td class="cmd">{{key|height}}</td>
     <td>[[Command/value:fit|fit]] [[Command/value:broad|broad]] [[Command/value:dimension|dimension]] </td>
+
     <td>'''fit''' broad dimension</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:width|width]]</td>
+
     <td class="cmd">{{key|width}}</td>
     <td>[[Command/value:fit|fit]] [[Command/value:broad|broad]] [[Command/value:fixed|fixed]] [[Command/value:local|local]] [[Command/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">[[Command/keyword:autowidth|autowidth]]</td>
+
     <td class="cmd">{{key|autowidth}}</td>
     <td>[[Command/value:yes|yes]] [[Command/value:no|no]] [[Command/value:force|force]] </td>
+
     <td>'''yes''' no force</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:offset|offset]]</td>
+
     <td class="cmd">{{key|offset}}</td>
     <td>[[Command/value:none|none]] [[Command/value:overlay|overlay]] [[Command/value:default|default]] [[Command/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">[[Command/keyword:location|location]]</td>
+
     <td class="cmd">{{key|location}}</td>
     <td>[[Command/value:depth|depth]] [[Command/value:hanging|hanging]] [[Command/value:high|high]] [[Command/value:lohi|lohi]] [[Command/value:low|low]] [[Command/value:top|top]] [[Command/value:middle|middle]] [[Command/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">[[Command/keyword:option|option]]</td>
+
     <td class="cmd">{{key|option}}</td>
     <td>[[Command/value:none|none]] [[Command/value:empty|empty]] </td>
+
     <td>'''(unset)''' none empty</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:strut|strut]]</td>
+
     <td class="cmd">{{key|strut}}</td>
     <td>[[Command/value:yes|yes]] [[Command/value:no|no]] [[Command/value:global|global]] [[Command/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">[[Command/keyword:align|align]]</td>
+
     <td class="cmd">{{key|align}}</td>
     <td>[[Command/value:no|no]] [[Command/value:flushleft|flushleft]] [[Command/value:flushright|flushright]] [[Command/value:middle|middle]] [[Command/value:normal|normal]] [[Command/value:high|high]] [[Command/value:low|low]] [[Command/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">[[Command/keyword:bottom|bottom]]</td>
+
     <td class="cmd">{{key|bottom}}</td>
     <td>[[Command/value:command|command]] </td>
+
     <td>''command''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:top|top]]</td>
+
     <td class="cmd">{{key|top}}</td>
     <td>[[Command/value:command|command]] </td>
+
     <td>''command''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:frame|frame]]</td>
+
     <td class="cmd">{{key|frame}}</td>
     <td>[[Command/value:on|on]] [[Command/value:off|off]] [[Command/value:none|none]] [[Command/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">[[Command/keyword:topframe|topframe]]</td>
+
     <td class="cmd">{{key|topframe}}</td>
     <td>[[Command/value:on|on]] [[Command/value:off|off]] </td>
+
     <td>'''(unset)''' on off</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:bottomframe|bottomframe]]</td>
+
     <td class="cmd">{{key|bottomframe}}</td>
     <td>[[Command/value:on|on]] [[Command/value:off|off]] </td>
+
     <td>'''(unset)''' on off</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:leftframe|leftframe]]</td>
+
     <td class="cmd">{{key|leftframe}}</td>
     <td>[[Command/value:on|on]] [[Command/value:off|off]] </td>
+
     <td>'''(unset)''' on off</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:rightframe|rightframe]]</td>
+
     <td class="cmd">{{key|rightframe}}</td>
     <td>[[Command/value:on|on]] [[Command/value:off|off]] </td>
+
     <td>'''(unset)''' on off</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:frameoffset|frameoffset]]</td>
+
     <td class="cmd">{{key|frameoffset}}</td>
     <td>[[Command/value:dimension|dimension]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:framedepth|framedepth]]</td>
+
     <td class="cmd">{{key|framedepth}}</td>
     <td>[[Command/value:dimension|dimension]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:framecorner|framecorner]]</td>
+
     <td class="cmd">{{key|framecorner}}</td>
     <td>[[Command/value:round|round]] [[Command/value:rectangular|rectangular]] </td>
+
     <td>round '''rectangular'''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:frameradius|frameradius]]</td>
+
     <td class="cmd">{{key|frameradius}}</td>
     <td>[[Command/value:dimension|dimension]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:framecolor|framecolor]]</td>
+
     <td class="cmd">{{key|framecolor}}</td>
     <td>[[Command/value:name|name]] </td>
+
     <td>''name''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:background|background]]</td>
+
     <td class="cmd">{{key|background}}</td>
     <td>[[Command/value:screen|screen]] [[Command/value:color|color]] [[Command/value:none|none]] [[Command/value:foreground|foreground]] [[Command/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">[[Command/keyword:backgroundscreen|backgroundscreen]]</td>
+
     <td class="cmd">{{key|backgroundcolor}}</td>
     <td>[[Command/value:number|number]] </td>
+
     <td>''name''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:backgroundcolor|backgroundcolor]]</td>
+
     <td class="cmd">{{key|backgroundoffset}}</td>
     <td>[[Command/value:name|name]] </td>
+
     <td>'''frame''' ''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:backgroundoffset|backgroundoffset]]</td>
+
     <td class="cmd">{{key|backgrounddepth}}</td>
     <td>[[Command/value:frame|frame]] [[Command/value:dimension|dimension]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:backgrounddepth|backgrounddepth]]</td>
+
     <td class="cmd">{{key|backgroundcorner}}</td>
     <td>[[Command/value:dimension|dimension]] </td>
+
     <td>round '''rectangular'''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:backgroundcorner|backgroundcorner]]</td>
+
     <td class="cmd">{{key|backgroundradius}}</td>
     <td>[[Command/value:round|round]] [[Command/value:rectangular|rectangular]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:backgroundradius|backgroundradius]]</td>
+
     <td class="cmd">{{key|depth}}</td>
     <td>[[Command/value:dimension|dimension]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:depth|depth]]</td>
+
     <td class="cmd">{{key|corner}}</td>
     <td>[[Command/value:dimension|dimension]] </td>
+
     <td>round '''rectangular'''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:corner|corner]]</td>
+
     <td class="cmd">{{key|radius}}</td>
     <td>[[Command/value:round|round]] [[Command/value:rectangular|rectangular]] </td>
+
     <td>''dimension''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:radius|radius]]</td>
+
     <td class="cmd">{{key|empty}}</td>
     <td>[[Command/value:dimension|dimension]] </td>
+
     <td>yes '''no'''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:empty|empty]]</td>
+
     <td class="cmd">{{key|foregroundcolor}}</td>
     <td>[[Command/value:yes|yes]] [[Command/value:no|no]] </td>
+
     <td>''name''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:foregroundcolor|foregroundcolor]]</td>
+
     <td class="cmd">{{key|foregroundstyle}}</td>
     <td>[[Command/value:name|name]] </td>
+
     <td>''name''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:foregroundstyle|foregroundstyle]]</td>
+
     <td class="cmd">{{key|rulethickness}}</td>
    <td>[[Command/value:name|name]] </td>
+
     <td>''dimension''</td>
  </tr>
 
  <tr valign="top" class="first">
 
    <td class="cmd">[[Command/keyword:rulethickness|rulethickness]]</td>
 
     <td>[[Command/value:dimension|dimension]] </td>
 
 
   </tr>
 
   </tr>
 
</table>
 
</table>
Line 149: Line 148:
 
== Description ==  
 
== Description ==  
  
{|cellpadding="10" style="border:2px solid #eeeeee"
+
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}}.
! key
+
 
! possible values
+
{| class="wikitable"
|-
+
|-
|<tt>width</tt>
+
!style="text-align: left"| Key
|<tt>broad</tt>: sets width to ~ \textwidth; <tt>local</tt>: inherit the width from parent box; <tt>fixed</tt>: ??; <tt>fit</tt>: according to content.
+
!style="text-align: left"| Possible values
|-
+
|- style="vertical-align: top"
|<tt>offset</tt>
+
| {{key|width}}
|<tt>none</tt> set to <em>0pt</em>, if the frame is inside another frame then frame line is <em>doubled</em>; <tt>overlay</tt> set to <em>0pt</em>, if the frame is inside another one then frame lines <em>overlaped</em>; <tt>default</tt> set to <em>.25ex</em>.
+
|  
|-
+
* <tt>broad</tt>: sets width to approximately \textwidth.
|<tt>location</tt>
+
* <tt>local</tt>: inherit the width from parent box.
|<tt>low</tt> (resembles [[cmd:inframed|\inframed]]): lower framed box about: <tt>\strutdp+offset+framelinewidth</tt>; <tt>depth</tt>: lower framed box about: <tt>\strutdp</tt>; <tt>hanging</tt>: lower framed box about: box height (baseline is on the top).
+
* <tt>fixed</tt>: ??;
|-
+
* <tt>fit</tt>: according to content.
|<tt>empty</tt>
+
|- style="vertical-align: top"
|<tt>yes</tt>: do not type contents of the box.
+
| {{key|offset}}
|-
+
|  
|<tt>rulethickness</tt>
+
* <tt>none</tt>: set to 0pt. If the frame is inside another frame then the frame lines are doubled.
|sets the thickness of the frame border.
+
* <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.
 
|}
 
|}
  
Line 173: 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-Forum ==
+
== Help from ConTeXt-Mailinglist/Forum ==
 
All issues with:
 
All issues with:
 
{{Forum|{{SUBPAGENAME}}}}
 
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Frames|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: