ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Compatibility Issue with TikZ/Spy Library in ConTeXt: Seeking Solutions
@ 2023-11-24 10:17 wolfgangbackes--- via ntg-context
  2023-11-24 14:49 ` [NTG-context] " Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: wolfgangbackes--- via ntg-context @ 2023-11-24 10:17 UTC (permalink / raw)
  To: ntg-context; +Cc: wolfgangbackes

Hello,
I am reaching out to seek assistance regarding a compatibility issue I have encountered after installing ConTeXt on a new computer. The problem arises when attempting to compile documents that utilize the spy library; the LuaTeX engine returns the following error message:

"error (luacall): invalid number
mtx-context     | fatal error: return code: 1"

Unfortunately, the error message provides no additional clues. To investigate further, I created a minimal example, which you can easily verify at https://context-on-web.eu/. The example employs the spy library within a TikZ environment. Surprisingly, the same example runs without error on my local LaTeX engine, indicating a potential compatibility issue between ConTeXt and the spy library.

Here is the minimal example for your reference:

\starttext
\usemodule[tikz]
\usetikzlibrary {spy}
\starttikzpicture[spy using overlays={size=12mm}]
\draw (0,0) -- (1,1) -- (2,-1);
\spy [blue,magnification=5] on (1,1) in node at (3,0);
\stoptikzpicture
\stoptext

I am curious if anyone else has encountered a similar problem with the spy library and ConTeXt and, if so, if there is a known solution. Any insights or guidance would be greatly appreciated.

Thank you for your time and assistance.

Best regards,
Wolfgang Backes
___________________________________________________________________________________
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] 3+ messages in thread

* [NTG-context] Re: Compatibility Issue with TikZ/Spy Library in ConTeXt: Seeking Solutions
  2023-11-24 10:17 [NTG-context] Compatibility Issue with TikZ/Spy Library in ConTeXt: Seeking Solutions wolfgangbackes--- via ntg-context
@ 2023-11-24 14:49 ` Hans Hagen
  2023-11-24 16:52   ` wolfgangbackes--- via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2023-11-24 14:49 UTC (permalink / raw)
  To: wolfgangbackes--- via ntg-context

On 11/24/2023 11:17 AM, wolfgangbackes--- via ntg-context wrote:
> Hello,
> I am reaching out to seek assistance regarding a compatibility issue I have encountered after installing ConTeXt on a new computer. The problem arises when attempting to compile documents that utilize the spy library; the LuaTeX engine returns the following error message:
> 
> "error (luacall): invalid number
> mtx-context     | fatal error: return code: 1"
> 
> Unfortunately, the error message provides no additional clues. To investigate further, I created a minimal example, which you can easily verify at https://context-on-web.eu/. The example employs the spy library within a TikZ environment. Surprisingly, the same example runs without error on my local LaTeX engine, indicating a potential compatibility issue between ConTeXt and the spy library.
> 
> Here is the minimal example for your reference:
> 
> \starttext
> \usemodule[tikz]
> \usetikzlibrary {spy}
> \starttikzpicture[spy using overlays={size=12mm}]
> \draw (0,0) -- (1,1) -- (2,-1);
> \spy [blue,magnification=5] on (1,1) in node at (3,0);
> \stoptikzpicture
> \stoptext
> 
> I am curious if anyone else has encountered a similar problem with the spy library and ConTeXt and, if so, if there is a known solution. Any insights or guidance would be greatly appreciated.
> 
> Thank you for your time and assistance.
the log probably mentions some call lua issue .. tikz is somewhat hard 
to debug but in the end i figured out that it relates to the way it 
registers function where it assumes that it's the only pqackage in the 
tex universe

put this before you load tikz:

\ifdefined\pdfstrcmp\else

     \def\pdfstrcmp{\directlua{
         local a = token.scan_string()
         local b = token.scan_string()
         context((a < b and -1) or (a > b and 1) or 0)
     }}

\fi

i'll add more efficient ones to the tikz modules

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

* [NTG-context] Re: Compatibility Issue with TikZ/Spy Library in ConTeXt: Seeking Solutions
  2023-11-24 14:49 ` [NTG-context] " Hans Hagen
@ 2023-11-24 16:52   ` wolfgangbackes--- via ntg-context
  0 siblings, 0 replies; 3+ messages in thread
From: wolfgangbackes--- via ntg-context @ 2023-11-24 16:52 UTC (permalink / raw)
  To: ntg-context; +Cc: wolfgangbackes

Many thanks for this great magic powder. It works without a hitch. You have made my day!

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

end of thread, other threads:[~2023-11-24 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-24 10:17 [NTG-context] Compatibility Issue with TikZ/Spy Library in ConTeXt: Seeking Solutions wolfgangbackes--- via ntg-context
2023-11-24 14:49 ` [NTG-context] " Hans Hagen
2023-11-24 16:52   ` wolfgangbackes--- 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).