Difference between revisions of "Command/definemixedcolumns"

From Wiki
Jump to navigation Jump to search
m (Created page with "The following code provides a simple example usage for {{cmd|definemixedcolumns}}: <pre> \setupcolors[state=start] \startuseMPgraphic{StyleVerticalRule} draw OverlayBox; \sto...")
 
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
  
 
<pre>
 
<pre>
\setupcolors[state=start]
+
%\setupcolors[state=start] % This is only necessary in older ConTeXt mkii.
 +
 
 +
\hyphenation{sig-ni-fi-cant-ly} % for correct line formatting
  
 
\startuseMPgraphic{StyleVerticalRule}
 
\startuseMPgraphic{StyleVerticalRule}
Line 12: Line 14:
 
\definemixedcolumns
 
\definemixedcolumns
 
   [sectioncolumns]
 
   [sectioncolumns]
   [
+
   [n=2, separator=rule, rulecolor=darkgreen, rulethickness=3pt, balance=yes]
    n=2,  
 
    separator=rule,
 
    rulecolor=red,
 
    rulethickness=6.5pt,
 
    balance=yes,
 
  ]
 
  
 
% Horizontal line below the section header.
 
% Horizontal line below the section header.
 
\defineframed[sectionframed]
 
\defineframed[sectionframed]
             [
+
             [frame=off, bottomframe=on, framecolor=darkgreen,
              frame=off,
+
              rulethickness=1pt, width=local, align=normal, % to get a vbox
              bottomframe=on,
 
              framecolor=pink,
 
              rulethickness=1.0pt,
 
              width=local,
 
              align=normal, % to get a vbox
 
 
             ]
 
             ]
  
Line 35: Line 26:
 
\setuphead
 
\setuphead
 
     [section]
 
     [section]
     [
+
     [command=\StyleSection, after={\startsectioncolumns},
      command=\StyleSection,
+
    aftersection={\stopsectioncolumns}]
      after={\startsectioncolumns},
 
      aftersection={\stopsectioncolumns},
 
    ]
 
  
 
\starttext
 
\starttext
\startchapter[title={Chapter}, reference=sec:my-chapter,]
+
  \startchapter[title={Chapter}, reference=sec:my-chap,]
  \startsection[title={Section}, reference=sec:my-section,]
+
    \startsection[title={Section}, reference=sec:my-sect,]
      \startsubsection[title={Equipment},reference=sec:my-equipment,]
+
        \startsubsection[title={Content}, reference=sec:my-cont,]
        \input knuth
+
          \input knuth
        \input knuth
+
          \input knuth
      \stopsubsection
+
        \stopsubsection
  \stopsection
+
    \stopsection
\stopchapter
+
  \stopchapter
 
 
 
\stoptext
 
\stoptext
 
</pre>
 
</pre>

Latest revision as of 21:27, 30 December 2017

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

%\setupcolors[state=start] % This is only necessary in older ConTeXt mkii.

\hyphenation{sig-ni-fi-cant-ly} % for correct line formatting

\startuseMPgraphic{StyleVerticalRule}
  draw OverlayBox;
\stopuseMPgraphic

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

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

% Horizontal line below the section header.
\defineframed[sectionframed]
             [frame=off, bottomframe=on, framecolor=darkgreen,
              rulethickness=1pt, 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-chap,]
    \startsection[title={Section}, reference=sec:my-sect,]
        \startsubsection[title={Content}, reference=sec:my-cont,]
          \input knuth
          \input knuth
        \stopsubsection
    \stopsection
  \stopchapter
\stoptext