ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] PDF, runner, and TikZ patches
       [not found] <5b3c436565692c3da7b76aa4666d9d0c22eeb46b.camel@telus.net>
@ 2024-03-14 23:18 ` Max Chernoff
  2024-03-14 23:53   ` [NTG-context] " Jim
  2024-03-15  8:38   ` Hans Hagen
  0 siblings, 2 replies; 13+ messages in thread
From: Max Chernoff @ 2024-03-14 23:18 UTC (permalink / raw)
  To: ntg-context

Hi all,

I've had a few patches applied to my installation for a little while
now, so I figured that I should send them in. There's a diff at the end
of the email, and the modified files are attached [but rejected by the
mailing list, so sent separately to Hans]

 * In the definition of "featurecreep()" in "lpdf-mis.lmt",
   "structures.pages.tobesaved[i].status" should be "[...].state" to
   match the definition of "pages.save" in "strc-pag.lua". 
   
 * For the "resultof" runner in "util-sbx.lmt", the current io.popen
   mode only works with Windows. See the definition of "l_checkmodep" in
   "liolib.c".
   
 * Some of the pgfplots 3D shaders appear to be broken,
   see https://tex.stackexchange.com/a/708121 .
   
 * The TikZ "RGB" colour model does not currently work properly. This is
   internally used by "\usepgfplotslibrary[colorbrewer]" among others.
   See https://github.com/pgf-tikz/pgf/pull/1130 .
   
Thanks,
-- Max


diff --git a/tex/generic/pgf/utilities/pgfutil-context.def b/tex/generic/pgf/utilities/pgfutil-context.def
index eddab09ab..66edb0980 100644
--- a/tex/generic/pgf/utilities/pgfutil-context.def
+++ b/tex/generic/pgf/utilities/pgfutil-context.def
@@ -26,8 +26,17 @@
 \def\pgfutil@definecolor#1#2#3{\csname pgfutil@emu@#2\endcsname{#1}#3\@nil}

 \def\pgfutil@emu@rgb#1#2,#3,#4\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#3,#4}}}
-\def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#2,#2}}}
+\def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{gray}{#2}}}
 \def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{cmyk}{#2,#3,#4,#5}}}
+\def\pgfutil@emu@RGB#1#2,#3,#4\@nil{%
+    \begingroup
+    \pgfmathdivide@{#2}{255}\let\pgfutil@emu@RGB@r\pgfmathresult
+    \pgfmathdivide@{#3}{255}\let\pgfutil@emu@RGB@g\pgfmathresult
+    \pgfmathdivide@{#4}{255}\let\pgfutil@emu@RGB@b\pgfmathresult
+    \edef\pgf@marshal{\def\expandafter\noexpand\csname\string\color@#1\endcsname{%
+        \noexpand\xcolor@{}{}{rgb}{\pgfutil@emu@RGB@r,\pgfutil@emu@RGB@g,\pgfutil@emu@RGB@b}}}%
+    \expandafter\endgroup\pgf@marshal
+}


 % no need for x colors (users can load it if needed)
diff --git a/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex b/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
index 60d6274..106c490 100644
--- a/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
+++ b/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
@@ -2804,6 +2804,9 @@
 \def\pgfplotsretval{4}%
 \fi
 \fi
+ \if0\pgfplotsretval
+ \def\pgfplotsretval{5}
+ \fi
 \pgfkeyslet{/pgfplots/surf shading/shading type}\pgfplotsretval%
 %
 \pgfplotsplothandlermesh@set@shader@colormap
diff --git a/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def b/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
index 0046daa..b563732 100644
--- a/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
+++ b/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
@@ -61,7 +61,7 @@
 \pgfplotslibrarysurfusepath
 \endpgfpicture
 }%
- \immediate\saveboxresource resources{
+ \saveboxresource resources{
 /Pattern << \pgfplots@glob@TMPa >> % write the pattern resource dictionary
 }\pgfutil@tempboxa
 \leavevmode
diff --git a/tex/context/base/mkxl/util-sbx.lmt b/tex/context/base/mkxl/util-sbx.lmt
index b48d4a9..0ee8a16 100644
--- a/tex/context/base/mkxl/util-sbx.lmt
+++ b/tex/context/base/mkxl/util-sbx.lmt
@@ -393,7 +393,7 @@ local runners = {
             if trace then
                 report("resultof: %s",command)
             end
-            local handle = iopopen(command,"rb") -- already has flush
+            local handle = iopopen(command,"r") -- already has flush
             if handle then
                 local result = handle:read("*all") or ""
                 handle:close()
diff --git a/tex/context/base/mkxl/lpdf-mis.lmt b/tex/context/base/mkxl/lpdf-mis.lmt
index 0f21cf9..a9cfe02 100644
--- a/tex/context/base/mkxl/lpdf-mis.lmt
+++ b/tex/context/base/mkxl/lpdf-mis.lmt
@@ -510,7 +510,7 @@ local function featurecreep()
             return -- fatal error
         end
         local label = p.viewerprefix or ""
-        if p.status == v_stop then
+        if p.state == v_stop then
             if not stopped then
                 list[#list+1] = i - 1 -- pdf starts numbering at 0
                 list[#list+1] = pdfdictionary {


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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-14 23:18 ` [NTG-context] PDF, runner, and TikZ patches Max Chernoff
@ 2024-03-14 23:53   ` Jim
  2024-03-15  0:53     ` Aditya Mahajan
  2024-03-15  8:44     ` Hans Hagen
  2024-03-15  8:38   ` Hans Hagen
  1 sibling, 2 replies; 13+ messages in thread
From: Jim @ 2024-03-14 23:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Max (et al),

were you hoping the ConTeXt distribution would ship its own
pgfutil-context.def, or were you hoping that someone could convince Henri
to put the RGB change in?

And, if anyone has the will to push this (or add it in to a ConTeXt
distribution version), I'd still like the cmyk support, even if there is no
ability to specify colour profiles:

\def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil
{
    \pgfmathsetmacro{\@red@}{(1 - #2) * (1 - #5)}%
    \pgfmathsetmacro{\@green@}{(1 - #3) * (1 - #5)}%
    \pgfmathsetmacro{\@blue@}{(1 - #4) * (1 - #5)}% 
    \expandafter\edef\csname\string\color@#1\endcsname
    {\noexpand\xcolor@ {}{}{rgb}{\@red@,\@green@,\@blue@}}
}

I don't see that it would hurt anything, even if it doesn't give complete
cmyk support.

Cheers.
                                Jim

On Thu, Mar 14, 2024 at 17:18 (-0600), Max Chernoff wrote:

> Hi all,

> I've had a few patches applied to my installation for a little while
> now, so I figured that I should send them in. There's a diff at the end
> of the email, and the modified files are attached [but rejected by the
> mailing list, so sent separately to Hans]

>  * In the definition of "featurecreep()" in "lpdf-mis.lmt",
>    "structures.pages.tobesaved[i].status" should be "[...].state" to
> match the definition of "pages.save" in "strc-pag.lua". 

>  * For the "resultof" runner in "util-sbx.lmt", the current io.popen
> mode only works with Windows. See the definition of "l_checkmodep" in
>    "liolib.c".

>  * Some of the pgfplots 3D shaders appear to be broken,
> see https://tex.stackexchange.com/a/708121 .

>  * The TikZ "RGB" colour model does not currently work properly. This is
> internally used by "\usepgfplotslibrary[colorbrewer]" among others.
> See https://github.com/pgf-tikz/pgf/pull/1130 .

> Thanks,
> -- Max


> diff --git a/tex/generic/pgf/utilities/pgfutil-context.def b/tex/generic/pgf/utilities/pgfutil-context.def
> index eddab09ab..66edb0980 100644
> --- a/tex/generic/pgf/utilities/pgfutil-context.def
> +++ b/tex/generic/pgf/utilities/pgfutil-context.def
> @@ -26,8 +26,17 @@
>  \def\pgfutil@definecolor#1#2#3{\csname pgfutil@emu@#2\endcsname{#1}#3\@nil}

>  \def\pgfutil@emu@rgb#1#2,#3,#4\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#3,#4}}}
> -\def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#2,#2}}}
> +\def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{gray}{#2}}}
>  \def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{cmyk}{#2,#3,#4,#5}}}
> +\def\pgfutil@emu@RGB#1#2,#3,#4\@nil{%
> +    \begingroup
> +    \pgfmathdivide@{#2}{255}\let\pgfutil@emu@RGB@r\pgfmathresult
> +    \pgfmathdivide@{#3}{255}\let\pgfutil@emu@RGB@g\pgfmathresult
> +    \pgfmathdivide@{#4}{255}\let\pgfutil@emu@RGB@b\pgfmathresult
> +    \edef\pgf@marshal{\def\expandafter\noexpand\csname\string\color@#1\endcsname{%
> +        \noexpand\xcolor@{}{}{rgb}{\pgfutil@emu@RGB@r,\pgfutil@emu@RGB@g,\pgfutil@emu@RGB@b}}}%
> +    \expandafter\endgroup\pgf@marshal
> +}


>  % no need for x colors (users can load it if needed)
> diff --git a/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex b/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
> index 60d6274..106c490 100644
> --- a/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
> +++ b/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
> @@ -2804,6 +2804,9 @@
>  \def\pgfplotsretval{4}%
>  \fi
>  \fi
> + \if0\pgfplotsretval
> + \def\pgfplotsretval{5}
> + \fi
>  \pgfkeyslet{/pgfplots/surf shading/shading type}\pgfplotsretval%
>  %
>  \pgfplotsplothandlermesh@set@shader@colormap
> diff --git a/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def b/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
> index 0046daa..b563732 100644
> --- a/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
> +++ b/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
> @@ -61,7 +61,7 @@
>  \pgfplotslibrarysurfusepath
>  \endpgfpicture
>  }%
> - \immediate\saveboxresource resources{
> + \saveboxresource resources{
>  /Pattern << \pgfplots@glob@TMPa >> % write the pattern resource dictionary
>  }\pgfutil@tempboxa
>  \leavevmode
> diff --git a/tex/context/base/mkxl/util-sbx.lmt b/tex/context/base/mkxl/util-sbx.lmt
> index b48d4a9..0ee8a16 100644
> --- a/tex/context/base/mkxl/util-sbx.lmt
> +++ b/tex/context/base/mkxl/util-sbx.lmt
> @@ -393,7 +393,7 @@ local runners = {
> if trace then
> report("resultof: %s",command)
> end
> -            local handle = iopopen(command,"rb") -- already has flush
> +            local handle = iopopen(command,"r") -- already has flush
> if handle then
> local result = handle:read("*all") or ""
> handle:close()
> diff --git a/tex/context/base/mkxl/lpdf-mis.lmt b/tex/context/base/mkxl/lpdf-mis.lmt
> index 0f21cf9..a9cfe02 100644
> --- a/tex/context/base/mkxl/lpdf-mis.lmt
> +++ b/tex/context/base/mkxl/lpdf-mis.lmt
> @@ -510,7 +510,7 @@ local function featurecreep()
> return -- fatal error
> end
> local label = p.viewerprefix or ""
> -        if p.status == v_stop then
> +        if p.state == v_stop then
> if not stopped then
> list[#list+1] = i - 1 -- pdf starts numbering at 0
> list[#list+1] = pdfdictionary {


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

> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-14 23:53   ` [NTG-context] " Jim
@ 2024-03-15  0:53     ` Aditya Mahajan
  2024-03-15  7:30       ` Max Chernoff
  2024-03-16 13:10       ` Jim
  2024-03-15  8:44     ` Hans Hagen
  1 sibling, 2 replies; 13+ messages in thread
From: Aditya Mahajan @ 2024-03-15  0:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 14 Mar 2024, Jim wrote:

> Max (et al),
> 
> were you hoping the ConTeXt distribution would ship its own
> pgfutil-context.def, or were you hoping that someone could convince Henri
> to put the RGB change in?

We can patch some of the definitions of pgfutil-context.def in m-tikz if really needed, but it would be preferable to first check if tikz maintainers are willing to merge them upstream. 

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-15  0:53     ` Aditya Mahajan
@ 2024-03-15  7:30       ` Max Chernoff
  2024-03-16 13:13         ` Jim
  2024-03-16 13:10       ` Jim
  1 sibling, 1 reply; 13+ messages in thread
From: Max Chernoff @ 2024-03-15  7:30 UTC (permalink / raw)
  To: ntg-context

Hi Aditya, Jim,

On Fri, 2024-03-15 at 01:53 +0100, Aditya Mahajan wrote:
> On Thu, 14 Mar 2024, Jim wrote:
> > were you hoping the ConTeXt distribution would ship its own
> > pgfutil-context.def, or were you hoping that someone could convince Henri
> > to put the RGB change in?
>
> We can patch some of the definitions of pgfutil-context.def in m-tikz
> if really needed, but it would be preferable to first check if tikz
> maintainers are willing to merge them upstream.

Ah, okay. I was under the impression that the LMTX standalone
distribution carried a ton of TikZ patches and that ConTeXt patches
weren't really merged upstream, but it sounds like there are only a
couple small patches and upstream does merge ConTeXt patches. I'll
rebase my PR and check with upstream again. Thanks!

On Thu, 2024-03-14 at 20:53 -0300, Jim wrote:
> were you hoping the ConTeXt distribution would ship its own
> pgfutil-context.def, or were you hoping that someone could convince Henri
> to put the RGB change in?

I've seen a few TikZ bugs/patches resolved on this list, and I know that
the LMTX standalone distribution carries patches for TikZ (although
fewer than I thought?), so this seemed like the right place to start.

> And, if anyone has the will to push this (or add it in to a ConTeXt
> distribution version), I'd still like the cmyk support, even if there is no
> ability to specify colour profiles:
>
> \def\pgfutil(a)emu@cmyk#1#2,#3,#4,#5\@nil
> {
>     \pgfmathsetmacro{\@red@}{(1 - #2) * (1 - #5)}%
>     \pgfmathsetmacro{\@green@}{(1 - #3) * (1 - #5)}%
>     \pgfmathsetmacro{\@blue@}{(1 - #4) * (1 - #5)}%
>     \expandafter\edef\csname\string\color@#1\endcsname
>     {\noexpand\xcolor@ {}{}{rgb}{\@red@,\@green@,\@blue@}}
> }
>
> I don't see that it would hurt anything, even if it doesn't give complete
> cmyk support.

I need to rebase my current PGF PR anyways, so I'll add this in with it.

Thanks,
-- Max

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-14 23:18 ` [NTG-context] PDF, runner, and TikZ patches Max Chernoff
  2024-03-14 23:53   ` [NTG-context] " Jim
@ 2024-03-15  8:38   ` Hans Hagen
  1 sibling, 0 replies; 13+ messages in thread
From: Hans Hagen @ 2024-03-15  8:38 UTC (permalink / raw)
  To: ntg-context

On 3/15/2024 12:18 AM, Max Chernoff wrote:
> Hi all,
> 
> I've had a few patches applied to my installation for a little while
> now, so I figured that I should send them in. There's a diff at the end
> of the email, and the modified files are attached [but rejected by the
> mailing list, so sent separately to Hans]
> 
>   * In the definition of "featurecreep()" in "lpdf-mis.lmt",
>     "structures.pages.tobesaved[i].status" should be "[...].state" to
>     match the definition of "pages.save" in "strc-pag.lua".

ok, changed, i assume you tested it

>   * For the "resultof" runner in "util-sbx.lmt", the current io.popen
>     mode only works with Windows. See the definition of "l_checkmodep" in
>     "liolib.c".

i trust you on that (never run piped on linux, only on windows)

>   * Some of the pgfplots 3D shaders appear to be broken,
>     see https://tex.stackexchange.com/a/708121 .
>     
>   * The TikZ "RGB" colour model does not currently work properly. This is
>     internally used by "\usepgfplotslibrary[colorbrewer]" among others.
>     See https://github.com/pgf-tikz/pgf/pull/1130 .

see mail by others

Thanks,

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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-14 23:53   ` [NTG-context] " Jim
  2024-03-15  0:53     ` Aditya Mahajan
@ 2024-03-15  8:44     ` Hans Hagen
  2024-03-16 13:21       ` Jim
  1 sibling, 1 reply; 13+ messages in thread
From: Hans Hagen @ 2024-03-15  8:44 UTC (permalink / raw)
  To: ntg-context

On 3/15/2024 12:53 AM, Jim wrote:
> Max (et al),
> 
> were you hoping the ConTeXt distribution would ship its own
> pgfutil-context.def, or were you hoping that someone could convince Henri
> to put the RGB change in?
> 
> And, if anyone has the will to push this (or add it in to a ConTeXt
> distribution version), I'd still like the cmyk support, even if there is no
> ability to specify colour profiles:
> 
> \def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil
> {
>      \pgfmathsetmacro{\@red@}{(1 - #2) * (1 - #5)}%
>      \pgfmathsetmacro{\@green@}{(1 - #3) * (1 - #5)}%
>      \pgfmathsetmacro{\@blue@}{(1 - #4) * (1 - #5)}%
>      \expandafter\edef\csname\string\color@#1\endcsname
>      {\noexpand\xcolor@ {}{}{rgb}{\@red@,\@green@,\@blue@}}
> }
> 
> I don't see that it would hurt anything, even if it doesn't give complete
> cmyk support.
We provide

\pgf@context@registercolor
\pgf@context@registergray
\pgf@context@registerrgb
\pgf@context@registercmyk

in colo-ini that hook into the context color mechanism so be careful 
with patches. I'm not going to spend time on other solutions that can 
interfere with internals.

(I wonder when the moment comes that we have to take a snapshot of tikz 
and stay with that.)

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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-15  0:53     ` Aditya Mahajan
  2024-03-15  7:30       ` Max Chernoff
@ 2024-03-16 13:10       ` Jim
  2024-03-16 14:20         ` Hans Hagen
  1 sibling, 1 reply; 13+ messages in thread
From: Jim @ 2024-03-16 13:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Mar 15, 2024 at 01:53 (+0100), Aditya Mahajan wrote:

> On Thu, 14 Mar 2024, Jim wrote:

>> Max (et al),

>> were you hoping the ConTeXt distribution would ship its own
>> pgfutil-context.def, or were you hoping that someone could convince Henri
>> to put the RGB change in?

> We can patch some of the definitions of pgfutil-context.def in m-tikz if
> really needed, but it would be preferable to first check if tikz
> maintainers are willing to merge them upstream.

Unfortunately, it seems that the maintainer feels that if we can't deal
with cmyk profiles, we shouldn't have cmyk at all.  I don't agree, but
that's where it ended.  (I was arguing for plain TeX support at the time in
the linked^2 message, but I was able to add the definition for cmyk to my
own macro file, so I was able to process examples with cmyk colours.)

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-15  7:30       ` Max Chernoff
@ 2024-03-16 13:13         ` Jim
  0 siblings, 0 replies; 13+ messages in thread
From: Jim @ 2024-03-16 13:13 UTC (permalink / raw)
  To: ntg-context

Hi Max,

On Fri, Mar 15, 2024 at 01:30 (-0600), Max Chernoff wrote:

> Hi Aditya, Jim,

> On Fri, 2024-03-15 at 01:53 +0100, Aditya Mahajan wrote:
>> On Thu, 14 Mar 2024, Jim wrote:
>>> were you hoping the ConTeXt distribution would ship its own
>>> pgfutil-context.def, or were you hoping that someone could convince Henri
>>> to put the RGB change in?

>> We can patch some of the definitions of pgfutil-context.def in m-tikz
>> if really needed, but it would be preferable to first check if tikz
>> maintainers are willing to merge them upstream.

> Ah, okay. I was under the impression that the LMTX standalone
> distribution carried a ton of TikZ patches and that ConTeXt patches
> weren't really merged upstream, but it sounds like there are only a
> couple small patches and upstream does merge ConTeXt patches. I'll
> rebase my PR and check with upstream again. Thanks!

I hope your patches go through.

> On Thu, 2024-03-14 at 20:53 -0300, Jim wrote:
>> were you hoping the ConTeXt distribution would ship its own
>> pgfutil-context.def, or were you hoping that someone could convince Henri
>> to put the RGB change in?

> I've seen a few TikZ bugs/patches resolved on this list, and I know that
> the LMTX standalone distribution carries patches for TikZ (although
> fewer than I thought?), so this seemed like the right place to start.

>> And, if anyone has the will to push this (or add it in to a ConTeXt
>> distribution version), I'd still like the cmyk support, even if there is no
>> ability to specify colour profiles:

>> \def\pgfutil(a)emu@cmyk#1#2,#3,#4,#5\@nil
>> {
>>     \pgfmathsetmacro{\@red@}{(1 - #2) * (1 - #5)}%
>>     \pgfmathsetmacro{\@green@}{(1 - #3) * (1 - #5)}%
>>     \pgfmathsetmacro{\@blue@}{(1 - #4) * (1 - #5)}%
>>     \expandafter\edef\csname\string\color@#1\endcsname
>>     {\noexpand\xcolor@ {}{}{rgb}{\@red@,\@green@,\@blue@}}
>> }

>> I don't see that it would hurt anything, even if it doesn't give complete
>> cmyk support.

> I need to rebase my current PGF PR anyways, so I'll add this in with it.

Thanks, I appreciate it.  Maybe since there are now two people known to be
looking for basic cmyk support, Henri will cast a more accepting eye on the
request.  :-)

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-15  8:44     ` Hans Hagen
@ 2024-03-16 13:21       ` Jim
  2024-03-16 14:49         ` Hans Hagen
  0 siblings, 1 reply; 13+ messages in thread
From: Jim @ 2024-03-16 13:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Mar 15, 2024 at 09:44 (+0100), Hans Hagen wrote:

> On 3/15/2024 12:53 AM, Jim wrote:
>> Max (et al),

>> were you hoping the ConTeXt distribution would ship its own
>> pgfutil-context.def, or were you hoping that someone could convince Henri
>> to put the RGB change in?

>> And, if anyone has the will to push this (or add it in to a ConTeXt
>> distribution version), I'd still like the cmyk support, even if there is no
>> ability to specify colour profiles:

>> \def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil
>> {
>>      \pgfmathsetmacro{\@red@}{(1 - #2) * (1 - #5)}%
>>      \pgfmathsetmacro{\@green@}{(1 - #3) * (1 - #5)}%
>>      \pgfmathsetmacro{\@blue@}{(1 - #4) * (1 - #5)}%
>>      \expandafter\edef\csname\string\color@#1\endcsname
>>      {\noexpand\xcolor@ {}{}{rgb}{\@red@,\@green@,\@blue@}}
>> }

>> I don't see that it would hurt anything, even if it doesn't give complete
>> cmyk support.

> We provide

> \pgf@context@registercolor
> \pgf@context@registergray
> \pgf@context@registerrgb
> \pgf@context@registercmyk

> in colo-ini that hook into the context color mechanism so be careful with
> patches.  I'm not going to spend time on other solutions that can interfere
> with internals.

Thanks Hans, I was not familiar with those.  The above code worked fine for
me in plain TeX (the last time I used it, anyway).

By the looks of things, Max has a vastly better idea of ConTeXt internals
than I do, and if his proposed \pgfutil@emu@rgb doesn't break anything, it
might give some confidence that the above \pgfutil@emu#cmyk won't either.
(Yeah, I know, that is hardly a robust argument of anything.)

> (I wonder when the moment comes that we have to take a snapshot of tikz and
> stay with that.)

I hope that time doesn't come, because either someone (you? :-) would be
left with an on-going job of patching the snapshot, or ConTeXt's version of
tikz would become increasingly different (and, presumably, increasingly
less capable than the "mainline" version).

Cheers.

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-16 13:10       ` Jim
@ 2024-03-16 14:20         ` Hans Hagen
  2024-03-18  0:31           ` Jim
  0 siblings, 1 reply; 13+ messages in thread
From: Hans Hagen @ 2024-03-16 14:20 UTC (permalink / raw)
  To: Jim, mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 2069 bytes --]

On 3/16/2024 2:10 PM, Jim wrote:
> On Fri, Mar 15, 2024 at 01:53 (+0100), Aditya Mahajan wrote:
> 
>> On Thu, 14 Mar 2024, Jim wrote:
> 
>>> Max (et al),
> 
>>> were you hoping the ConTeXt distribution would ship its own
>>> pgfutil-context.def, or were you hoping that someone could convince Henri
>>> to put the RGB change in?
> 
>> We can patch some of the definitions of pgfutil-context.def in m-tikz if
>> really needed, but it would be preferable to first check if tikz
>> maintainers are willing to merge them upstream.
> 
> Unfortunately, it seems that the maintainer feels that if we can't deal
> with cmyk profiles, we shouldn't have cmyk at all.  I don't agree, but
> that's where it ended.  (I was arguing for plain TeX support at the time in
> the linked^2 message, but I was able to add the definition for cmyk to my
> own macro file, so I was able to process examples with cmyk colours.)
What does the maintainer mean by that ... context can add profiles if 
configured to do so (best not to embed them) ... and why should there be 
a profile anyway ... crappy arguments .. especially because when i run

\usemodule[tikz]

\startTEXpage

\definecolor [colorone] [r=0,g=0,b=0.5]
\definecolor [colortwo] [c=0,m=1]

\starttikzpicture
     \fill [colorone] (0,0) circle(2) ; % rgb
     \fill [colortwo] (0,0) circle(1) ; % cmyk
\stoptikzpicture
\setupcolors[cmyk=no]
\starttikzpicture
     \fill [colorone] (0,0) circle(2) ; % rgb
     \fill [colortwo] (0,0) circle(1) ; % rgb
\stoptikzpicture

\stopTEXpage

here i get a pdf file with rgb and cmyk. Maybe I have an old tikz and 
something changed (wouldn't be the first time). So let's forget about 
maintainers and ugly hacks, and identify what is the real problem.

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

[-- Attachment #2: oeps.pdf --]
[-- Type: application/pdf, Size: 3156 bytes --]

[-- Attachment #3: Type: text/plain, Size: 511 bytes --]

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-16 13:21       ` Jim
@ 2024-03-16 14:49         ` Hans Hagen
  0 siblings, 0 replies; 13+ messages in thread
From: Hans Hagen @ 2024-03-16 14:49 UTC (permalink / raw)
  To: ntg-context

On 3/16/2024 2:21 PM, Jim wrote:

> I hope that time doesn't come, because either someone (you? :-) would be

not me as i don't need tikz and so i wouldn't notice what functionality 
got adapted

> left with an on-going job of patching the snapshot, or ConTeXt's version of
> tikz would become increasingly different (and, presumably, increasingly
> less capable than the "mainline" version).
i guess it depends on what gets added .. maybe a bit of diffing to see 
if changes affect something or not before upgrading

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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-16 14:20         ` Hans Hagen
@ 2024-03-18  0:31           ` Jim
  2024-03-18  8:23             ` Hans Hagen
  0 siblings, 1 reply; 13+ messages in thread
From: Jim @ 2024-03-18  0:31 UTC (permalink / raw)
  To: Hans Hagen, ntg-context; +Cc: mailing list for ConTeXt users

On Sat, Mar 16, 2024 at 15:20 (+0100), Hans Hagen wrote:

> On 3/16/2024 2:10 PM, Jim wrote:
>> On Fri, Mar 15, 2024 at 01:53 (+0100), Aditya Mahajan wrote:

>>> On Thu, 14 Mar 2024, Jim wrote:

>>> > Max (et al),

>>> > were you hoping the ConTeXt distribution would ship its own
>>> > pgfutil-context.def, or were you hoping that someone could convince Henri
>>> > to put the RGB change in?

>>> We can patch some of the definitions of pgfutil-context.def in m-tikz if
>>> really needed, but it would be preferable to first check if tikz
>>> maintainers are willing to merge them upstream.

>> Unfortunately, it seems that the maintainer feels that if we can't deal
>> with cmyk profiles, we shouldn't have cmyk at all.  I don't agree, but
>> that's where it ended.  (I was arguing for plain TeX support at the time in
>> the linked^2 message, but I was able to add the definition for cmyk to my
>> own macro file, so I was able to process examples with cmyk colours.)
> What does the maintainer mean by that ... context

The maintainer's comment was about plain TeX, not context.  Sorry if that
wasn't clear.

In any case, I should have sent my request to Max alone, rather than the
ntg-context list, because if Max was going to push something there, I was
hoping that a second appeal for cmyk colour support in plain would be
nice.  (I'm not quite ready to give up all of my plain TeX files.)

> can add profiles if configured to do so (best not to embed them) ... and
> why should there be a profile anyway ... crappy arguments ..

I agree about the colour profile, but the last time I poked that bear, my
pleas fell on deaf ears.

[And in summary, to be clear: I'm good with the colour support in ConTeXt!]

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: PDF, runner, and TikZ patches
  2024-03-18  0:31           ` Jim
@ 2024-03-18  8:23             ` Hans Hagen
  0 siblings, 0 replies; 13+ messages in thread
From: Hans Hagen @ 2024-03-18  8:23 UTC (permalink / raw)
  To: Jim, ntg-context

On 3/18/2024 1:31 AM, Jim wrote:
> On Sat, Mar 16, 2024 at 15:20 (+0100), Hans Hagen wrote:
> 
>> On 3/16/2024 2:10 PM, Jim wrote:
>>> On Fri, Mar 15, 2024 at 01:53 (+0100), Aditya Mahajan wrote:
> 
>>>> On Thu, 14 Mar 2024, Jim wrote:
> 
>>>>> Max (et al),
> 
>>>>> were you hoping the ConTeXt distribution would ship its own
>>>>> pgfutil-context.def, or were you hoping that someone could convince Henri
>>>>> to put the RGB change in?
> 
>>>> We can patch some of the definitions of pgfutil-context.def in m-tikz if
>>>> really needed, but it would be preferable to first check if tikz
>>>> maintainers are willing to merge them upstream.
> 
>>> Unfortunately, it seems that the maintainer feels that if we can't deal
>>> with cmyk profiles, we shouldn't have cmyk at all.  I don't agree, but
>>> that's where it ended.  (I was arguing for plain TeX support at the time in
>>> the linked^2 message, but I was able to add the definition for cmyk to my
>>> own macro file, so I was able to process examples with cmyk colours.)
>> What does the maintainer mean by that ... context
> 
> The maintainer's comment was about plain TeX, not context.  Sorry if that
> wasn't clear.

ah, good to know

> In any case, I should have sent my request to Max alone, rather than the
> ntg-context list, because if Max was going to push something there, I was
> hoping that a second appeal for cmyk colour support in plain would be
> nice.  (I'm not quite ready to give up all of my plain TeX files.)

if it's plain, indeed, too confusing otherwise (it's no problem asking 
plain questions here but in this tikz case kind of confusing)

>> can add profiles if configured to do so (best not to embed them) ... and
>> why should there be a profile anyway ... crappy arguments ..
> 
> I agree about the colour profile, but the last time I poked that bear, my
> pleas fell on deaf ears.

not even plain needs color profiles and i hope tikz doesn't add them

> [And in summary, to be clear: I'm good with the colour support in ConTeXt!]
ok

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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-03-18  8:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <5b3c436565692c3da7b76aa4666d9d0c22eeb46b.camel@telus.net>
2024-03-14 23:18 ` [NTG-context] PDF, runner, and TikZ patches Max Chernoff
2024-03-14 23:53   ` [NTG-context] " Jim
2024-03-15  0:53     ` Aditya Mahajan
2024-03-15  7:30       ` Max Chernoff
2024-03-16 13:13         ` Jim
2024-03-16 13:10       ` Jim
2024-03-16 14:20         ` Hans Hagen
2024-03-18  0:31           ` Jim
2024-03-18  8:23             ` Hans Hagen
2024-03-15  8:44     ` Hans Hagen
2024-03-16 13:21       ` Jim
2024-03-16 14:49         ` Hans Hagen
2024-03-15  8:38   ` Hans Hagen

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).