[NTG-context] TikZ and wrong drawing order

Mojca Miklavec mojca.miklavec.lists at gmail.com
Sun Jun 14 23:09:18 CEST 2015


On Thu, Jun 11, 2015 at 11:26 PM, Hans Hagen wrote:
>>> On Thu, 11 Jun 2015, Mojca Miklavec wrote:
>>>
>>>> Hi,
>>>>
>>>> I would like to ask for help for either finding a fix or some clever
>>>> workaround for the following problem.
>>>>
>>>> If I use a TikZ picture as item symbol and additionally use background
>>>> text, then the first symbol in itemize environment gets covered by the
>>>> background. Here's an example:
>>>>
>>>> \usemodule
>>>>     [tikz]
>>>>
>>>> \definesymbol[1]
>>>>     [{\tikz\shade[shading=ball,ball color=blue] (0,0) circle (.2cm);}]
>>>>
>>>> \definecolor
>>>>     [backcol]
>>>>     [s=1,a=1,t=0.1]
>>>>
>>>> \starttext
>>>>
>>>> \startframedtext[width=4cm,background=color,backgroundcolor=backcol]
>>>> \startitemize
>>>> \item one
>>>> \item two
>>>> \item three
>>>> \stopitemize
>>>> \stopframedtext
>>>>
>>>> \stoptext
>
> i suppose that tikz puts some pdf code in the output stream and this is
> likely to interfere with the way context deals with colors
>
> a solution is:
>
> {\red x\dontleavehmode\forcecolorhack\tikz\fill[color=blue] (0,0) circle
> (.2cm);x}
>
> the
>
> \forcecolorhack
>
> is, well, a hack that fools the optimizer and \dontleavehmode is needed to
> get tex in the right mode

Thank you very much. Using the following worked fine as a workaround.

\definesymbol[1]
    [{\dontleavehmode\forcecolorhack\tikz\shade[shading=ball,ball
color=blue] (0,0) circle (.2cm);}]

Meanwhile I filed a ticket to the pgf's bug tracker to help us
remember specifics about the problem.

Mojca


More information about the ntg-context mailing list