ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Package {tikz-cd} with ConTeXt
@ 2014-10-28 23:37 Fabrice Couvreur
  0 siblings, 0 replies; only message in thread
From: Fabrice Couvreur @ 2014-10-28 23:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-10-28 23:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-28 23:37 Package {tikz-cd} with ConTeXt Fabrice Couvreur

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