From: Hans Hagen <j.hagen@xs4all.nl>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: Tikz CD
Date: Mon, 25 Nov 2024 16:50:26 +0100 [thread overview]
Message-ID: <7397f1be-c153-4e5d-9382-16b6b260644b@xs4all.nl> (raw)
In-Reply-To: <2s96qr4n-8522-82rq-8941-po906n0op1ss@hzvpu.rqh>
On 11/25/2024 4:07 PM, Aditya Mahajan wrote:
> Hi,
>
> There was a recent question about what appeared to be commutative diagrams, and I wanted to reply saying that one option is to use tikzcd module. However, testing showed that it fails.
>
> This is what tikzlibrarycd.code.tex does:
>
> % ConTeXt-specific stuff
> \pgfutil@IfUndefined{starttikzpicture}{}{%
> \def\starttikzcd{\tikzcd}
> \def\stoptikzcd{\endtikzcd}
> \tikzcdset{
> every matrix/.append code={%
> \def\NC{\pgfmatrixnextcell}%
> \def\NR{\pgfmatrixendrow}}}
> }
>
>
> where
>
> \def\tikzcd@[#1]{%
> \tikzpicture[/tikz/commutative diagrams/.cd,every diagram,#1]%
> ...}
>
> So, it fails because \tikzpicture is being called with wrong catcodes. It can be fixed in the same manner as we patched tikzpicture as shown by the following MWE:
sounds ok to me
> \usemodule[tikz]
> \usetikzlibrary[cd]
>
> \permanent\protected\def\starttikzcd%
> {\starttikzinput
> \hcontainer\bgroup
> \tikzcd}
>
> \permanent\protected\def\stoptikzcd
> {\endtikzcd
> \egroup
> \stoptikzinput}
>
> \starttext
> \startformula
> \starttikzcd
> x \arrow[d] \NC A \arrow[d] \NC D \NR
> y \NC B \NC D \NR
> \stoptikzcd
> \stopformula
> \stoptext
>
> What is the best way to go about this? I can try to ask the
i assume youy send me a patch(ed file)
> Should we include a wrapper for tikzcd (as we do for circuitikz) or should I try to push a patch upstream.
wrapper
> BTW, why do we need a \hcontainer in the above code?
it makes sure we don't go into the box to mess around with context
things (who knows what tikz adds in there that can interfere)
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
___________________________________________________________________________________
next prev parent reply other threads:[~2024-11-25 15:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 15:07 [NTG-context] " Aditya Mahajan
2024-11-25 15:50 ` Hans Hagen [this message]
2024-11-26 6:39 ` [NTG-context] " Aditya Mahajan
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=7397f1be-c153-4e5d-9382-16b6b260644b@xs4all.nl \
--to=j.hagen@xs4all.nl \
--cc=ntg-context@ntg.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).