Command/definemixedcolumns

From Wiki
< Command
Revision as of 20:35, 1 September 2013 by Thangalin (talk | contribs) (Created page with "The following code provides a simple example usage for {{cmd|definemixedcolumns}}: <pre> \setupcolors[state=start] \startuseMPgraphic{StyleVerticalRule} draw OverlayBox; \sto...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The following code provides a simple example usage for \definemixedcolumns:

\setupcolors[state=start]

\startuseMPgraphic{StyleVerticalRule}
  draw OverlayBox;
\stopuseMPgraphic

\defineoverlay[StyleVerticalRule][\useMPgraphic{StyleVerticalRule}]

\definemixedcolumns
  [sectioncolumns]
  [
    n=2, 
    separator=rule,
    rulecolor=red,
    rulethickness=6.5pt,
    balance=yes,
  ]

% Horizontal line below the section header.
\defineframed[sectionframed]
             [
               frame=off,
               bottomframe=on,
               framecolor=pink,
               rulethickness=1.0pt,
               width=local,
               align=normal, % to get a vbox
             ]

\define[2]\StyleSection{\sectionframed{#2}}

\setuphead
    [section]
    [
      command=\StyleSection,
      after={\startsectioncolumns},
      aftersection={\stopsectioncolumns},
    ]

\starttext
\startchapter[title={Chapter}, reference=sec:my-chapter,]
  \startsection[title={Section}, reference=sec:my-section,]
      \startsubsection[title={Equipment},reference=sec:my-equipment,]
        \input knuth
        \input knuth
      \stopsubsection
  \stopsection
\stopchapter

\stoptext