Difference between revisions of "Command/definecolumnset"

From ConTeXt wiki
Jump to navigationJump to search
m
(some restructuring)
 
(3 intermediate revisions by one other user not shown)
Line 6: Line 6:
 
== [[Help:Reference|Syntax]] (autogenerated) ==
 
== [[Help:Reference|Syntax]] (autogenerated) ==
 
<syntax>definecolumnset</syntax>
 
<syntax>definecolumnset</syntax>
== [[Help:Reference|Syntax]] ==
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
  <tr>
 
    <td colspan="2" class="cmd">\definecolumnset<!--
 
      --><span class="first">[...]</span><!--
 
      --><span class="second">[...]</span><!--
 
--></td>
 
  </tr>
 
  <tr valign="top" class="first">
 
    <td class="cmd">[...]</td>
 
    <td>''name''</td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[...]</td>
 
    <td>''setups''</td>
 
  </tr>
 
</table>
 
  
 
== Description ==
 
== Description ==
Line 66: Line 49:
 
Columnsets are spread-based, i.e. when n=4 you actually have eight columns: four on the left page and four on the right page. A document always opens with a right page.
 
Columnsets are spread-based, i.e. when n=4 you actually have eight columns: four on the left page and four on the right page. A document always opens with a right page.
  
== Example ==
+
== Examples ==
 +
===Two Columns===
  
 
<context mode=mkiv source=yes>
 
<context mode=mkiv source=yes>
% mode=mkiv
 
 
\setuppapersize[A5]
 
\setuppapersize[A5]
  
Line 86: Line 69:
 
\stopcolumnset
 
\stopcolumnset
 
</context>
 
</context>
 +
 +
===Four Columns===
 +
 +
Copy and paste the example code in its own file then run ConTeXt to see the output:
 +
 +
<texcode>
 +
\definepapersize[BookPaperSize][width=24in, height=12in,]
 +
\setuppapersize[BookPaperSize]
 +
 +
\definelayout[BookTextLayout][
 +
  topspace=.5in,
 +
  backspace=.5in,
 +
  header=\zeropoint,
 +
  footer=\zeropoint,
 +
  grid=yes,
 +
]
 +
\setuplayout[BookTextLayout]
 +
 +
\definecolumnset[BookColumns][n=4,distance=.25in,page=yes]
 +
 +
% Define how the columns appear on both left and right pages.
 +
\setupcolumnset[BookColumns:1][width=11.75in]
 +
\setupcolumnset[BookColumns:2][width=3.46in]
 +
\setupcolumnset[BookColumns:3][width=3.46in]
 +
\setupcolumnset[BookColumns:4][width=3.46in]
 +
 +
\setupcolumnset[BookColumns:5][width=11.75in]
 +
\setupcolumnset[BookColumns:6][width=3.46in]
 +
\setupcolumnset[BookColumns:7][width=3.46in]
 +
\setupcolumnset[BookColumns:8][width=3.46in]
 +
 +
\setuphead[section][
 +
  beforesection={\startcolumnset[BookColumns]},
 +
  aftersection={\stopcolumnset},
 +
]
 +
 +
\setuphead[subsection][
 +
  after={\column},
 +
]
 +
 +
\setuphead[subsubsection][after={\blank[small]},]
 +
 +
\starttext
 +
\dorecurse{2}{%
 +
  \startsection[title={Section Title}]
 +
  \startsubsection[title={Subtitle}]
 +
  \dorecurse{2}{\input knuth}
 +
 +
  \dorecurse{2}{%
 +
    \startsubsubsection[title={Subsubtitle}]
 +
      \dorecurse{1}{\input ward}
 +
      \dorecurse{2}{\input lorem}
 +
      \dorecurse{1}{\input bryson}
 +
    \stopsubsubsection
 +
  }
 +
 +
  \stopsubsection
 +
  \stopsection
 +
}
 +
\stoptext
 +
</texcode>
  
 
== See also ==
 
== See also ==
* {{src|page-set.mkiv}}
+
* {{src|page-cst.mkiv}}
 
* {{cmd|startcolumnset}}
 
* {{cmd|startcolumnset}}
 
+
* {{cmd|definecolumnsetspan}}
 +
* {{cmd|definecolumnsetarea}}
  
 
== Help from ConTeXt-Mailinglist/Forum ==
 
== Help from ConTeXt-Mailinglist/Forum ==

Latest revision as of 10:13, 20 January 2020

\definecolumnset

Syntax (autogenerated)

\definecolumnset[...][...][...=...,...]
[...]name
[...]name
...=...,...inherits from \setupcolumnset


Description

Define a new columnset environment with certain properties.

Header 1 Header 2
direction right
balance no
distance 1.5\bodyfontsize
n 2
nleft Number of columns on left-hand pages
nright Number of columns on right-hand pages
width fit
lines 0
start 0
page Start a page break before the columnset

Columnsets are spread-based, i.e. when n=4 you actually have eight columns: four on the left page and four on the right page. A document always opens with a right page.

Examples

Two Columns

\setuppapersize[A5]

\definecolumnset[TwoColumns][n=2]

\startcolumnset [TwoColumns]
  \title{Test page}
  \framed
    [frame=off,
     bottomframe=on,
     width=\textwidth,
     frameoffset=1mm,
     foregroundstyle=small,
    ]{\copyright\ \date[][year] Donald E. Knuth}
  \input knuth
\stopcolumnset

Four Columns

Copy and paste the example code in its own file then run ConTeXt to see the output:

\definepapersize[BookPaperSize][width=24in, height=12in,]
\setuppapersize[BookPaperSize]

\definelayout[BookTextLayout][
  topspace=.5in,
  backspace=.5in,
  header=\zeropoint,
  footer=\zeropoint,
  grid=yes,
]
\setuplayout[BookTextLayout]

\definecolumnset[BookColumns][n=4,distance=.25in,page=yes]

% Define how the columns appear on both left and right pages.
\setupcolumnset[BookColumns:1][width=11.75in]
\setupcolumnset[BookColumns:2][width=3.46in]
\setupcolumnset[BookColumns:3][width=3.46in]
\setupcolumnset[BookColumns:4][width=3.46in]

\setupcolumnset[BookColumns:5][width=11.75in]
\setupcolumnset[BookColumns:6][width=3.46in]
\setupcolumnset[BookColumns:7][width=3.46in]
\setupcolumnset[BookColumns:8][width=3.46in]

\setuphead[section][
  beforesection={\startcolumnset[BookColumns]},
  aftersection={\stopcolumnset},
]

\setuphead[subsection][
  after={\column},
]

\setuphead[subsubsection][after={\blank[small]},]

\starttext
\dorecurse{2}{%
  \startsection[title={Section Title}]
  \startsubsection[title={Subtitle}]
  \dorecurse{2}{\input knuth}

  \dorecurse{2}{%
    \startsubsubsection[title={Subsubtitle}]
      \dorecurse{1}{\input ward}
      \dorecurse{2}{\input lorem}
      \dorecurse{1}{\input bryson}
    \stopsubsubsection
  }

  \stopsubsection
  \stopsection
}
\stoptext

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: