Re: [NTG-context] How to do this in ConTeXt
Hi, Hans, it's so instructive to read yout post... I have learned from this last post 2 new commands ! However, I think the original poster wish a line who run to the right margin, so I added to your code in the "defineenumeration" a "inbetween=\vskip-4pt{\hrule height 1.5pt}\blank". This is not very elegant, but this works. By the way, I'm interested to know if there is a better solution.
Hans wrote: one of you has to wikify this answer ...
I'm not sure how to do this, but I can try how this works. The complete code follows. FL. \setupcolors[state=start] \setupbackgrounds[text][text][background=color,backgroundcolor=darkred,backgroundoffset=3pt] \defineenumeration [example] [way=bychapter, separator=\compoundhyphen, chapternumber=yes, color=white, command=\exampleframed, inbetween=\vskip-4pt{\hrule height 1.5pt}\blank] \defineframed [exampleframed] [background=color, backgroundcolor=black, foregroundcolor=white, style=bold, frame=off] \starttext \chapter{One} \input tufte \startexample \input tufte \stopexample \input tufte \stoptext
FabriceL. wrote:
Hi,
Hans, it's so instructive to read yout post... I have learned from this last post 2 new commands ! However, I think the original poster wish a line who run to the right margin, so I added to your code in the "defineenumeration" a "inbetween=\vskip-4pt{\hrule height 1.5pt}\blank". This is not very elegant, but this works. By the way, I'm interested to know if there is a better solution.
Hans wrote: one of you has to wikify this answer ...
I'm not sure how to do this, but I can try how this works. The complete code follows. FL.
\setupcolors[state=start] \setupbackgrounds[text][text][background=color,backgroundcolor=darkred,backgroundoffset=3pt]
\defineenumeration [example] [way=bychapter, separator=\compoundhyphen, chapternumber=yes, color=white, command=\exampleframed, inbetween=\vskip-4pt{\hrule height 1.5pt}\blank]
if you say \showstruts you will notice why you need to skip back; your 4pt is a gamble, best do something: \defineenumeration [example] [way=bychapter, separator=\compoundhyphen, chapternumber=yes, color=white, command=\exampleframed, inbetween=\setups{example:inbetween}] \startsetups example:inbetween \removedepth % nils strut depth \nointerlineskip \blackrule[height=1.5pt,width=\hsize,depth=0pt] \blank \nobreak \stopsetups btw, this makes a nice example for a regression test
\defineframed [exampleframed] [background=color, backgroundcolor=black, foregroundcolor=white, style=bold, frame=off]
\starttext
\chapter{One}
\input tufte
\startexample \input tufte \stopexample
\input tufte
\stoptext
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
FabriceL. wrote:
Hi,
Hans, it's so instructive to read yout post... I have learned from this last post 2 new commands ! However, I think the original poster wish a line who run to the right margin, so I added to your code in the "defineenumeration" a "inbetween=\vskip-4pt{\hrule height 1.5pt}\blank". This is not very elegant, but this works. By the way, I'm interested to know if there is a better solution.
Hans wrote: one of you has to wikify this answer ...
I'm not sure how to do this, but I can try how this works. The complete code follows. FL.
\setupcolors[state=start] \setupbackgrounds[text][text][background=color,backgroundcolor=darkred,backgroundoffset=3pt]
\defineenumeration [example] [way=bychapter, separator=\compoundhyphen, chapternumber=yes, color=white, command=\exampleframed, inbetween=\vskip-4pt{\hrule height 1.5pt}\blank]
\defineframed [exampleframed] [background=color, backgroundcolor=black, foregroundcolor=white, style=bold, frame=off]
\starttext
\chapter{One}
\input tufte
\startexample \input tufte \stopexample
\input tufte
\stoptext
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Thank you FabriceL for your help. It worked. Anand
participants (3)
-
FabriceL.
-
Hans Hagen
-
R S Ananda Murthy