Difference between revisions of "Command/setuptab"

From Wiki
Jump to navigation Jump to search
m (Various bits of toying around)
m
Line 12: Line 12:
 
     <td class="cmd">[[Command/keyword:headstyle|headstyle]]</td>
 
     <td class="cmd">[[Command/keyword:headstyle|headstyle]]</td>
 
     <td>'''[[Command/value:normal|normal]]''' [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small...|small...]] [[Command/value:command|command]] </td>
 
     <td>'''[[Command/value:normal|normal]]''' [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small...|small...]] [[Command/value:command|command]] </td>
  </tr>
 
  <tr valign="top" class="first">
 
    <td class="cmd">[[Command/keyword:headcolor|headcolor]]</td>
 
    <td>''color''</td>
 
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
 
     <td class="cmd">[[Command/keyword:style|style]]</td>
 
     <td class="cmd">[[Command/keyword:style|style]]</td>
     <td>'''[[Command/value:normal|normal]]''' [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small...|small...]] [[Command/value:command|command]] </td>
+
     <td>'''[[Command/value:normal|normal]]''' [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small|small]]... ''[[Command/value:command|command]]'' </td>
  </tr>
 
  <tr valign="top" class="first">
 
    <td class="cmd">[[Command/keyword:color|color]]</td>
 
    <td>''color''</td>
 
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
Line 31: Line 23:
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
 
     <td class="cmd">[[Command/keyword:width|width]]</td>
 
     <td class="cmd">[[Command/keyword:width|width]]</td>
     <td>[[Command/value:dimension|dimension]] default: broad</td>
+
     <td>[[Command/value:dimension|dimension]] default: '''broad'''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
 
     <td class="cmd">[[Command/keyword:sample|sample]]</td>
 
     <td class="cmd">[[Command/keyword:sample|sample]]</td>
     <td>[[Command/value:dimension|dimension]] default: \hskip4em</td>
+
     <td>[[Command/value:dimension|dimension]] default: '''\hskip4em'''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Command/keyword:location|location]]</td>
+
     <td class="cmd">MkII: [[Command/keyword:location|location]]<br />
 +
      MkIV: [[Command/keyword:alternative|alternative]]</td>
 
     <td>'''left'''</td>
 
     <td>'''left'''</td>
 +
  </tr>
 +
  <tr valign="top" class="first">
 +
    <td class="cmd">...=...</td>
 +
    <td>''see'' {{cmd|setupdescriptions}}</td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
  
 
== Description ==  
 
== Description ==  
 +
<code>\tab</code> is a description created with <code>{{cmd|definedescription}}[tab]</code>. By default, it leaves 4em for the key and 2em of space between the key area and the paragraph, the latter thanks to <code>width=broad</code>. <code>width=fit</code> leaves no space in between; in mkiv, <code>width=fit</code> leaves 1em of space between the key space and the paragraph. This is probably a bug.
  
 
== Example ==
 
== Example ==
 
<context source=yes>
 
<context source=yes>
\setupwhitespace[big]
+
\def\ruler{%
 +
    \dorecurse{8}{%
 +
        \dontleavehmode%
 +
        \blackrule[width={\dimexpr1em-0.5pt}, height=0.5pt]%
 +
        \dontleavehmode%
 +
        \blackrule[width=0.5pt, height=1ex]%
 +
    }
 +
}
  
asdfx asdfx asdfx asdfx adsfx
+
\def\testpara{%
 +
    They might have called Sunday the super-man. If any such creature
 +
    be conceivable, he looked, indeed, somewhat like it, with his
 +
    earth-shaking abstraction, as of a stone statue walking.
 +
}
  
\tab{11} asdfx asdfx
+
(The ruler is marked in ems.
 +
The quotation is from G.K. Chesterton's {\em The Man who was Thursday}.)
  
\setuptab[width=0cm, headstyle=slanted]
+
\ruler \par
\tab{11} asdfx asdfx
+
\setuptab[width=broad, sample={\blackrule[width=2em]}, headstyle=slanted]
 +
\tab{\blackrule[width=2em]} (Sample of 2em wide, broad width.) \testpara \par
  
\setuptab[sample={asdfx asdfx}]
+
\ruler \par
\tab{11} asdfx asdfx
+
\setuptab[width=broad, sample={\blackrule[width=4em]}, headstyle=slanted]
 +
\tab{\blackrule[width=4em]} (Sample of 4em wide, broad width.) \testpara \par
  
\setuptab[sample=asdfx]
+
\ruler \par
\tab{11} asdfx asdfx
+
\setuptab[width=fit, sample={\blackrule[width=2em]}, headstyle=slanted]
 +
\tab{\blackrule[width=2em]} (Sample of 2em wide, fit width.) \testpara \par
  
 +
\ruler \par
 +
\setuptab[width=3em, sample={thisisaverylongsample}, headstyle=slanted]
 +
\tab{\blackrule[width=3em]} (Exact width of 3em overrides long sample.) \testpara \par
  
 
</context>
 
</context>
  
 
== See also ==
 
== See also ==
<!-- something like {{cmd|goto}} -->
+
* {{cmd|tab}}
 +
* {{cmd|setupdescription}}
 +
* [[source:core-mis.mkii|core-mis.mkii]], [[source:core:mis.mkiv|core-mis.mkiv]]
  
 
== Help from ConTeXt-Mailinglist/Forum ==
 
== Help from ConTeXt-Mailinglist/Forum ==
Line 72: Line 90:
 
{{Forum|{{SUBPAGENAME}}}}
 
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Commands|setuptab]]
+
[[Category:Command/Paragraphs|setuptab]]
/td>
+
[[Category:Command/Descriptions|setuptab]]

Revision as of 15:52, 7 June 2012

\setuptab

Syntax

\setuptab[...,...=...,...]
headstyle normal bold slanted boldslanted type cap small... command
style normal bold slanted boldslanted type cap small... command
sample text
width dimension default: broad
sample dimension default: \hskip4em
MkII: location
MkIV: alternative
left
...=... see \setupdescriptions

Description

\tab is a description created with \definedescription[tab]. By default, it leaves 4em for the key and 2em of space between the key area and the paragraph, the latter thanks to width=broad. width=fit leaves no space in between; in mkiv, width=fit leaves 1em of space between the key space and the paragraph. This is probably a bug.

Example

\def\ruler{%
    \dorecurse{8}{%
        \dontleavehmode%
        \blackrule[width={\dimexpr1em-0.5pt}, height=0.5pt]%
        \dontleavehmode%
        \blackrule[width=0.5pt, height=1ex]%
    }
}

\def\testpara{%
     They might have called Sunday the super-man. If any such creature
     be conceivable, he looked, indeed, somewhat like it, with his
     earth-shaking abstraction, as of a stone statue walking.
}

(The ruler is marked in ems. 
The quotation is from G.K. Chesterton's {\em The Man who was Thursday}.)

\ruler \par
\setuptab[width=broad, sample={\blackrule[width=2em]}, headstyle=slanted]
\tab{\blackrule[width=2em]} (Sample of 2em wide, broad width.) \testpara \par

\ruler \par
\setuptab[width=broad, sample={\blackrule[width=4em]}, headstyle=slanted]
\tab{\blackrule[width=4em]} (Sample of 4em wide, broad width.) \testpara \par

\ruler \par
\setuptab[width=fit, sample={\blackrule[width=2em]}, headstyle=slanted]
\tab{\blackrule[width=2em]} (Sample of 2em wide, fit width.) \testpara \par

\ruler \par
\setuptab[width=3em, sample={thisisaverylongsample}, headstyle=slanted]
\tab{\blackrule[width=3em]} (Exact width of 3em overrides long sample.) \testpara \par

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: