Re: [NTG-context] TikZ node and color
![](https://secure.gravatar.com/avatar/13bc5842f0b785acdb8f02c38b78439d.jpg?s=120&d=mm&r=g)
On Tue, 5 Jul 2016 10:21:48 +0200, Hans Hagen
On 7/5/2016 9:25 AM, Christoph Reller wrote:
Dear List,
I use the latest version of ConTeXt and I have the following MWE:
\usemodule[tikz] \starttext \starttikzpicture \node {\color[red]{red}}; \node[xshift=30] {\color[red]{not red}}; \stoptikzpicture \stoptext
Can anybody tell me why the second node is not colored red?
Aside: In LaTeX when using \color{red}{...} this tikzpicture renders correctly. For LaTeX I use TikZ version 3.0.1a, in ConTeXt it seems to be version 3.0.1.
Any feedback is welcome.
tikz has its own color mechanisms and they don't mix well with context color support so context probbably thinks it's still in red (so you need to force something non red in front)
\starttikzpicture \node {\color[red]{red}}; \node[xshift=30] {\zwnj\color[red]{not red}}; \stoptikzpicture
Thank you Hans! This workaround does the job. For those interested: The \zwnj can be prepended automatically to every node by setting "every node/.add code=\zwnj". The updated MWE now is: \usemodule[tikz] \tikzset{every node/.add code=\zwnj} \starttext \starttikzpicture \node {\color[red]{red}}; \node[xshift=30] {\color[red]{not red}}; \stoptikzpicture \stoptext Cheers, Christoph
participants (1)
-
Christoph Reller