[NTG-context] Some problems with a new style for the sections

Rik Kabel context at rik.users.panix.com
Sun May 4 20:56:43 CEST 2014


On 2014-05-04 07:21, Fabrice Couvreur wrote:
> Hi,
> I encounter two problems:
> - Section numbers are not red ;
> - Calling the second section does not cause the creation of a new 
> paragraph.
> Regards,
> Fabrice
>
> \setupcolors[state=start]
> \def\MySectionCommand#1#2%
>   {\framed
>      [frame=off,
>       width=\textwidth,
>       align={right},
>       background=color,
>       backgroundcolor=lightgray]
>      {#1\quad#2}}
>
> \setuphead[section][command=\MySectionCommand,numbercolor=red]
>
> \setupbodyfont[palatino,12pt]
>
> \starttext
>
> \MySectionCommand{A.}{Définitions}
> \input knuth
> \MySectionCommand{1.}{Propriétés}
> \input knuth
>
I think you want ownnumber (in addition to the previously mentioned 
\section).

    \setupcolors[state=start]
    \define[2]\MySectionCommand
       {\framed
          [frame=off,
           width=\textwidth,
           align={right},
           background=color,
           backgroundcolor=lightgray]
          {#1.\quad#2}}

    \setuphead[section][command=\MySectionCommand,ownnumber=yes,numbercolor=red]

    \setupbodyfont[palatino,12pt]

    \starttext

    \placecontent

    \section{A}{Définitions}
    \input knuth

    \section{1}{Propriétés}
    \input knuth

    \section{2}{Propriétés}
    \input knuth

    \section{3}{Propriétés}
    \input knuth

    \section{B}{Définitions}
    \input knuth

    \section{1}{Propriétés}
    \input knuth

    \section{2}{Propriétés}
    \input knuth

    \stoptext



-- 
Rik Kabel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20140504/6d472db0/attachment-0001.html>


More information about the ntg-context mailing list