ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Hans Hagen <j.hagen@xs4all.nl>
Subject: Re: [DKIM] Re: [DKIM] circuitikz module seems broken
Date: Fri, 3 Dec 2021 19:16:04 +0100	[thread overview]
Message-ID: <39ef5794-0415-0f0d-c8e2-2b2f98b63bd7@xs4all.nl> (raw)
In-Reply-To: <nycvar.YAK.7.78.908.2112030940300.2024218@nqv-guvaxcnq>

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

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

[-- Attachment #2: m-circuitikz.mkxl --]
[-- Type: text/plain, Size: 3741 bytes --]

%D \module
%D   [       file=m-circuitikz,
%D        version=2021.12.03,
%D          title=\CONTEXT\ Extra Modules,
%D       subtitle=CURCUITIKZ support,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D A fixed variant of the t-curcuitikz module distributed with tikz. This one
%D is for \LMTX.

\usemodule[m][tikz]

\startmodule[circuitikz]

\def\pgfcircversion     {1.4.4}
\def\pgfcircversiondate {2021/10/31}

\usetikzlibrary[calc]
\usetikzlibrary[arrows.meta, bending]
\usetikzlibrary[fpu] % may be needed for use fpu reciprocal (v1.0.1)

\tikzinputfile{pgfcirc.defines.tex}
\tikzinputfile{pgfcircutils.tex}
\tikzinputfile{pgfcircpath.tex}

\tikzinputfile{pgfcircshapes.tex}
\tikzinputfile{pgfcircmonopoles.tex}
\tikzinputfile{pgfcircbipoles.tex}
\tikzinputfile{pgfcirctripoles.tex}
\tikzinputfile{pgfcircquadpoles.tex}
\tikzinputfile{pgfcircmultipoles.tex}

\tikzinputfile{pgfcirclabel.tex}
\tikzinputfile{pgfcircvoltage.tex}
\tikzinputfile{pgfcirccurrent.tex}
\tikzinputfile{pgfcircflow.tex}

% defaults

\setupmodule
  [current=european,
   voltage=european,
   resistor=american,
   inductor=cute,
   logic=american,
   siunitx=true,
   arrowmos=false]

% can be done nicer ... todo

\processaction
  [\currentmoduleparameter{voltage}]
  [european=>\ctikzset{voltage=european},
   american=>\ctikzset{voltage=american}]

\processaction
  [\currentmoduleparameter{current}]
  [european=>\ctikzset{ current=european},
   american=>\ctikzset{ current=american}]

\processaction
  [\currentmoduleparameter{label}]
  [straight=>\ctikzset{label/align = straight},
   align=>\ctikzset{label/align = rotate},
   smart=>\ctikzset{label/align = smart}]

\processaction
  [\currentmoduleparameter{resistor}]
  [european=>\ctikzset{ resistor=european},
   american=>\ctikzset{ resistor=american}]

\processaction
  [\currentmoduleparameter{inductor}]
  [european=>\ctikzset{ inductor=european},
   american=>\ctikzset{ inductor=american},
   cute=>\ctikzset{ inductor=cute}]

\processaction
  [\currentmoduleparameter{diode}]
  [full=>\ctikzset{ diode=full},
   empty=>\ctikzset{ diode=empty}]

\processaction
  [\currentmoduleparameter{logic}]
  [european=>\ctikzset{ logic ports=european},
   american=>\ctikzset{ logic ports=american}]

% hm, we have units built in and in mkii one can load the units module
% ... always been so ...

\processaction
  [\currentmoduleparameter{siunitx}]
  [true=>\def\SI    #1#2{#1\,#2}
         \def\ampere    {\rm{A}}
         \def\volt      {\rm{V}}
         \def\ohm       {\Omega}
         \def\siemens   {\rm{S}}
         \def\farad     {\rm{F}}
         \def\henry     {\rm{H}}
         \def\second    {\rm{s}}
         \def\coulomb   {\rm{C}}
         \def\siemens   {\rm{S}}
         \def\radians   {\rm{rad}}
         \def\milli     {\rm{m}}
         \def\micro     {\mu}
         \def\nano      {\rm{n}}
         \def\pico      {\rm{p}}
         \def\kilo      {\rm{k}}
         \def\mega      {\rm{M}}
         \def\giga      {\rm{G}}
         \def\tera      {\rm{T}}]

\unprotect

\processaction
  [\currentmoduleparameter{arrowmos}]
  [true=>\pgf@circuit@mos@arrowstrue,
   false=>\pgf@circuit@mos@arrowsfalse]

\protect

\ctikzset{tripoles/op amp/font/.initial=\switchtobodyfont[small]}

\aliased\let\stopcircuitikz\relax

\permanent\protected\def\startcircuitikz#1\stopcircuitikz
  {\starttikzpicture#1\stoptikzpicture}

\stopmodule

\endinput

[-- Attachment #3: m-tikz.mkxl --]
[-- Type: text/plain, Size: 3295 bytes --]

%D \module
%D   [       file=m-tikz,
%D        version=2021.07.12,
%D          title=\CONTEXT\ Extra Modules,
%D       subtitle=TIKZ support,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D A fixed variant of the t-tikz module distributed with tikz. For
%D practical reasons per 2021 we split the module for \MKIV\ and
%D \LMTX. (Maybe some day I'll optimize TIKZ a bit.)

\ifdefined\pdflastxpos \else
    \unprotect
        \frozen\overloaded\protected\def\pdflastxpos{\numexpr\clf_lastxpos\relax}
        \frozen\overloaded\protected\def\pdflastypos{\numexpr\clf_lastypos\relax}
    \protect
\fi

\permanent\protected\def\starttikzinput
  {\pushoverloadmode
   \pushcatcodetable
   \setcatcodetable\texcatcodes
   \unprotect
   \catcode`\@=11
   \catcode`\|=12
   \catcode`\!=12
   \autoparagraphmode\zerocount}

\permanent\protected\def\stoptikzinput
  {\autoparagraphmode\plusone
   \protect
   \popcatcodetable
   \popoverloadmode}

\permanent\protected\def\tikzinputfile#1%
  {\starttikzinput
   \input{#1}
   \stoptikzinput}

\tikzinputfile{t-pgf.tex}
\tikzinputfile{t-pgffor.tex}
\tikzinputfile{tikz.code.tex}

\permanent\protected\def\tikzerrormessage#1#2#3%
  {\writestatus{#1}{#2}}

% For now we need this but we need to educate the user to wrap settings in the
% wrappers. So some day the next line will go. I need to check what commands are
% possible outside a picture.

\overloadmode\zerocount

\permanent\protected\def\starttikzsettings
  {\pushoverloadmode}

\permanent\protected\def\stoptikzsettings
  {\popoverloadmode}

\permanent\protected\def\starttikzpicture
  {\dontleavehmode
   \hcontainer\bgroup
   \autoparagraphmode\zerocount
 % \pushoverloadmode
   \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
   \tikzpicture}

\permanent\protected\def\stoptikzpicture
  {\endtikzpicture
 % \popoverloadmode
   \egroup}

\ifx\pgfdefined\undefined

    \let\pgfdefined\relax

    \ifx\pgfcoredefined\undefined

        \let\pgfcoredefined\relax

        \tikzinputfile{pgfsys.code.tex}
        \tikzinputfile{pgfsyssoftpath.code.tex}
        \tikzinputfile{pgfsysprotocol.code.tex}
        \tikzinputfile{pgfcore.code.tex}

        \let\startpgfpicture             \pgfpicture              \let\stoppgfpicture            \endpgfpicture
        \let\startpgfscope               \pgfscope                \let\stoppgfscope              \endpgfscope
        \let\startpgflowlevelscope       \pgflowlevelscope        \let\stoppgflowlevelscope      \endpgflowlevelscope
        \let\startpgfinterruptpath       \pgfinterruptpath        \let\stoppgfinterruptpath      \endpgfinterruptpath
        \let\startpgfinterruptpicture    \pgfinterruptpicture     \let\stoppgfinterruptpicture   \endpgfinterruptpicture
        \let\startpgfinterruptboundingbox\pgfinterruptboundinbox  \let\stoppgfinterruptboudingbox\endpgfinterruptboundingbox

    \fi

    \let\normalusepgfmodule\usepgfmodule

    \protected\def\usepgfmodule[#1]%
      {\starttikzinput
       \normalusepgfmodule[#1]%
       \stoptikzinput}

    \usepgfmodule[shapes,plot]

\fi

\stopmodule

[-- Attachment #4: Type: text/plain, Size: 493 bytes --]

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

  reply	other threads:[~2021-12-03 18:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03  7:54 Jan-Erik Hägglöf via ntg-context
2021-12-03  9:49 ` [DKIM] " Hans Hagen via ntg-context
2021-12-03 13:54   ` [DKIM] " Hans Hagen via ntg-context
2021-12-03 14:17     ` skrantajanneman via ntg-context
2021-12-03 14:40       ` [DKIM] " Hans Hagen via ntg-context
2021-12-03 14:47     ` Aditya Mahajan via ntg-context
2021-12-03 18:16       ` Hans Hagen via ntg-context [this message]
2021-12-03 22:39         ` Jan-Erik Hägglöf via ntg-context
2021-12-03 23:27           ` Aditya Mahajan via ntg-context
2021-12-04  9:05             ` Henning Hraban Ramm via ntg-context
2021-12-04 21:37               ` Jan-Erik Hägglöf via ntg-context
2021-12-05 15:35                 ` [DKIM] " Hans Hagen via ntg-context
2021-12-05 20:45                   ` [DKIM] " Jan-Erik Hägglöf via ntg-context
2021-12-06  6:54                   ` [DKIM] " Aditya Mahajan via ntg-context
2021-12-06  9:02                 ` Aditya Mahajan via ntg-context
2021-12-06 17:39                   ` Aditya Mahajan via ntg-context
2021-12-06 19:30                     ` Hans Hagen via ntg-context
2021-12-06 20:49                     ` Jan-Erik Hägglöf via ntg-context
2021-12-07  8:48                       ` [DKIM] " Hans Hagen via ntg-context
2021-12-08  5:30                       ` Aditya Mahajan via ntg-context
2021-12-13 20:08                     ` Aditya Mahajan via ntg-context
2021-12-13 20:14                       ` Jan-Erik Hägglöf via ntg-context
2021-12-13 22:35                         ` Jan-Erik Hägglöf via ntg-context
2021-12-13 23:54                           ` Hans Hagen via ntg-context
2021-12-14  3:57                             ` Aditya Mahajan via ntg-context
2021-12-14 13:14                               ` Jan-Erik Hägglöf via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39ef5794-0415-0f0d-c8e2-2b2f98b63bd7@xs4all.nl \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).