circuitikz module seems broken
Dear List! I’ve been struggeling with the circuitikz module since my upgrade to LMTX. The following test of installation failed, running file circuitikz-context.tex in ../modules/t-tikz/ directory % Copyright 2018-2021 by Romano Giannetti % Copyright 2015-2021 by Stefan Lindner % Copyright 2013-2021 by Stefan Erhardt % Copyright 2007-2021 by Massimo Redaelli % % This file may be distributed and/or modified % % 1. under the LaTeX Project Public License and/or % 2. under the GNU Public License. % % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details. \usemodule[circuitikz] \starttext A simple example to test the installation. \startcircuitikz[scale=1.2] \draw (0,2) to[I=1\milli\ampere] (2,2) to[R, l_=2\kilo\ohm, *-*] (0,0) to[R, l_=2\kilo\ohm] (2,0) to[V, v_=2\volt] (2,2) to[cspst, l=$t_0$] (4,2) -- (4,1.5) to [generic, i=$i_1$, v=$v_1$] (4,-.5) -- (4,-1.5) (0,2) -- (0,-1.5) to[V, v_=4\volt] (2,-1.5) to [R, l=1\kilo\ohm] (4,-1.5) (5,2) node[dipchip, anchor=pin 1]{} (5,-2) node[flipflop JK, anchor=pin 1]{}; \stopcircuitikz \stoptext with this error message pgfcircutils.tex|103 error| Undefined control sequence \undefined Below is a snippet from pgfcircutils.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% subcircuits (experimental) %% %% introduced by Romano Giannetti around April 2021 %% changes suggested by Jonathan P. Spratte %% \newbox\ctikz@scratchbox \pgfutil@protected\def\ctikzsubcircuitdef#1#2#3{% \expandafter\gdef\csname #1@Anchor\endcsname{}% \expandafter\gdef\csname #1@setanchors\endcsname{% \setbox\ctikz@scratchbox=\hbox{% \begin{circuitikz} \draw (0,0) \csname#1\endcsname{T-#1}{}; \foreach [count=\i] \anchor in {#2} % reference anchor is -center \draw (0,{2-\i/2}) let \p1 = ($(T-#1-subckt@reference)-(T-#1-\anchor)$) in node[right]{\anchor: \x1,\y1 \expandafter\xdef\csname #1@Anchor\anchor\endcsname{++(\x1,\y1)}}; \end{circuitikz}% }% }% \expandafter\gdef\csname#1\endcsname##1##2{% \csname #1@Anchor##2\endcsname coordinate(##1-subckt@reference)#3% }% } \long\def\ctikzsubcircuitactivate#1{\csname #1@setanchors\endcsname} My installation info: context --version mtx-context | ConTeXt Process Management 1.04 mtx-context | mtx-context | main context file: /Users/jan-erikhagglof/context/context-osx-64/tex/texmf-context/tex/context/base/mkiv/context.mkiv mtx-context | current version: 2021.10.28 10:19 mtx-context | main context file: /Users/jan-erikhagglof/context/context-osx-64/tex/texmf-context/tex/context/base/mkxl/context.mkxl mtx-context | current version: 2021.10.28 10:19 Because of my lack of knowledge in this matter, I have no idea what is wrong here. Many thanks in advance Jan-Erik Hägglöf
On 12/3/2021 8:54 AM, Jan-Erik Hägglöf via ntg-context wrote:
Dear List!
I’ve been struggeling with the circuitikz module since my upgrade to LMTX.
The following test of installation failed, running file
circuitikz-context.tex in ../modules/t-tikz/ directory
% Copyright 2018-2021 by Romano Giannetti % Copyright 2015-2021 by Stefan Lindner % Copyright 2013-2021 by Stefan Erhardt % Copyright 2007-2021 by Massimo Redaelli % % This file may be distributed and/or modified % % 1. under the LaTeX Project Public License and/or % 2. under the GNU Public License. % % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
\usemodule[circuitikz]
\starttext
A simple example to test the installation.
\startcircuitikz[scale=1.2] \draw (0,2) to[I=1\milli\ampere] (2,2) to[R, l_=2\kilo\ohm, *-*] (0,0) to[R, l_=2\kilo\ohm] (2,0) to[V, v_=2\volt] (2,2) to[cspst, l=$t_0$] (4,2) -- (4,1.5) to [generic, i=$i_1$, v=$v_1$] (4,-.5) -- (4,-1.5) (0,2) -- (0,-1.5) to[V, v_=4\volt] (2,-1.5) to [R, l=1\kilo\ohm] (4,-1.5) (5,2) node[dipchip, anchor=pin 1]{} (5,-2) node[flipflop JK, anchor=pin 1]{};
\stopcircuitikz
\stoptext
with this error message
pgfcircutils.tex|103 error| Undefined control sequence \undefined i get
tex error > tex error on line 19 in file ./x.tex: Package tikz Error: Giving up on this path. Did you forget a semicolon? so i suppose i have a different version (i admit that i never use tikz so i'm not even sure what to install) so i updated both tikz and your module and get fonts > 'fallback modern-designsize rm 12pt' is loaded tex error > tex error on line 24 in file ./x.tex: Package tikz Error: Giving up on this path. Did you forget a semicolon? I get something with: \pushcatcodetable \setcatcodetable\texcatcodes \startcircuitikz[scale=1.2] \draw (0,2) % to[I=1] (2,2) to[R, l_=2, *-*] (0,0) to[R, l_=2] (2,0) % to[V, v_=2] (2,2) to[cspst, l=$t_0$] (4,2) -- (4,1.5) % to [generic, i=$i_1$, v=$v_1$] (4,-.5) -- (4,-1.5) (0,2) -- (0,-1.5) % to[V, v_=4] (2,-1.5) to [R, l=1] (4,-1.5) -- (5,2) node[dipchip, anchor=pin 1]{} (5,-2) node[flipflop JK, anchor=pin 1]{} ; \stopcircuitikz \popcatcodetable and leave the rest to others to figure out .. maybe some catcode issues 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 -----------------------------------------------------------------
On 12/3/2021 10:49 AM, Hans Hagen via ntg-context wrote:
I’ve been struggeling with the circuitikz module since my upgrade to LMTX. btw, We can have more 'catches' in the loader (t) module if needed. In any case, also check if things work with mkiv. That version has hardly been touched the last few years (and basically is frozen, apart from bug fixes) so if it doesn't work there it might be an indication of something in tikz or circuit.
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 -----------------------------------------------------------------
My thougts on this, if it is a possible alternative, to do such things in metafun instead?By the way I try this out.Thanks for all help, appreciated.mvh Jan-Erik Hägglöf
-------- Originalmeddelande --------Från: Hans Hagen via ntg-context
On 12/3/2021 3:17 PM, skrantajanneman via ntg-context wrote:
My thougts on this, if it is a possible alternative, to do such things in metafun instead?
i guess so but we needs specs etc and time (nothing wrong with using tikz if one likes the syntax, apart from it being a dependency and a rather huge load (quite some files) and slower than mp) 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 -----------------------------------------------------------------
On Fri, 3 Dec 2021, Hans Hagen via ntg-context wrote:
On 12/3/2021 10:49 AM, Hans Hagen via ntg-context wrote:
I’ve been struggeling with the circuitikz module since my upgrade to LMTX. btw, We can have more 'catches' in the loader (t) module if needed. In any case, also check if things work with mkiv.
I tested the example on mkiv, I got error that dipchip and fliflop JK are not defined. The file compiles if I comment those out. But in LMTX, I also get a "missing semicolon" error. There is also this warning, which may have something to do with what is going wrong: system > module wrapping error in 'tikz' The error appears to be related to keyword arguments. The following example works: \usemodule[circuitikz] \starttext \startcircuitikz \draw (0,2) to[I] (2,2) ; \stopcircuitikz \stoptext But this does not: \usemodule[circuitikz] \starttext \startcircuitikz \draw (0,2) to[I=1] (2,2) ; \stopcircuitikz \stoptext Aditya
On 12/3/2021 3:47 PM, Aditya Mahajan via ntg-context wrote:
On Fri, 3 Dec 2021, Hans Hagen via ntg-context wrote:
On 12/3/2021 10:49 AM, Hans Hagen via ntg-context wrote:
I’ve been struggeling with the circuitikz module since my upgrade to LMTX. btw, We can have more 'catches' in the loader (t) module if needed. In any case, also check if things work with mkiv.
I tested the example on mkiv, I got error that dipchip and fliflop JK are not defined. The file compiles if I comment those out. But in LMTX, I also get a "missing semicolon" error. There is also this warning, which may have something to do with what is going wrong:
system > module wrapping error in 'tikz'
The error appears to be related to keyword arguments. The following example works:
\usemodule[circuitikz] \starttext \startcircuitikz \draw (0,2) to[I] (2,2) ; \stopcircuitikz \stoptext
But this does not:
\usemodule[circuitikz] \starttext \startcircuitikz \draw (0,2) to[I=1] (2,2) ; \stopcircuitikz \stoptext can you test the attached ... this works here
\usemodule[circuitikz] % \usemodule[tikz] \starttext \starttikzpicture \draw (0,2) -- (2,2) ; \stoptikzpicture \startcircuitikz \draw (0,2) to[I=1] (2,2) ; \stopcircuitikz \stoptext 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 -----------------------------------------------------------------
The result of testing, different error messages in MKIV and LMTX. The attached files belongs to LMTX run with the attached m-circuitikz.mkxl and m-tikz.mkxl in texmf-local
3 dec. 2021 kl. 19:16 skrev Hans Hagen via ntg-context
:
On Fri, 3 Dec 2021, Jan-Erik Hägglöf via ntg-context wrote:
The result of testing, different error messages in MKIV and LMTX.
The attached files belongs to LMTX run with the attached m-circuitikz.mkxl and m-tikz.mkxl in texmf-local
Not placed at the right place. From your log file: open source > level 2, order 3, name '/Users/jan-erikhagglof/context/context-osx-64/tex/texmf-local/m-circuitikz.mkxl' (I am surprised it gets found! The should be texmf-local/tex/context/ sub-dir) open source > level 3, order 4, name '/Users/jan-erikhagglof/context/context-osx-64/tex/texmf-context/tex/context/modules/mkxl/m-tikz.mkxl' (I am guessing that this is the old m-tikz.mkxl). For such experiments, it is simplest if you place the files in the current directory. Aditya
Am 04.12.21 um 00:27 schrieb Aditya Mahajan via ntg-context:
Not placed at the right place. From your log file:
open source > level 2, order 3, name '/Users/jan-erikhagglof/context/context-osx-64/tex/texmf-local/m-circuitikz.mkxl'
(I am surprised it gets found! The should be texmf-local/tex/context/ sub-dir)
Well, if the database is made, ConTeXt will find files in *all* the texmf trees. BTW OT, I wouldn’t suggest to use texmf-local or texmf-project; while these are never overwritten by an update, you must copy them to a new installation. I prefer ~/texmf for my personal fonts, modules etc., because it’s independent of the ConTeXt installation I’m currently using, while it’s still a valid texmf tree searched by default. Hraban
I did replace the attached .mkxl files now in the correct directory tree together with the rest of all m-xyz.mkxl module files. The same error message appears and i’m back at square one.
4 dec. 2021 kl. 10:05 skrev Henning Hraban Ramm via ntg-context
: Am 04.12.21 um 00:27 schrieb Aditya Mahajan via ntg-context:
Not placed at the right place. From your log file: open source > level 2, order 3, name '/Users/jan-erikhagglof/context/context-osx-64/tex/texmf-local/m-circuitikz.mkxl' (I am surprised it gets found! The should be texmf-local/tex/context/ sub-dir)
Well, if the database is made, ConTeXt will find files in *all* the texmf trees.
BTW OT, I wouldn’t suggest to use texmf-local or texmf-project; while these are never overwritten by an update, you must copy them to a new installation. I prefer ~/texmf for my personal fonts, modules etc., because it’s independent of the ConTeXt installation I’m currently using, while it’s still a valid texmf tree searched by default.
Hraban ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
On 12/4/2021 10:37 PM, Jan-Erik Hägglöf via ntg-context wrote:
I did replace the attached .mkxl files now in the correct directory tree together with the rest of all m-xyz.mkxl module files.
The same error message appears and i’m back at square one. hm, here i did:
- install tikz from ctan - install curcuitikz from ctan - copy the m-files to context/base ... ran mtxrun --generate there is not much more I can do (esp if it also runs ok at Aditya's place) 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 -----------------------------------------------------------------
Ok so I did all the tips, installed from ctan without any success so it is interesting to know how it worked out for some and not for me. Well that is a good question. Thanks for your help anyway Regards Jan-Erik
5 dec. 2021 kl. 16:35 skrev Hans Hagen
: On 12/4/2021 10:37 PM, Jan-Erik Hägglöf via ntg-context wrote:
I did replace the attached .mkxl files now in the correct directory tree together with the rest of all m-xyz.mkxl module files. The same error message appears and i’m back at square one. hm, here i did:
- install tikz from ctan - install curcuitikz from ctan - copy the m-files to context/base ...
ran mtxrun --generate
there is not much more I can do (esp if it also runs ok at Aditya's place)
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 -----------------------------------------------------------------
On Sun, 5 Dec 2021, Hans Hagen via ntg-context wrote:
On 12/4/2021 10:37 PM, Jan-Erik Hägglöf via ntg-context wrote:
I did replace the attached .mkxl files now in the correct directory tree together with the rest of all m-xyz.mkxl module files.
The same error message appears and i’m back at square one. hm, here i did:
- install tikz from ctan - install curcuitikz from ctan - copy the m-files to context/base ...
ran mtxrun --generate
there is not much more I can do (esp if it also runs ok at Aditya's place)
Things are not working correctly at my end either. The whole tikz/pgf code needs some cleaning up. There are a bunch of errors of the form: system > module wrapping error in 'tikz' because the many of the modules in tikz have a \stopmodule but not a \startmodule. I'll try to clean it up, but tikz is a rabbit hole .... Aditya
On Sat, 4 Dec 2021, Jan-Erik Hägglöf via ntg-context wrote:
I did replace the attached .mkxl files now in the correct directory tree together with the rest of all m-xyz.mkxl module files.
The same error message appears and i’m back at square one.
After a bit of digging, I think that you are not using the latest version of tikz. In particular, in your log messages, there are a bunch of messages like system > module wrapping error in 'tikz' while these errors have been fixed in the latest release on ctan. 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. Aditya
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 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. @Hans, does the above code work correctly for you? If so, then we can wait until the next upload and test again. Aditya
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 -----------------------------------------------------------------
Ok, so if I understand this correctly, you recommend install directly from ctan. The question is, I’m not sure how, but is it the tds arcive? If I test it under mkiv do I need a separate install? The wiki seems to indicate that the mkiv version is included in the LMTX installation, if so it doesn’t work but I give it a second try. Your commitment is truly fantastic and I thank you once again. Jan-Erik
6 dec. 2021 kl. 18:39 skrev Aditya Mahajan via ntg-context
: 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
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.
@Hans, does the above code work correctly for you? If so, then we can wait until the next upload and test again.
Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
On 12/6/2021 9:49 PM, Jan-Erik Hägglöf via ntg-context wrote:
Ok, so if I understand this correctly, you recommend install directly from ctan.
The question is, I’m not sure how, but is it the tds arcive?
i'm not sure how that gets updated but as tikz is a constantly moving i just got it from ctan (for testing, i don't depend on it so it's not critital what i install)
If I test it under mkiv do I need a separate install?
no, the lmtx installer also installs mkiv but you can try the garden mkiv installation and then just replace tikz and circuitikz in the modules section with the latest from ctan
The wiki seems to indicate that the mkiv version is included in the LMTX installation, if so it doesn’t work but I give it a second try.
indeed, but you need to make tex/texmf-modules/tex and then unzip the (circuit)tikz zips from ctan there and run "mtxrun --generate" afterwards 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 -----------------------------------------------------------------
On Mon, 6 Dec 2021, Jan-Erik Hägglöf wrote:
Ok, so if I understand this correctly, you recommend install directly from ctan.
The question is, I’m not sure how, but is it the tds arcive?
Every package on CTAN is available as a TDS archive. For example, go to the tikz package on ctan: https://www.ctan.org/pkg/pgf and search for "TDS archive" to get a TDS-compliant zip. Aditya
On Mon, 6 Dec 2021, 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.
There was an error in circuitikz, which is now fixed in the latest version: https://github.com/circuitikz/circuitikz/pull/600 So, the following works (with latest circuittiz from ctan): \usemodule[t][circuitikz] \starttext \startcircuitikz \draw (0,2) to[I] (2,2); \stopcircuitikz \stoptext But fails with m-circuitikz (even after I remove \unprotect ... \protect from \starttikzinput as in the other thread). So, I don't know what is going wrong with the catcodes in m-circuitikz. Aditya
Good work and thank you very much. I dig in to it and try it out
Sincerely
Jan-Erik
Den mån 13 dec. 2021 21:09Aditya Mahajan via ntg-context
On Mon, 6 Dec 2021, 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.
There was an error in circuitikz, which is now fixed in the latest version:
https://github.com/circuitikz/circuitikz/pull/600
So, the following works (with latest circuittiz from ctan):
\usemodule[t][circuitikz]
\starttext
\startcircuitikz \draw (0,2) to[I] (2,2); \stopcircuitikz
\stoptext
But fails with m-circuitikz (even after I remove \unprotect ... \protect from \starttikzinput as in the other thread). So, I don't know what is going wrong with the catcodes in m-circuitikz.
Aditya
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
Seems to not solve my issue but i’m supplying my logs. I did update tikz and circuitikz and the whole LMTX refresh and new. Tested the code below Check my logs whats wrong. Giving up on this one Thanks in advance Jan-Erik
13 dec. 2021 kl. 21:14 skrev Jan-Erik Hägglöf
: Good work and thank you very much. I dig in to it and try it out
Sincerely
Jan-Erik
Den mån 13 dec. 2021 21:09Aditya Mahajan via ntg-context
mailto:ntg-context@ntg.nl> skrev: On Mon, 6 Dec 2021, 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.
There was an error in circuitikz, which is now fixed in the latest version:
https://github.com/circuitikz/circuitikz/pull/600 https://github.com/circuitikz/circuitikz/pull/600
So, the following works (with latest circuittiz from ctan):
\usemodule[t][circuitikz]
\starttext
\startcircuitikz \draw (0,2) to[I] (2,2); \stopcircuitikz
\stoptext
But fails with m-circuitikz (even after I remove \unprotect ... \protect from \starttikzinput as in the other thread). So, I don't know what is going wrong with the catcodes in m-circuitikz.
Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl mailto:ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl http://www.pragma-ade.nl/ / http://context.aanhet.net http://context.aanhet.net/ archive : https://bitbucket.org/phg/context-mirror/commits/ https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net http://contextgarden.net/ ___________________________________________________________________________________
Hi, This works here: \usemodule[circuitikz] \starttext \startcircuitikz \draw (0,2) to[I] (2,2); \stopcircuitikz \startcircuitikz \draw (0,2) to[I] (2,2); \stopcircuitikz \stoptext with the attached. Make sure to put it in the regular context base path and run mtxrun --generate. Aditya: can you check if we load enough? We really need to get rid of all these (kind of strange) t-* modules that somehow ended up in tikz and it's way easier and robust to occasionally add something needed to m-tikz than to try to catch hard-to-locate-and-fix stuff in the tikz distribution. If needed we can apply runtime patches too. (nyw, it looks like tikz creates empty pfg files during a run but that's probbably has a reason) 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 -----------------------------------------------------------------
I tested with my course assignments (simple tikz block diagrams, lots of pgdplots code) and everything works correctly. I haven't tested circuitikz; the simple example fails and I am trying to understand why that is happening.
Aditya: can you check if we load enough?
I believe so. This is what my notes say (it is no fun to trace down these files): % Order in which files are loaded % 1. t-tikz % 1.1 t-pgf % 1.1.1 t-pgfcor % 1.1.1.1 t-pgfsys % 1.1.1.1.1 t-pgfrcs % 1.1.1.1.1.1 t-pgfmod % Ignore % 1.1.1.1.1.2 pgfutil-common.tex (1) % 1.1.1.1.1.3 pgfutil-context.def (2) % 1.1.1.1.1.4 pgfrcs.code.tex (3) % 1.1.1.1.2 pgfsys.code.tex (4) % 1.1.1.1.3 pgfsyssoftpath.code.tex (5) % 1.1.1.1.4 pgfsysprotocol.code.tex (6) % 1.1.1.2 pgfcore.code.tex (7) % 1.1.2 \usepgfmodule[shapes,plot] (8) % 1.2 t-pgffor % 1.2.1 t-pgfrcs (already loaded) % 1.2.2 t-pgfkey % 1.2.2.1 pgfkeys.code.tex (9) % 1.2.3 pgffor.code.tex (10) % 1.3 tikz.code.tex (11) You also have pgfmoduleplot.code.tex, which I had missed.
We really need to get rid of all these (kind of strange) t-* modules that somehow ended up in tikz and it's way easier and robust to occasionally add something needed to m-tikz than to try to catch hard-to-locate-and-fix stuff in the tikz distribution. If needed we can apply runtime patches too.
Agreed. I believe that the pgf module provides so many modules as a means to be modular. For example, it possible to use `pgffor` module to get the for loop syntax; or load `pgfkey` to get the key-value arguments, etc. But each of these t-* files has so much boilerplate code, so I like your method better.
(nyw, it looks like tikz creates empty pfg files during a run but that's probbably has a reason)
tikz's ChangeLog has the following entries: 2007-01-18: - Fixed .aux problems in plain and ConTeXt mode. Using .pgf as extension now. Grepping the source for `.pgf` gives: tex/generic/pgf/utilities/pgfutil-context.def: \pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{} tex/generic/pgf/utilities/pgfutil-context.def: \immediate\csname openout\endcsname\pgfutil@auxout\jobname.pgf\relax tex/generic/pgf/utilities/pgfutil-plain.def: \pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{} tex/generic/pgf/utilities/pgfutil-plain.def: \immediate\csname openout\endcsname\pgfutil@auxout\jobname.pgf The file handle \pgfutil@auxout is used in the macro \pgfutil@writetoaux which gets used in the driver files to write absolute positioning stuff to file. For example, pgfsys-luatex.def has: \def\pgfsys@markposition#1{% \savepos% \edef\pgf@temp{#1}% \expandafter\pgfutil@writetoaux\expandafter{% \expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\lastxpos}{\the\lastypos}}% } This can easily be stored in the tuc file using two-pass data, but I don't use this feature of tikz, so don't have examples to test this. @HenriMenke: Do you know if it is save to not create the `.pgf` file and rewrite the above macro to read store the \pgfsyspdfmark table in the `.tuc` file?
HI ALL! Finally it worked after complete reinstall Tikz circuitikz pgfplots from ctan, updated LMTX to latest 2021.12.10 And replaced m-tikz.mkxl and m-circuitikz.mkxl with the attached files from Hans. Fingers crossed and praying and impressive help from Hans and Aditya Many thanks Sincerely Jan-Erik
14 dec. 2021 kl. 04:57 skrev Aditya Mahajan via ntg-context
: I tested with my course assignments (simple tikz block diagrams, lots of pgdplots code) and everything works correctly. I haven't tested circuitikz; the simple example fails and I am trying to understand why that is happening.
Aditya: can you check if we load enough?
I believe so. This is what my notes say (it is no fun to trace down these files):
% Order in which files are loaded % 1. t-tikz % 1.1 t-pgf % 1.1.1 t-pgfcor % 1.1.1.1 t-pgfsys % 1.1.1.1.1 t-pgfrcs % 1.1.1.1.1.1 t-pgfmod % Ignore % 1.1.1.1.1.2 pgfutil-common.tex (1) % 1.1.1.1.1.3 pgfutil-context.def (2) % 1.1.1.1.1.4 pgfrcs.code.tex (3) % 1.1.1.1.2 pgfsys.code.tex (4) % 1.1.1.1.3 pgfsyssoftpath.code.tex (5) % 1.1.1.1.4 pgfsysprotocol.code.tex (6) % 1.1.1.2 pgfcore.code.tex (7) % 1.1.2 \usepgfmodule[shapes,plot] (8) % 1.2 t-pgffor % 1.2.1 t-pgfrcs (already loaded) % 1.2.2 t-pgfkey % 1.2.2.1 pgfkeys.code.tex (9) % 1.2.3 pgffor.code.tex (10) % 1.3 tikz.code.tex (11)
You also have pgfmoduleplot.code.tex, which I had missed.
We really need to get rid of all these (kind of strange) t-* modules that somehow ended up in tikz and it's way easier and robust to occasionally add something needed to m-tikz than to try to catch hard-to-locate-and-fix stuff in the tikz distribution. If needed we can apply runtime patches too.
Agreed. I believe that the pgf module provides so many modules as a means to be modular. For example, it possible to use `pgffor` module to get the for loop syntax; or load `pgfkey` to get the key-value arguments, etc. But each of these t-* files has so much boilerplate code, so I like your method better.
(nyw, it looks like tikz creates empty pfg files during a run but that's probbably has a reason)
tikz's ChangeLog has the following entries:
2007-01-18: - Fixed .aux problems in plain and ConTeXt mode. Using .pgf as extension now.
Grepping the source for `.pgf` gives:
tex/generic/pgf/utilities/pgfutil-context.def: \pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{} tex/generic/pgf/utilities/pgfutil-context.def: \immediate\csname openout\endcsname\pgfutil@auxout\jobname.pgf\relax tex/generic/pgf/utilities/pgfutil-plain.def: \pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{} tex/generic/pgf/utilities/pgfutil-plain.def: \immediate\csname openout\endcsname\pgfutil@auxout\jobname.pgf
The file handle \pgfutil@auxout is used in the macro \pgfutil@writetoaux which gets used in the driver files to write absolute positioning stuff to file. For example, pgfsys-luatex.def has:
\def\pgfsys@markposition#1{% \savepos% \edef\pgf@temp{#1}% \expandafter\pgfutil@writetoaux\expandafter{% \expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\lastxpos}{\the\lastypos}}% }
This can easily be stored in the tuc file using two-pass data, but I don't use this feature of tikz, so don't have examples to test this.
@HenriMenke: Do you know if it is save to not create the `.pgf` file and rewrite the above macro to read store the \pgfsyspdfmark table in the `.tuc` file?
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
participants (5)
-
Aditya Mahajan
-
Hans Hagen
-
Henning Hraban Ramm
-
Jan-Erik Hägglöf
-
skrantajanneman