ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* LMTX incompatibility in \meaning breaks TikZ, other minor issues
@ 2022-09-22 12:23 Leah Neukirchen via ntg-context
  2022-09-22 17:40 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Leah Neukirchen via ntg-context @ 2022-09-22 12:23 UTC (permalink / raw)
  To: ntg-context; +Cc: Leah Neukirchen

Hi,

I'm trying to get tikz-cd to run on LMTX and some examples already
work fine, but I had a problem with text on arrows.

To reproduce:

\usemodule[tikz]
\usetikzlibrary[cd]

\starttext
\starttikzcd
A \arrow{r}{A} \NC B \NR
\stoptikzcd
\stoptext

This builds fine on MkIV from TeXLive 2022 with LuaTeX, but on LMTX I get:

system          > ConTeXt  ver: 2022.09.11 20:44 LMTX  fmt: 2022.9.20  int: english/english
...
close source    > level 2, order 63, name 'tikzlibrarycd.code.tex'
fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
tex error       > tex error on line 8 in file ./tik.tex: Package pgfkeys Error: I do not know the key '/tikz/"{A}"{}' and I am going to ignore it. Perhaps you misspelled it.^^J...^^Jl.7 I think the culprit is a tikzcd arrow in cell 1-1

After a bunch of debugging, it turns out that LMTX breaks the TikZ 'quotes'
library, which works using code ala:

\def\tikz@enable@node@quotes{%
  \pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@quote@parser}%
  \let\tikz@quotes@as\tikz@node@quotes@as%
}

The last part of the /-key is derived from \meaning, but in LMTX,
\meaning" is "the character U+0022 'quotation mark'"
and thus the key cannot be found.

I have patched TikZ for now to match for this alternate string too.

But perhaps it would be better for compatibility to agree with the
original TeX \meaning strings for the 7-bit ASCII subset at least.


I found another minor nit that's not really triggering a bug but still a
difference to LuaTeX: \eTeXrevision should expand to .2, but it
expands to 2 in MkIX.  There is some code out there which uses
constructions like
\number\eTeXversion\eTeXrevision
or even
\ifdim 0\XeTeXrevision pt > 0.9996pt

As LMTX doesn't care about this macro, this should be easy to adjust.


Thanks,
-- 
Leah Neukirchen  <leah@vuxu.org>  https://leahneukirchen.org/
___________________________________________________________________________________
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] 3+ messages in thread

* Re: LMTX incompatibility in \meaning breaks TikZ, other minor issues
  2022-09-22 12:23 LMTX incompatibility in \meaning breaks TikZ, other minor issues Leah Neukirchen via ntg-context
@ 2022-09-22 17:40 ` Hans Hagen via ntg-context
  2022-09-28 22:29   ` Leah Neukirchen via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen via ntg-context @ 2022-09-22 17:40 UTC (permalink / raw)
  To: Leah Neukirchen via ntg-context; +Cc: Hans Hagen

On 9/22/2022 2:23 PM, Leah Neukirchen via ntg-context wrote:
> Hi,
> 
> I'm trying to get tikz-cd to run on LMTX and some examples already
> work fine, but I had a problem with text on arrows.
> 
> To reproduce:
> 
> \usemodule[tikz]
> \usetikzlibrary[cd]
> 
> \starttext
> \starttikzcd
> A \arrow{r}{A} \NC B \NR
> \stoptikzcd
> \stoptext
> 
> This builds fine on MkIV from TeXLive 2022 with LuaTeX, but on LMTX I get:
> 
> system          > ConTeXt  ver: 2022.09.11 20:44 LMTX  fmt: 2022.9.20  int: english/english
> ...
> close source    > level 2, order 63, name 'tikzlibrarycd.code.tex'
> fonts           > preloading latin modern fonts (second stage)
> fonts           > 'fallback modern-designsize rm 12pt' is loaded
> tex error       > tex error on line 8 in file ./tik.tex: Package pgfkeys Error: I do not know the key '/tikz/"{A}"{}' and I am going to ignore it. Perhaps you misspelled it.^^J...^^Jl.7 I think the culprit is a tikzcd arrow in cell 1-1
> 
> After a bunch of debugging, it turns out that LMTX breaks the TikZ 'quotes'
> library, which works using code ala:
> 
> \def\tikz@enable@node@quotes{%
>    \pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@quote@parser}%
>    \let\tikz@quotes@as\tikz@node@quotes@as%
> }
> 
> The last part of the /-key is derived from \meaning, but in LMTX,
> \meaning" is "the character U+0022 'quotation mark'"
> and thus the key cannot be found.
> 
> I have patched TikZ for now to match for this alternate string too.

a bit weird way to test a key .. maybe you can compare to

\edef\ThatQuote{\meaning/}

using \ifx

> But perhaps it would be better for compatibility to agree with the
> original TeX \meaning strings for the 7-bit ASCII subset at least. 

too messy when want to parse

> I found another minor nit that's not really triggering a bug but still a
> difference to LuaTeX: \eTeXrevision should expand to .2, but it
> expands to 2 in MkIX.  There is some code out there which uses
> constructions like
> \number\eTeXversion\eTeXrevision
> or even
> \ifdim 0\XeTeXrevision pt > 0.9996pt
> 
> As LMTX doesn't care about this macro, this should be easy to adjust.
i'll add the period; btw afaikt testing for an etex version is useless 
because all used engines have it and there is basically only one version 
and there will be no follow ups

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] 3+ messages in thread

* Re: LMTX incompatibility in \meaning breaks TikZ, other minor issues
  2022-09-22 17:40 ` Hans Hagen via ntg-context
@ 2022-09-28 22:29   ` Leah Neukirchen via ntg-context
  0 siblings, 0 replies; 3+ messages in thread
From: Leah Neukirchen via ntg-context @ 2022-09-28 22:29 UTC (permalink / raw)
  To: ntg-context; +Cc: Leah Neukirchen

Hans Hagen via ntg-context <ntg-context@ntg.nl> writes:

>> After a bunch of debugging, it turns out that LMTX breaks the TikZ
>> 'quotes'
>> library, which works using code ala:
>> \def\tikz@enable@node@quotes{%
>>    \pgfkeyssetvalue{/handlers/first char syntax/the character
>> "}{\tikz@quote@parser}%
>>    \let\tikz@quotes@as\tikz@node@quotes@as%
>> }
>> The last part of the /-key is derived from \meaning, but in LMTX,
>> \meaning" is "the character U+0022 'quotation mark'"
>> and thus the key cannot be found.
>> I have patched TikZ for now to match for this alternate string too.
>
> a bit weird way to test a key .. maybe you can compare to
>
> \edef\ThatQuote{\meaning/}
>
> using \ifx
>
>> But perhaps it would be better for compatibility to agree with the
>> original TeX \meaning strings for the 7-bit ASCII subset at least. 
>
> too messy when want to parse

To follow up on this: I have upstreamed patches to tikz and tikz-cd to
use the dynamic output of \meaning instead of hardcoding.

I'm not sure who maintains the t-tikz module, but if it gets updated
at some point the fix should be in.

-- 
Leah Neukirchen  <leah@vuxu.org>  https://leahneukirchen.org/
___________________________________________________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2022-09-28 22:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 12:23 LMTX incompatibility in \meaning breaks TikZ, other minor issues Leah Neukirchen via ntg-context
2022-09-22 17:40 ` Hans Hagen via ntg-context
2022-09-28 22:29   ` Leah Neukirchen 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).