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
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to