Re: [NTG-context] TikZ node and color
On Tue, 5 Jul 2016 10:21:48 +0200, Hans Hagenwrote: > 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 ___ 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 ___
Re: [NTG-context] TikZ node and color
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 - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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 ___
[NTG-context] TikZ node and color
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. Regards, Christoph ___ 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 ___