ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Fabrice Couvreur <fabrice1.couvreur@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Package {tikz-cd} with ConTeXt
Date: Wed, 29 Oct 2014 00:37:01 +0100	[thread overview]
Message-ID: <CACyK-er+RQUtyVn9YL6wh45xPrpt1nR=5Yrhmbr7b4jEMMsKYQ@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 3500 bytes --]

Hi,
The following code compiles with pdflatex :

\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-cd}
\usetikzlibrary{3d,shapes}

\begin{document}
\tikzset{xzplane/.style={canvas is xz plane at y=#1,
thick,shading=ball,ball color=red,draw=black}}
\tikzset{yzplane/.style={canvas is yz plane at x=#1,thick,shading=ball,
ball color=red,draw=black}}
\tikzset{xyplane/.style={canvas is xy plane at z=#1,thick,shading=ball,ball
color=red,draw=black}}
\tikzcdset{
arrow style=tikz,
diagrams={>=stealth}}
\[\begin{tikzcd}
\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){\Large 7};
\draw[xyplane=2] node[below=0.25cm] at (1,0){\Large X};}
\arrow[thick, bend left, start anchor = north, end anchor = north, shorten
>=1mm]{r}[scale=2]{\times 2}
&\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){\Large 14};
\draw[xyplane=2] node[below=0.25cm] at (1,0) {\Large X};}
\arrow[thick, bend left, start anchor = north, end anchor = north, shorten
<= 1mm]{r}[scale=2]{+ 3}
&\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){\Large 17};
\draw[xyplane=2] node[below=0.25cm] at (1,0){\Large X};}
\end{tikzcd}\]

\begin{tikzpicture}
      \tikzstyle {bulle}=[circle,draw,thick]
      \tikzstyle{fleche}=[thick,>=stealth,->]
      \node(debut1) at (0,0) {$7$};
      \node(debut3) at (4,0) {$14$};
      \draw [fleche](debut1.north) to [bend left] (debut3.north);
      \node [bulle,fill=white] (debut6) at (2,0.75) {$\times 2$};
    \end{tikzpicture}
\end{document}

I tried with Context, but it does not work :

\usemodule[tikz]
\usetikzlibrary[calc]
\usetikzlibrary[cd]
\usetikzlibrary[3d]
\usetikzlibrary[arrows]
\usetikzlibrary[positioning]
\starttext
\tikzset{xzplane/.style={canvas is xz plane at y=#1,
thick,shading=ball,ball color=red,draw=black}}
\tikzset{yzplane/.style={canvas is yz plane at x=#1,thick,shading=ball,
ball color=red,draw=black}}
\tikzset{xyplane/.style={canvas is xy plane at z=#1,thick,shading=ball,ball
color=red,draw=black}}
\tikzcdset{
arrow style=tikz,
diagrams={>=stealth}}
\starttikzcd
\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){ 7};
\draw[xyplane=2] node[below=0.25cm] at (1,0){X};}
\arrow[thick, bend left, start anchor = north, end anchor = north, shorten
>=1mm]{r}[scale=2]{$\times 2$}
&\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){ 14};
\draw[xyplane=2] node[below=0.25cm] at (1,0) {X};}
\arrow[thick, bend left, start anchor = north, end anchor = north, shorten
<= 1mm]{r}[scale=2]{+ 3}
&\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){ 17};
\draw[xyplane=2] node[below=0.25cm] at (1,0){X};}
\stoptikzcd
\stoptext

Best regards,
Fabrice

[-- Attachment #1.2: Type: text/html, Size: 4320 bytes --]

[-- Attachment #2: 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
___________________________________________________________________________________

                 reply	other threads:[~2014-10-28 23:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CACyK-er+RQUtyVn9YL6wh45xPrpt1nR=5Yrhmbr7b4jEMMsKYQ@mail.gmail.com' \
    --to=fabrice1.couvreur@gmail.com \
    --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).