* How to do this in ConTeXt
@ 2006-01-04 18:20 R S Ananda Murthy
0 siblings, 0 replies; 7+ messages in thread
From: R S Ananda Murthy @ 2006-01-04 18:20 UTC (permalink / raw)
Hello,
I need the format shown below:
-------------
|Example 1-1|
-----------------------------------------
Here Example 1-1 should be in a black box and text should be in white.
The line attached to this box should run up to the right margin.
I need a counter for examples to count up and display the example number
as shown above for more examples. I am new to ConTeXt. So, I need help.
Thanks for your help.
Anand
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to do this in ConTeXt
2006-01-04 20:51 ` FabriceL.
2006-01-04 21:48 ` Hans Hagen
@ 2006-01-05 10:33 ` R S Ananda Murthy
1 sibling, 0 replies; 7+ messages in thread
From: R S Ananda Murthy @ 2006-01-05 10:33 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to do this in ConTeXt
2006-01-04 20:51 ` FabriceL.
@ 2006-01-04 21:48 ` Hans Hagen
2006-01-05 10:33 ` R S Ananda Murthy
1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2006-01-04 21:48 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to do this in ConTeXt
[not found] ` <B3C24EA955FF0C4EA14658997CD3E25E5AE664@CAHIER.gst.uqam.ca>
@ 2006-01-04 20:51 ` FabriceL.
2006-01-04 21:48 ` Hans Hagen
2006-01-05 10:33 ` R S Ananda Murthy
0 siblings, 2 replies; 7+ messages in thread
From: FabriceL. @ 2006-01-04 20:51 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to do this in ConTeXt
2006-01-04 18:41 ` Fabrice Larribe
@ 2006-01-04 19:42 ` Hans Hagen
[not found] ` <B3C24EA955FF0C4EA14658997CD3E25E5AE664@CAHIER.gst.uqam.ca>
1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2006-01-04 19:42 UTC (permalink / raw)
Fabrice Larribe wrote:
> Hi,
>
> R S Ananda Murthy wrote:
>
>> Hello,
>>
>> I need the format shown below:
>>
>> -------------
>> |Example 1-1|
>> -----------------------------------------
>>
> \setupoutput[pdftex]
> \setupcolors[state=start]
>
>
> Here is (almost) what you want to acheive, but without any macros:
> \blank
> \starttext
> %\def\Ex#1{ \line{\framed{\red #1}} }
> \line{
> \framed[background=color,backgroundcolor=black]{
> { {\white Exemple 1.1\ }}}\hfill
> }
> \hrule
> \blank
> To have numbers, you should use ennumeration.. And a try.. but I don't
> know how to adjust things... Others have to complete...
>
> \defineenumeration[Exemple][location=serried,headstyle=bold,width=broad,
> text={\framed[background=color,backgroundcolor=black]{\red\sc
> Exemple}\textrule},margin=0.5cm,before=\blank,after=\blank]
>
> \startExemple
> This is a nice exemple.
> \stopExemple
>
>
> This is the end.
> \stoptext
>
> F.
one of you has to wikify this answer ...
\setupcolors[state=start]
\setupbackgrounds[text][text][background=color,backgroundcolor=red,backgroundoffset=3pt]
\defineenumeration
[example]
[way=bychapter,
separator=\compoundhyphen,
chapternumber=yes,
color=white,
command=\exampleframed]
\defineframed
[exampleframed]
[background=color,
backgroundcolor=white,
foregroundcolor=black,
style=bold,
frame=off]
\starttext
\chapter{One}
\input tufte
\startexample
\input tufte
\stopexample
\input tufte
\stoptext
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to do this in ConTeXt
[not found] <B3C24EA955FF0C4EA14658997CD3E25E5AE657@CAHIER.gst.uqam.ca>
[not found] ` <43BC 16BF.9030502@uqam.ca>
@ 2006-01-04 18:41 ` Fabrice Larribe
2006-01-04 19:42 ` Hans Hagen
[not found] ` <B3C24EA955FF0C4EA14658997CD3E25E5AE664@CAHIER.gst.uqam.ca>
1 sibling, 2 replies; 7+ messages in thread
From: Fabrice Larribe @ 2006-01-04 18:41 UTC (permalink / raw)
Hi,
R S Ananda Murthy wrote:
> Hello,
>
> I need the format shown below:
>
> -------------
> |Example 1-1|
> -----------------------------------------
>
\setupoutput[pdftex]
\setupcolors[state=start]
Here is (almost) what you want to acheive, but without any macros:
\blank
\starttext
%\def\Ex#1{ \line{\framed{\red #1}} }
\line{
\framed[background=color,backgroundcolor=black]{
{ {\white Exemple 1.1\ }}}\hfill
}
\hrule
\blank
To have numbers, you should use ennumeration.. And a try.. but I don't
know how to adjust things... Others have to complete...
\defineenumeration[Exemple][location=serried,headstyle=bold,width=broad,
text={\framed[background=color,backgroundcolor=black]{\red\sc
Exemple}\textrule},margin=0.5cm,before=\blank,after=\blank]
\startExemple
This is a nice exemple.
\stopExemple
This is the end.
\stoptext
F.
^ permalink raw reply [flat|nested] 7+ messages in thread
* How to do this in ConTeXt
@ 2006-01-04 16:52 R S Ananda Murthy
0 siblings, 0 replies; 7+ messages in thread
From: R S Ananda Murthy @ 2006-01-04 16:52 UTC (permalink / raw)
Hello,
I need the format shown below:
-------------
|Example 1-1|
-----------------------------------------
Here Example 1-1 should be in a black box and text should be in white.
The line attached to this box should run up to the right margin.
I need a counter for examples to count up and display the example number
as shown above for more examples. I am new to ConTeXt. So, I need help.
Thanks for your help.
Anand
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-01-05 10:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-04 18:20 How to do this in ConTeXt R S Ananda Murthy
[not found] <B3C24EA955FF0C4EA14658997CD3E25E5AE657@CAHIER.gst.uqam.ca>
[not found] ` <43BC 16BF.9030502@uqam.ca>
2006-01-04 18:41 ` Fabrice Larribe
2006-01-04 19:42 ` Hans Hagen
[not found] ` <B3C24EA955FF0C4EA14658997CD3E25E5AE664@CAHIER.gst.uqam.ca>
2006-01-04 20:51 ` FabriceL.
2006-01-04 21:48 ` Hans Hagen
2006-01-05 10:33 ` R S Ananda Murthy
-- strict thread matches above, loose matches on Subject: below --
2006-01-04 16:52 R S Ananda Murthy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).