ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] TikZ \shade broken
@ 2023-06-17 17:28 Gavin via ntg-context
  2023-06-17 18:11 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Gavin via ntg-context @ 2023-06-17 17:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Gavin

Hi List,

First, a big thanks to Aditya for solving the missing pgfsys-luatex.def! That was a show-stopper on my Mac.

Now that I can use TikZ again, I am running into a problem with the \shade command. Below is a small working example from the TikZ manual [pp.39-41]. The first tikzpicture is the example. The second TikZ picture is similar, but without any shading.

\usemodule[tikz]
\starttext
\starttikzpicture  
\shade[top color=yellow,bottom color=black] (0,0) rectangle +(2,1);
\shade[left color=yellow,right color=black] (3,0) rectangle +(2,1);
\shadedraw[inner color=yellow,outer color=black,draw=yellow] (6,0) rectangle +(2,1);
\shade[ball color=green] (9,.5) circle (.5cm);
\stoptikzpicture
\starttikzpicture  
\draw[color=black] (0,0) rectangle +(2,1);
\fill[color=yellow] (3,0) rectangle +(2,1);
\filldraw[fill=black,draw =yellow] (6,0) rectangle +(2,1);
\fill[fill=green] (9,.5) circle (.5cm);
\stoptikzpicture
\stoptext
\stoptext

The second picture works. The first picture produces quite an error message (below). I’m using

ConTeXt  ver: 2023.06.01 09:42 LMTX  fmt: 2023.6.2

on an M1 Mac with Ventura 13.4

Any help would be greatly appreciated!

Gavin



tex error       > tex error on line 8 in file ./TikZtest.tex: Valid keyword expected, likely 'direction'

<macro> \pgfsys@vertshading 
#1#2#3->{\pgf@parsefunc {#3}\pgfmathparse {#2}\setbox \pgfutil@tempboxa =\hbox dir 
TLT to\pgfmathresult pt{\vbox to\pgf@max {\vfil \pgfsys@invoke {/Sh sh}}\hfil }\pgf@process {\pgfpoint {#2}{\pgf@max }}\immediate \saveboxresource resources {/Shading 
<argument> 
...dafter \expandafter \def \expandafter \expandafter \expandafter \@@args \expandafter \expandafter \expandafter {\csname pgf@args\pgf@shadingname \endcsname }\expandafter \expandafter \expandafter \@temp \expandafter \@args \@@args 
\expandafter  ...
<macro> \pgfutil@firstoftwo 
#1#2->#1
<argument> 
...r \expandafter \expandafter {\csname pgf@args\pgf@shadingname \endcsname }\expandafter \expandafter \expandafter \@temp \expandafter \@args \@@args \expandafter \pgfmath@smuggleone \csname \pgf@shadingxname \endcsname \endgroup }{}
\pgf@invokesh ...
<macro> \pgfutil@secondoftwo 
#1#2->#2
<macro> \pgfshadepath 
...e@cos }{0pt}{0pt}\pgfsys@transformcm {\pgf@sys@tonumber {\pgf@xc }}{0}{0}{\pgf@sys@tonumber {\pgf@yc }}{0pt}{0pt}\ifx \pgf@shade@extra@transform \pgfutil@empty \else \pgflowlevel {\pgf@shade@extra@transform }\fi \pgfuseshading {#1}
\pgfsys@endsc ...
...

<line 3.8> 
\shade[top color=yellow,bottom color=black] (0,0) rectangle +(2,1);

1     % !TEX useAlternatePath
2     % !TEX useConTeXtSyncParser
3     
4     \usemodule[tikz]
5     
6     \starttext
7       \starttikzpicture  
8 >>      \shade[top color=yellow,bottom color=black] (0,0) rectangle +(2,1);
9         \shade[left color=yellow,right color=black] (3,0) rectangle +(2,1);
10         \shadedraw[inner color=yellow,outer color=black,draw=yellow] (6,0) rectangle +(2,1);
11         \shade[ball color=green] (9,.5) circle (.5cm);
12       \stoptikzpicture
13       \starttikzpicture  
14         \draw[color=black] (0,0) rectangle +(2,1);
15         \fill[color=yellow] (3,0) rectangle +(2,1);
16         \filldraw[fill=black,draw =yellow] (6,0) rectangle +(2,1);
17         \fill[fill=green] (9,.5) circle (.5cm);
18       \stoptikzpicture
You started a keyword but it seems to be an invalid one. The first character(s)
might give you a clue. You might want to quit unwanted lookahead with \relax.
mtx-context     | fatal error: return code: 1

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [NTG-context] TikZ \shade broken
  2023-06-17 17:28 [NTG-context] TikZ \shade broken Gavin via ntg-context
@ 2023-06-17 18:11 ` Hans Hagen via ntg-context
  2023-06-19 11:57   ` Gavin via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen via ntg-context @ 2023-06-17 18:11 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 6/17/2023 7:28 PM, Gavin via ntg-context wrote:
> Hi List,
> 
> First, a big thanks to Aditya for solving the missing pgfsys-luatex.def! That was a show-stopper on my Mac.
> 
> Now that I can use TikZ again, I am running into a problem with the \shade command. Below is a small working example from the TikZ manual [pp.39-41]. The first tikzpicture is the example. The second TikZ picture is similar, but without any shading.
> 
> \usemodule[tikz]
> \starttext
> \starttikzpicture
> \shade[top color=yellow,bottom color=black] (0,0) rectangle +(2,1);
> \shade[left color=yellow,right color=black] (3,0) rectangle +(2,1);
> \shadedraw[inner color=yellow,outer color=black,draw=yellow] (6,0) rectangle +(2,1);
> \shade[ball color=green] (9,.5) circle (.5cm);
> \stoptikzpicture
> \starttikzpicture
> \draw[color=black] (0,0) rectangle +(2,1);
> \fill[color=yellow] (3,0) rectangle +(2,1);
> \filldraw[fill=black,draw =yellow] (6,0) rectangle +(2,1);
> \fill[fill=green] (9,.5) circle (.5cm);
> \stoptikzpicture
> \stoptext
> \stoptext
> 
> The second picture works. The first picture produces quite an error message (below). I’m using
> 
> ConTeXt  ver: 2023.06.01 09:42 LMTX  fmt: 2023.6.2
> 
> on an M1 Mac with Ventura 13.4
> 
> Any help would be greatly appreciated!
> 
> Gavin
> 
> 
> 
> tex error       > tex error on line 8 in file ./TikZtest.tex: Valid keyword expected, likely 'direction'
> 
> <macro> \pgfsys@vertshading
> #1#2#3->{\pgf@parsefunc {#3}\pgfmathparse {#2}\setbox \pgfutil@tempboxa =\hbox dir
> TLT to\pgfmathresult pt{\vbox to\pgf@max {\vfil \pgfsys@invoke {/Sh sh}}\hfil }\pgf@process {\pgfpoint {#2}{\pgf@max }}\immediate \saveboxresource resources {/Shading
luametatex doesn't have the dir keyword

(I could probably add it in a simplified form just for this purpose 
because the performance penalty is less now.)

Hans



-----------------------------------------------------------------
                                           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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [NTG-context] TikZ \shade broken
  2023-06-17 18:11 ` Hans Hagen via ntg-context
@ 2023-06-19 11:57   ` Gavin via ntg-context
  2023-06-26 12:26     ` Gavin via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Gavin via ntg-context @ 2023-06-19 11:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Gavin

Hi Hans,

>> I am running into a problem with the \shade command... 
>> tex error       > tex error on line 8 in file ./TikZtest.tex: Valid keyword expected, likely 'direction'
>> <macro> \pgfsys@vertshading
>> #1#2#3->{\pgf@parsefunc {#3}\pgfmathparse {#2}\setbox \pgfutil@tempboxa =\hbox dir
>> ...
> luametatex doesn't have the dir keyword
> 
> (I could probably add it in a simplified form just for this purpose because the performance penalty is less now.)

If you have a chance to add a dir keyword, that would be great. Since the keyword is used inside a TikZ macro, I don’t see any way I can work around it in my document.

I am gradually converting my diagrams from TikZ to MetaFun, but with well over a hundred diagrams in my current project, that’s going to take some time.

Thanks!
Gavin


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [NTG-context] TikZ \shade broken
  2023-06-19 11:57   ` Gavin via ntg-context
@ 2023-06-26 12:26     ` Gavin via ntg-context
  0 siblings, 0 replies; 4+ messages in thread
From: Gavin via ntg-context @ 2023-06-26 12:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Gavin

Fixed in the latest. Thanks Hans!

> On Jun 19, 2023, at 5:57 AM, Gavin via ntg-context <ntg-context@ntg.nl> wrote:
> 
> Hi Hans,
> 
>>> I am running into a problem with the \shade command... 
>>> tex error       > tex error on line 8 in file ./TikZtest.tex: Valid keyword expected, likely 'direction'
>>> <macro> \pgfsys@vertshading
>>> #1#2#3->{\pgf@parsefunc {#3}\pgfmathparse {#2}\setbox \pgfutil@tempboxa =\hbox dir
>>> ...
>> luametatex doesn't have the dir keyword
>> 
>> (I could probably add it in a simplified form just for this purpose because the performance penalty is less now.)
> 
> If you have a chance to add a dir keyword, that would be great. Since the keyword is used inside a TikZ macro, I don’t see any way I can work around it in my document.
> 
> I am gradually converting my diagrams from TikZ to MetaFun, but with well over a hundred diagrams in my current project, that’s going to take some time.
> 
> Thanks!
> Gavin
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : https://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-26 12:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-17 17:28 [NTG-context] TikZ \shade broken Gavin via ntg-context
2023-06-17 18:11 ` Hans Hagen via ntg-context
2023-06-19 11:57   ` Gavin via ntg-context
2023-06-26 12:26     ` Gavin via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).