ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Tikz and \color
@ 2011-09-19 11:10 Felix Ingram
  2011-09-19 11:41 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Ingram @ 2011-09-19 11:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello all,

I'm using Tikz to draw some fancy text boxes, but I've bumped into an
annoying problem. If you run the example below then the body text will
be rendered in red. If you remove the "REMOVE ME" text, then it will
be rendered in black. I would expect the black version to be the
correct version but I need to add text to my node.

Am I using \color correctly? Does anyone know how I might go about
debugging this? Is there a way to determine whether it's Context or
Tikz that's misbehaving?

\usemodule[tikz]
\setuppapersize[A4][A4]
\setupcolors[state=start]
\setuphead[section]
[
after={\color[red]{\hrule width 125mm \vskip 2em}},
]
\starttext
\section{Some Title}
\starttikzpicture
    \node{
REMOVE ME
    };
\stoptikzpicture
Flank sint culpa, dolore dolore ham hock chicken t-bone irure
pastrami. Eiusmod corned beef sint enim. Corned beef nulla qui aute,
meatloaf ground round cillum ex. Ut swine pork belly, tongue pig sed
tail frankfurter biltong ut bresaola anim. Jowl consequat tenderloin,
meatloaf fatback eu sint duis mollit chuck biltong. Nostrud cupidatat
nulla meatball, brisket irure dolor. Aliqua chuck ut in, nisi ea
t-bone shankle bresaola.
\stoptext


Thanks in advance,

Felix
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Tikz and \color
  2011-09-19 11:10 Tikz and \color Felix Ingram
@ 2011-09-19 11:41 ` Hans Hagen
  2011-09-19 12:28   ` Felix Ingram
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2011-09-19 11:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Felix Ingram

On 19-9-2011 13:10, Felix Ingram wrote:
> Hello all,
>
> I'm using Tikz to draw some fancy text boxes, but I've bumped into an
> annoying problem. If you run the example below then the body text will
> be rendered in red. If you remove the "REMOVE ME" text, then it will
> be rendered in black. I would expect the black version to be the
> correct version but I need to add text to my node.

> Am I using \color correctly? Does anyone know how I might go about
> debugging this? Is there a way to determine whether it's Context or
> Tikz that's misbehaving?

Tikz implements it own color handling and that interferes with the 
handling built in context. The following works.

\usemodule[tikz]

\setuphead[section][after={\blackrule[color=red,width=125mm,height=1pt,depth=1pt]\vskip 
2em}]

\starttext

\section{Some Title}

\dontleavehmode\forcecolorhack
\starttikzpicture
     \node{x};
\stoptikzpicture

Flank sint culpa, dolore dolore ham hock chicken t-bone irure
pastrami. Eiusmod corned beef sint enim. Corned beef nulla qui aute,
meatloaf ground round cillum ex. Ut swine pork belly, tongue pig sed
tail frankfurter biltong ut bresaola anim. Jowl consequat tenderloin,
meatloaf fatback eu sint duis mollit chuck biltong. Nostrud cupidatat
nulla meatball, brisket irure dolor. Aliqua chuck ut in, nisi ea
t-bone shankle bresaola.

\stoptext

We can consider adding some dummy to the tikz wrapper (\char0 will do) 
so that the context color mechanism gets reset before tikz doe some 
literal juggling.

Anyway, when text precedes the picture it will go okay.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Tikz and \color
  2011-09-19 11:41 ` Hans Hagen
@ 2011-09-19 12:28   ` Felix Ingram
  0 siblings, 0 replies; 3+ messages in thread
From: Felix Ingram @ 2011-09-19 12:28 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Excellent. Thanks Hans - that works brilliantly.

However, it's now made me realise that I'm using movesidefloat
incorrectly! (need to float something higher than the start of the
paragraph). Back to the details manual!

Thanks again,

Felix



On 19 September 2011 12:41, Hans Hagen <pragma@wxs.nl> wrote:
> On 19-9-2011 13:10, Felix Ingram wrote:
>>
>> Hello all,
>>
>> I'm using Tikz to draw some fancy text boxes, but I've bumped into an
>> annoying problem. If you run the example below then the body text will
>> be rendered in red. If you remove the "REMOVE ME" text, then it will
>> be rendered in black. I would expect the black version to be the
>> correct version but I need to add text to my node.
>
>> Am I using \color correctly? Does anyone know how I might go about
>> debugging this? Is there a way to determine whether it's Context or
>> Tikz that's misbehaving?
>
> Tikz implements it own color handling and that interferes with the handling
> built in context. The following works.
>
> \usemodule[tikz]
>
> \setuphead[section][after={\blackrule[color=red,width=125mm,height=1pt,depth=1pt]\vskip
> 2em}]
>
> \starttext
>
> \section{Some Title}
>
> \dontleavehmode\forcecolorhack
> \starttikzpicture
>    \node{x};
> \stoptikzpicture
>
> Flank sint culpa, dolore dolore ham hock chicken t-bone irure
> pastrami. Eiusmod corned beef sint enim. Corned beef nulla qui aute,
> meatloaf ground round cillum ex. Ut swine pork belly, tongue pig sed
> tail frankfurter biltong ut bresaola anim. Jowl consequat tenderloin,
> meatloaf fatback eu sint duis mollit chuck biltong. Nostrud cupidatat
> nulla meatball, brisket irure dolor. Aliqua chuck ut in, nisi ea
> t-bone shankle bresaola.
>
> \stoptext
>
> We can consider adding some dummy to the tikz wrapper (\char0 will do) so
> that the context color mechanism gets reset before tikz doe some literal
> juggling.
>
> Anyway, when text precedes the picture it will go okay.
>
> Hans
>
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------
>
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-19 12:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-19 11:10 Tikz and \color Felix Ingram
2011-09-19 11:41 ` Hans Hagen
2011-09-19 12:28   ` Felix Ingram

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).