Difference between revisions of "Command/setupcolumns"

From ConTeXt wiki
Jump to navigationJump to search
m (cleanup)
 
(18 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
}}
 
}}
  
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>setupcolumns</syntax>
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
<table cellspacing="4" cellpadding="2" class="cmd">
Line 10: Line 12:
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:n|n]]</td>
+
     <td class="cmd">[[Command/keyword:n|n]]</td>
     <td>[[Reference/en/value:number|number]] </td>
+
     <td>[[Command/value:number|number]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:ntop|ntop]]</td>
+
     <td class="cmd">[[Command/keyword:ntop|ntop]]</td>
     <td>[[Reference/en/value:number|number]] </td>
+
     <td>[[Command/value:number|number]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:rule|rule]]</td>
+
     <td class="cmd">[[Command/keyword:rule|rule]]</td>
     <td>[[Reference/en/value:on|on]] [[Reference/en/value:off|off]] </td>
+
     <td>[[Command/value:on|on]] [[Command/value:off|off]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:height|height]]</td>
+
     <td class="cmd">[[Command/keyword:height|height]]</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>[[Command/value:dimension|dimension]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:tolerance|tolerance]]</td>
+
     <td class="cmd">[[Command/keyword:tolerance|tolerance]]</td>
     <td>[[Reference/en/value:verystrict|verystrict]] [[Reference/en/value:strict|strict]] [[Reference/en/value:tolerant|tolerant]] [[Reference/en/value:verytolerant|verytolerant]] [[Reference/en/value:stretch|stretch]] </td>
+
     <td>[[Command/value:verystrict|verystrict]] [[Command/value:strict|strict]] [[Command/value:tolerant|tolerant]] [[Command/value:verytolerant|verytolerant]] [[Command/value:stretch|stretch]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:distance|distance]]</td>
+
     <td class="cmd">[[Command/keyword:distance|distance]]</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>[[Command/value:dimension|dimension]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:balance|balance]]</td>
+
     <td class="cmd">[[Command/keyword:balance|balance]]</td>
     <td>[[Reference/en/value:yes|yes]] [[Reference/en/value:no|no]] </td>
+
     <td>[[Command/value:yes|yes]] [[Command/value:no|no]] </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">[[Command/keyword:align|align]]</td>
     <td>[[Reference/en/value:yes|yes]] [[Reference/en/value:no|no]] [[Reference/en/value:text|text]] </td>
+
     <td>[[Command/value:yes|yes]] [[Command/value:no|no]] [[Command/value:text|text]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:blank|blank]]</td>
+
     <td class="cmd">[[Command/keyword:blank|blank]]</td>
     <td>[[Reference/en/value:fixed|fixed]] [[Reference/en/value:halfline|halfline]] [[Reference/en/value:line|line]] [[Reference/en/value:flexible|flexible]] [[Reference/en/value:big|big]] [[Reference/en/value:medium|medium]] [[Reference/en/value:small|small]] </td>
+
     <td>[[Command/value:fixed|fixed]] [[Command/value:halfline|halfline]] [[Command/value:line|line]] [[Command/value:flexible|flexible]] [[Command/value:big|big]] [[Command/value:medium|medium]] [[Command/value:small|small]] </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">[[Command/keyword:option|option]]</td>
     <td>[[Reference/en/value:background|background]] </td>
+
     <td>[[Command/value:background|background]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:direction|direction]]</td>
+
     <td class="cmd">[[Command/keyword:direction|direction]]</td>
     <td>[[Reference/en/value:left|left]] [[Reference/en/value:right|right]] </td>
+
     <td>[[Command/value:left|left]] [[Command/value:right|right]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
 
     <td class="cmd">[...,...=...,...]</td>
 
     <td class="cmd">[...,...=...,...]</td>
     <td>see [[Reference/en/setupframed|\setupframed]] </td>
+
     <td>see [[Command/setupframed|\setupframed]] </td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
Line 61: Line 63:
  
 
== Description ==  
 
== Description ==  
<pre>
 
n: number of columns, default is n=2
 
rule: draw a line between the columns, default is off
 
tolerance: affects spacing, narrow columns should be set tolerant, verytolerant or stretch
 
distance: gap between the columns
 
balance: should the columns be balanced, i.e. should they get the same number of lines?
 
align: left, right (raggedleft, raggedright)
 
blank: amount of whitespace between paragraphs set in columns. Also accepts a dimension as an argument. Column equivalent of \setupwhitespace
 
option: with option=background you can use everything that \setupframed offers
 
direction: default is right, i.e. the first column is on the left; 'left' means the first column is the rightmost.
 
height: ?
 
ntop: ?
 
</pre>
 
== comment ==
 
  
Consider using paragraphs or column sets instead of "simple" columns.
+
Consider using paragraphs ({{cmd|defineparagraphs}} or column sets ({{cmd|startcolumnset}} instead of ‘simple’ columns.
  
ntop has to do with balancing, but I can't make sense of it. See page-mult.tex / minbalancetoplines.  
+
{| class="wikitable"
height is unclear to me
+
|-
 +
| n
 +
| Number of columns. Default is n=2.
 +
|-
 +
| rule
 +
| Draw a line between the columns. Default is off.
 +
|-
 +
| tolerance
 +
| Affects spacing. Narrow columns should be set tolerant, verytolerant or stretch
 +
|-
 +
| distance
 +
| Size of the gap between the columns.
 +
|-
 +
| balance
 +
| Should the columns be balanced, i.e. should they get the same number of lines?
 +
|-
 +
| align
 +
| Left, right (raggedleft, raggedright).
 +
|-
 +
| blank
 +
| Amount of whitespace between paragraphs set in columns. Also accepts a dimension as an argument. Column equivalent of {{cmd|setupwhitespace}}.
 +
|-
 +
| option
 +
| With option=background you can use everything that \setupframed offers.
 +
|-  
 +
| direction
 +
| Default is right, i.e. the first column is on the left; 'left' means the first column is the rightmost.
 +
|-
 +
| height
 +
| height is unclear to me.
 +
|-
 +
| ntop
 +
| ntop contains the minimum number of lines a column should have. If, when a new set of columns starts (e.g. at the start of a page), there are 12 lines to distribute and <code>ntop=7</code>, then ConTeXt will produce one 12-line column rather than two 6-line columns. Note that <code>ntop=6</code> will result in one 7-line column and one 5-line column: ConTeXt seems to prefer that the last column be shorter, as long as its length is at least <code>ntop - n + 1</code>.
 +
|}
  
 
== Example ==
 
== Example ==
<!-- Please fill in an example if you can -->
+
<context source=yes>
 +
\setupcolumns[n=3,rule=on,ntop=4,background=color,backgroundcolor=green,]
 +
 
 +
\startcolumns
 +
  % 12 lines, please
 +
  \dorecurse{12}{line\crlf}
 +
\stopcolumns
 +
</context>
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
+
* {{cmd|startcolumns}} to start a columnar environment.
 +
* {{cmd|column}} to move to the next column.
 +
* {{cmd|setupparagraphs}} for the analogous command for side-by-side paragraphs
 +
 
 +
== Help from ConTeXt-Mailinglist/Forum ==
 +
All issues with:
 +
{{Forum|{{SUBPAGENAME}}}}
 +
 
 +
{{Columns navbox}}
  
[[Category:Reference/en|setupcolumns]]
+
[[Category:Command/Columns|setupcolumns]]

Latest revision as of 12:53, 14 January 2020

\setupcolumns

Syntax (autogenerated)

\setupcolumns[...=...,...]
nnumber
distancedimension
optionbackground
offsetdimension
commandoneargument
heightdimension
directionleft right
balanceyes no
alignsee \setupalign
tolerancesee \setuptolerance
blanksee \blank
ntopnumber
ruleon off command


Syntax

\setupcolumns[...,...=...,...]
n number
ntop number
rule on off
height dimension
tolerance verystrict strict tolerant verytolerant stretch
distance dimension
balance yes no
align yes no text
blank fixed halfline line flexible big medium small
option background
direction left right
[...,...=...,...] see \setupframed


Description

Consider using paragraphs (\defineparagraphs or column sets (\startcolumnset instead of ‘simple’ columns.

n Number of columns. Default is n=2.
rule Draw a line between the columns. Default is off.
tolerance Affects spacing. Narrow columns should be set tolerant, verytolerant or stretch
distance Size of the gap between the columns.
balance Should the columns be balanced, i.e. should they get the same number of lines?
align Left, right (raggedleft, raggedright).
blank Amount of whitespace between paragraphs set in columns. Also accepts a dimension as an argument. Column equivalent of \setupwhitespace.
option With option=background you can use everything that \setupframed offers.
direction Default is right, i.e. the first column is on the left; 'left' means the first column is the rightmost.
height height is unclear to me.
ntop ntop contains the minimum number of lines a column should have. If, when a new set of columns starts (e.g. at the start of a page), there are 12 lines to distribute and ntop=7, then ConTeXt will produce one 12-line column rather than two 6-line columns. Note that ntop=6 will result in one 7-line column and one 5-line column: ConTeXt seems to prefer that the last column be shorter, as long as its length is at least ntop - n + 1.

Example

\setupcolumns[n=3,rule=on,ntop=4,background=color,backgroundcolor=green,]

\startcolumns
  % 12 lines, please
  \dorecurse{12}{line\crlf}
\stopcolumns

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: