From d6fa8fbf780ce1b3309f807ada2fd5eec16e26ae Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 2 Nov 2014 21:51:42 +0000 Subject: tikz-cd (2nov14) git-svn-id: svn://tug.org/texlive/trunk@35485 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf | Bin 337004 -> 341186 bytes .../texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.tex | 32 ++++++++++++++++++++- .../tex/generic/tikz-cd/tikzlibrarycd.code.tex | 32 +++++++++++++-------- Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty | 2 +- 4 files changed, 52 insertions(+), 14 deletions(-) diff --git a/Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf b/Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf index d2968c9a814..f1d5a3a68cf 100644 Binary files a/Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf and b/Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf differ diff --git a/Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.tex b/Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.tex index 9975e5ef3a0..3fa1f0b9c14 100644 --- a/Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.tex +++ b/Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.tex @@ -178,7 +178,7 @@ directory}{}} {\Large\bfseries Commutative diagrams with \tikzname} \vspace{1em} -{Version 0.9d $\quad$ October 26, 2014} +{Version 0.9e \qquad October 30, 2014} \end{center} \vspace{1.5em} @@ -535,6 +535,12 @@ To use this software in Con\TeX t, load \tikzname{} and then the The |{tikzcd}| environment should then be replaced by the following: \begin{contextenvironment}{{tikzcd}\opt{\oarg{options}}} \end{contextenvironment} +Moreover, you may replace the column and row separators |&|, |\\| by +their Con\TeX t analogues |\NC|, |\NR|. However, you should use |\NC| +only \emph{between} cells, and not before the first column or after +the last column, as in usual Con\TeX t tables. Similarly, |\NR| +should be used only between rows. + All other functions of this library work as described in this manual without change. @@ -670,6 +676,10 @@ meaning 1\,ex, you should use \end{center} \end{key} +\begin{key}{/tikz/commutative diagrams/sep=\meta{size}} + This key sets |row sep=|\meta{size}, |column sep=|\meta{size}. +\end{key} + In the examples below, the triangular diagrams would look too wide or too tall if the column or row separation were not set appropriately. @@ -691,6 +701,26 @@ too tall if the column or row separation were not set appropriately. Section \ref*{pgfman-section-matrices}.3.2 of the \pgfname{} manual \cite{pgfman} contains further details on the spacing of matrix cells. +\begin{stylekey}{/tikz/commutative diagrams/cramped} + By default, a generous amount of white space is added around diagram + cells, which is appropriate for large, displayed diagrams. The + present style removes some of this extra white space, and is + intended for smaller diagrams that should blend with the surrounding + text, or very wide material that wouldn't fit on the page otherwise. +\end{stylekey} + +Keep in mind that while there are some legitimate uses for |{tikzcd}| +diagrams on inline formulas, standard \LaTeX\ constructs such as +|\overset| and |\xrigthtarrow| are often sufficient and should be +preferred. The picture below shows the (somewhat subtle) difference +between the cramped and the non-cramped styles. + +\begin{codeexample}[pre=\minipage{6cm},post=\endminipage] +This \begin{tikzcd} A \arrow[r] & B \end{tikzcd} is a regular diagram.\\ +This \begin{tikzcd}[cramped, sep=small] A \arrow[r] & B \end{tikzcd} is a cramped diagram.\\ +This $A \to B$ is just a formula. +\end{codeexample} + \begin{key}{/tikz/commutative diagrams/math mode=\meta{boolean} (default true)} This key determines whether or not the contents of a diagram are diff --git a/Master/texmf-dist/tex/generic/tikz-cd/tikzlibrarycd.code.tex b/Master/texmf-dist/tex/generic/tikz-cd/tikzlibrarycd.code.tex index ddd2312b89e..b5ab8c2d10a 100644 --- a/Master/texmf-dist/tex/generic/tikz-cd/tikzlibrarycd.code.tex +++ b/Master/texmf-dist/tex/generic/tikz-cd/tikzlibrarycd.code.tex @@ -1,4 +1,4 @@ -% tikzlibrarycd.code.tex [2014/10/26 v0.9d Commutative diagrams with tikz] +% tikzlibrarycd.code.tex [2014/10/30 v0.9e Commutative diagrams with tikz] % % Copyright 2011, 2012, 2014 by FlorĂȘncio Neves % @@ -42,8 +42,12 @@ /tikz/draw=\pgfkeysvalueof{/tikz/commutative diagrams/background color}, /tikz/arrows=-, /tikz/line width=\pgfkeysvalueof{/tikz/commutative diagrams/crossing over clearance}}}, + cramped/.code={\tikzcdset{ + every matrix/.append style={inner sep=+-0.3em}, + every cell/.append style={inner sep=+0.3em}}}, row sep/.code={\tikzcd@sep{row}{#1}}, column sep/.code={\tikzcd@sep{column}{#1}}, + sep/.code={\tikzcdset{row sep={#1},column sep={#1}}}, math mode/.is if=tikzcd@mathmode, arrow style/.is choice} @@ -102,18 +106,17 @@ % The `tikzcd' environment \def\tikzcd{% \iffalse{\fi\ifnum0=`}\fi% standard trick to allow nesting of tabular-like environments (cf. the tabularx manual) - \ifx\arrow\tikzcd@arrow% - \pgfutil@packageerror{tikz-cd}{Diagrams cannot be nested}{} - \fi% - \tikzpicture% \pgfutil@ifnextchar&% if we get an & here, it will be returned with the wrong catcode to the input stream {\expandafter\tikzcd@@\expandafter\pgfmatrixnextcell\pgfutil@gobble}% {\tikzcd@@}} -\def\tikzcd@@{\pgfutil@ifnextchar[{\tikzcd@}{\tikzcd@[]}} +\def\tikzcd@@{\pgfutil@ifnextchar[{\tikzcd@handle@shortcuts@next\tikzcd@}{\tikzcd@[]}} \def\tikzcd@[#1]{% - \tikzcdset{every diagram,#1}% + \tikzpicture[/tikz/commutative diagrams/.cd,every diagram,#1]% + \ifx\arrow\tikzcd@arrow% + \pgfutil@packageerror{tikz-cd}{Diagrams cannot be nested}{}% + \fi% \let\arrow\tikzcd@arrow% \let\ar\tikzcd@arrow% \def\rar{\tikzcd@xar{r}}% @@ -350,11 +353,6 @@ }% }% -% ConTeXt-specific stuff -\pgfutil@IfUndefined{starttikzpicture}{}{% - \def\starttikzcd{\tikzcd}% - \def\stoptikzcd{\endtikzcd}} - % Computer modern arrow tips \pgfkeys{ cm to/.tip={Computer Modern Rightarrow[length=+0pt 6.2]}, @@ -551,4 +549,14 @@ shift right/.default=1, background color/.initial=white} +% ConTeXt-specific stuff +\pgfutil@IfUndefined{starttikzpicture}{}{% + \def\starttikzcd{\tikzcd} + \def\stoptikzcd{\endtikzcd} + \tikzcdset{ + every matrix/.append code={% + \def\NC{\pgfmatrixnextcell}% + \def\NR{\pgfmatrixendrow}}} +} + \endinput diff --git a/Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty b/Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty index 6a49ae1db70..e94b351828a 100644 --- a/Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty +++ b/Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty @@ -13,7 +13,7 @@ % You should have received a copy of the GNU General Public License % along with this program. If not, see . -\ProvidesPackage{tikz-cd}[2014/10/26 v0.9d Commutative diagrams with tikz] +\ProvidesPackage{tikz-cd}[2014/10/30 v0.9e Commutative diagrams with tikz] \RequirePackage{tikz}[2013/12/13] % pgf version 3.0.0 required \usetikzlibrary{cd} -- cgit v1.2.3