Dear Reader, I have a colored section, text in another color and a TikZ picture with a differently colored node, following each other. However, either the node gets the wrong color or the following paragraph, see example below. Is there something wrong with the section settings? How do I get all the colors right without using a paragraph in between? \setuphead[chapter] [ style={\tfd}, color={A2plus}, ] \setuphead[section] [ style={\tfc}, color={A3plus}, ] \definecolor[A1plus][h=5CAF00] \definecolor[A2plus][h=B6437E] \definecolor[A3plus][h=606ABD] \definecolor[A4plus][h=FFC700] \definecolor[A5plus][h=D0202B] \definecolor[A6plus][h=EF8600] \definecolor[A7plus][h=0082AA] \setupcolors[textcolor=A1plus] \usemodule[tikz] \starttext \startchapter[title={Colour test}, ref=colourtest] \startsection[title={Section}] \starttikzpicture \draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text should be orange}; \stoptikzpicture \par This a paragraph which gets the colour of the section for no reason. \stopsection \stopchapter \startchapter[title={Colour test 2}, ref=colourtest] \startsection[title={Another section }] \par This a paragraph in the appropriate text color (green). \starttikzpicture \draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text is orange}; \stoptikzpicture \stopsection \stopchapter \stoptext
Hi,
On 1 Oct 2020, at 20:55, Susanne G. Loeber
wrote: Dear Reader,
I have a colored section, text in another color and a TikZ picture with a differently colored node, following each other. However, either the node gets the wrong color or the following paragraph, see example below.
Is there something wrong with the section settings? How do I get all the colors right without using a paragraph in between?
Some of the blackbox magic in the tikz module is confusing ConTeXt, it seems. This works: \draw (0,0) rectangle (2,1) node[right] {\color[A6plus]{node text should be orange}}; But that’s all I know. I do not understand the tikz module at all. Best wishes, Taco
On 01/10/20, 20:55, Susanne G. Loeber wrote:
Dear Reader,
I have a colored section, text in another color and a TikZ picture with a differently colored node, following each other. However, either the node gets the wrong color or the following paragraph, see example below.
Is there something wrong with the section settings? How do I get all the colors right without using a paragraph in between?
From experience, this usually works:
\prependvalue{starttikzpicture}{\dontleavehmode\forcecolorhack} Cheers, Henri
\setuphead[chapter]
[
style={\tfd},
color={A2plus},
]
\setuphead[section]
[
style={\tfc},
color={A3plus},
]
\definecolor[A1plus][h=5CAF00]
\definecolor[A2plus][h=B6437E]
\definecolor[A3plus][h=606ABD]
\definecolor[A4plus][h=FFC700]
\definecolor[A5plus][h=D0202B]
\definecolor[A6plus][h=EF8600]
\definecolor[A7plus][h=0082AA]
\setupcolors[textcolor=A1plus]
\usemodule[tikz]
\starttext
\startchapter[title={Colour test}, ref=colourtest]
\startsection[title={Section}]
\starttikzpicture
\draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text should be orange};
\stoptikzpicture
\par This a paragraph which gets the colour of the section for no reason.
\stopsection
\stopchapter
\startchapter[title={Colour test 2}, ref=colourtest]
\startsection[title={Another section }]
\par This a paragraph in the appropriate text color (green).
\starttikzpicture
\draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text is orange};
\stoptikzpicture
\stopsection
\stopchapter
\stoptext
___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
participants (3)
-
Henri Menke
-
Susanne G. Loeber
-
Taco Hoekwater