ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Commutative diagrams in tikz-cd: for wiki
@ 2013-05-25 22:40 Idris Samawi Hamid ادريس   سماوي حامد
  2014-02-28 20:06 ` Florêncio Neves
  0 siblings, 1 reply; 2+ messages in thread
From: Idris Samawi Hamid ادريس   سماوي حامد @ 2013-05-25 22:40 UTC (permalink / raw)
  To: ntg-context; +Cc: Florêncio Neves, Mojca Miklavec

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

Dear gang,

With a couple of modifications I got tikz-cd (a package to make  
commutative diagrams for categories and toposes etc. by Florêncio Neves)  
working in mkiv:

http://texdoc.net/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf

It depends on the tikz module, already supported in mkiv.

The tikz-cd module is attached, and here is a sample file:

===============
\usemodule[tikz]
\usetikzlibrary{commute}

\starttext
\starttikzcd %[ampersand replacement=\&]
A \arrow{rd} \arrow[yshift=0.5ex]{r}{\phi} \& B \\
\& C
\stoptikzcd

\starttikzcd %[ampersand replacement=\&]
A
\arrow[yshift=1.5ex]{r}
\arrow[yshift=0.0ex]{r}
\& B \arrow[xshift=0.7ex]{d} \arrow[xshift=-0.7ex]{d} \\
\& C
\stoptikzcd
\stoptext
===============

A couple of things:

1 I had to comment out line 396 of pgfsys-pdftex.def in the tikz module,  
or else I'd get an undefined control sequence. It's not needed anyway  
since that's pdftex.

2 In tikzlibrarycommute.code.tex, line 395 I had to add the option

ampersand replacement=\&

to avoid a TeX error. So you'll have to use '\&' instead of '&' for matrix  
arrays.

3 Some LaTeX-specific stuff is commented, and support is added for

\starttikzcd \stoptikzcd

so we get a ConTeXt environment.


I'm hoping someone can volunteer to place this on the wiki, perhaps even  
set it up on the modules page, with an indication of its proper place in  
the texmf-modules tree etc.

Any other improvements will also be appreciated. Enjoy!

Best wishes
Idris
-- 
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

[-- Attachment #2: tikzlibrarycommute.code.tex --]
[-- Type: application/x-tex, Size: 28580 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Commutative diagrams in tikz-cd: for wiki
  2013-05-25 22:40 Commutative diagrams in tikz-cd: for wiki Idris Samawi Hamid ادريس   سماوي حامد
@ 2014-02-28 20:06 ` Florêncio Neves
  0 siblings, 0 replies; 2+ messages in thread
From: Florêncio Neves @ 2014-02-28 20:06 UTC (permalink / raw)
  To: Idris Samawi Hamid ادريس
	سماوي حامد
  Cc: ntg-context, Mojca Miklavec

I have added ConTeXt support in the the newest version of tikz-cd
(which I just submitted to CTAN and should be available within the
next few days).

I didn't test it very extensively.  Let me know if there is any problems.

On 5/25/13, Idris Samawi Hamid ادريس   سماوي حامد <ishamid@colostate.edu> wrote:
> Dear gang,
>
> With a couple of modifications I got tikz-cd (a package to make
> commutative diagrams for categories and toposes etc. by Florêncio Neves)
> working in mkiv:
>
> http://texdoc.net/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf
>
> It depends on the tikz module, already supported in mkiv.
>
> The tikz-cd module is attached, and here is a sample file:
>
> ===============
> \usemodule[tikz]
> \usetikzlibrary{commute}
>
> \starttext
> \starttikzcd %[ampersand replacement=\&]
> A \arrow{rd} \arrow[yshift=0.5ex]{r}{\phi} \& B \\
> \& C
> \stoptikzcd
>
> \starttikzcd %[ampersand replacement=\&]
> A
> \arrow[yshift=1.5ex]{r}
> \arrow[yshift=0.0ex]{r}
> \& B \arrow[xshift=0.7ex]{d} \arrow[xshift=-0.7ex]{d} \\
> \& C
> \stoptikzcd
> \stoptext
> ===============
>
> A couple of things:
>
> 1 I had to comment out line 396 of pgfsys-pdftex.def in the tikz module,
> or else I'd get an undefined control sequence. It's not needed anyway
> since that's pdftex.
>
> 2 In tikzlibrarycommute.code.tex, line 395 I had to add the option
>
> ampersand replacement=\&
>
> to avoid a TeX error. So you'll have to use '\&' instead of '&' for matrix
>
> arrays.
>
> 3 Some LaTeX-specific stuff is commented, and support is added for
>
> \starttikzcd \stoptikzcd
>
> so we get a ConTeXt environment.
>
>
> I'm hoping someone can volunteer to place this on the wiki, perhaps even
> set it up on the modules page, with an indication of its proper place in
> the texmf-modules tree etc.
>
> Any other improvements will also be appreciated. Enjoy!
>
> Best wishes
> Idris
> --
> Professor Idris Samawi Hamid
> Department of Philosophy
> Colorado State University
> Fort Collins, CO 80523
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-28 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-25 22:40 Commutative diagrams in tikz-cd: for wiki Idris Samawi Hamid ادريس   سماوي حامد
2014-02-28 20:06 ` Florêncio Neves

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