Changes

Jump to navigation Jump to search
2,011 bytes added ,  19:58, 5 March 2019
m
Edited the Commutative Diagrams section for more clarity
also supporting ConTeXt. It is a possible alternative to [[MetaPost]] & [[MetaFun]].
[http://modules.contextgarden.net/TikZ TikZ] is included as a (third party) [http://modules.contextgarden.net module] for ConTeXt.
== Example ==
From the TikZ/pgf [http://dl.contextgarden.net/modules/t-tikz/doc/generic/pgf/pgfmanual.pdf manual].
<context source="yes"texcode>
\setupcolors[state=start]
\definecolor[darkgreen][g=.5]
\usemodule[tikz]
node[right,text width=6cm,information text]
{
The {\green darkgreen angle $\alpha$} is $30^\circ$ in the
example ($\pi/6$ in radians). The {\red sine of
$\alpha$}, which is the height of the red line, is
\stoptext
</texcode> [[Image:TikZ_example.png]] == Placing TikZ graphics == You should wrap TikZ graphics inside \hbox when placing them, for example: <texcode> \placefigure[here][fig:myfig]{My figure.}{\hbox{\starttikzpicture \draw (0, 0) circle (3cm);\stoptikzpicture}} </texcode> Otherwise, positioning will not work (figure will not be centered). See [http://www.ntg.nl/pipermail/ntg-context/2007/023177.html this post] by Aditya Mahajan for explanation. == Example for commutative diagrams == Hans Åberg wrote to the mailing list on 2016-10-06: There is a tikz-cd package at CTAN: https://www.ctan.org/tex-archive/graphics/pgf/contrib/tikz-cd?lang=en In order to use it, download the the file <code>tikzlibrarycd.code.tex</code> and put it in <code>CONTEXT_HOME/tex/texmf-modules/tex/generic/pgf/libraries/</code>. Then run<pre>mtxrun --generatecontext --make</pre>You should now be able to use tikz-cd. Makes sure to follow the translation rules in the manual for ConTeXt. In addition to that, it seems that you have to replace the apostrophe with "below". The first few examples in the manual, which compiled with latest ConTeXt: <texcode>\usemodule[tikz]\usetikzlibrary[cd] \starttext \starttikzcd A \arrow{rd} \arrow{r}{𝜑} \NC B \NR \NC C\stoptikzcd \starttikzcd A \arrow[r, "\phi"] \arrow[d, red] \NC B \arrow[d, "\psi" red] \NR C \arrow[r, red, "\eta" blue] \NC D\stoptikzcd \starttikzcd A \arrow[r, "\phi" near start, "\psi" below, "\eta" near end] \NC B\stoptikzcd \starttikzcd T \arrow[drr, bend left, "x"] \arrow[ddr, bend right, "y"] \arrow[dr, dotted, "{(x,y)}" description] \NC \NC \NR \NC X \times_Z Y \arrow[r, "p"] \arrow[d, "q"] \NC X \arrow[d, "f"] \NR \NC Y \arrow[r, "g"] \NC Z\stoptikzcd \starttikzcd[column sep=tiny] \NC \pi_1(U_1) \ar[dr] \ar[drr, "j_1", bend left=20] \NC \NC[1.5em] \NR \pi_1(U_1\cap U_2) \ar[ur, "i_1"] \ar[dr, "i_2" below] \NC \NC \pi_1(U_1) \ast_{ \pi_1(U_1\cap U_2)} \pi_1(U_2) \ar[r, dashed, "\simeq"] \NC \pi_1(X) \NR \NC \pi_1(U_2) \ar[ur]\ar[urr, "j_2" below, bend right=20] \NC \NC\stoptikzcd \stoptext</texcode>
== See also ==
4

edits

Navigation menu