On 12/6/2021 6:39 PM, Aditya Mahajan via ntg-context wrote:
On Mon, 6 Dec 2021, Aditya Mahajan via ntg-context wrote:
Something is still not working correctly though. With the simple example that Hans sent, I get error messages:
tex error > tex error on line 76 in file m-circuitikz.mkxl: Package pgfkeys Error: I do not know the key '/tikz/resistor', to which you passed 'american', and I am going to ignore it. Perhaps you misspelled it
which are weird because tikz is looking at keys tikz/resistor rather than tikz/circuittikz/resistor. But I don't understand why this is the case.
Here is a minimal example to show the error.
\usemodule[m][tikz]
\tikzinputfile{pgfcirc.defines.tex} \tikzinputfile{pgfcircbipoles.tex}
\starttext \bgroup \loggingall \ctikzset{resistor=american} \egroup \stoptext
which gives the error
tex error > tex error on line 10 in file ./t2.tex: Package pgfkeys Error: I do not know the key '/tikz/resistor', to which you passed 'american', and I am going to ignore it. Perhaps you misspelled it
different error here ... i need to load more files
The file pgfcirc.defines.tex has:
\def\circuitikzbasekey{/tikz/circuitikz} \pgfkeys{\circuitikzbasekey/.is family} \def\circuitikzset{\expandafter\pgfqkeys\expandafter{\circuitikzbasekey}} \let\ctikzset\circuitikzset
The file pgfcircbipoles.tex has the code:
\newif\ifpgf@circuit@europeanresistor \ctikzset{resistor/.is choice} \ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse } \ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue } \tikzset{american resistors/.style = {\circuitikzbasekey/resistor = american}} \tikzset{european resistors/.style = {\circuitikzbasekey/resistor = european}}%
So, the key which is defined is \circuitikzbasekey/resistor. Not sure why pgfkeys is searching for tikz/resistor.
don't worry ... i'm even less sure ... one needs a bit different mindset for that kind of tex code (all can be fixed i guess but when it's not context specific it makes more sense to let the maintainer do it) ths only difference wrt tikz between mkiv and mkxl is that we have different defaults wrt par handling (afaik both have the same catcode settings here) and i don't think tikz uses anything low level context
@Hans, does the above code work correctly for you? If so, then we can wait until the next upload and test again. with the attached:
\usemodule[m][circuitikz] \starttext \starttikzsettings % to be sure \ctikzset{resistor=american} \stoptikzsettings \stoptext that works (tons of files loaded) here but nothing graphic (for those whio try: make sure that the t-* variants are gone) i see it loading other t-* files so maybe we should more that code to the m-* files too ... easier to maintain that way .. and if we have a few (not too slow) test files in the test suite it's easier to see when / why something fails if it doesn't at your end we need to define 'how to install the right (circuit)tikz stuff' and 'from where' (btw, does it all work ok in mkiv? after all, that hasn't changed for a while) Hans 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 -----------------------------------------------------------------