From 43a57ed22fe612f300d51efd5fed0ff2d8a7df48 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 9 Mar 2014 00:12:30 +0000 Subject: tikz-cd (8mar14) git-svn-id: svn://tug.org/texlive/trunk@33126 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf | Bin 339276 -> 350206 bytes .../texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.tex | 125 ++-- Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty | 4 +- .../tex/latex/tikz-cd/tikzlibrarycd.code.tex | 683 --------------------- .../tex/tex/generic/tikz-cd/tikzlibrarycd.code.tex | 540 ++++++++++++++++ Master/tlpkg/libexec/ctan2tds | 7 + 6 files changed, 598 insertions(+), 761 deletions(-) delete mode 100644 Master/texmf-dist/tex/latex/tikz-cd/tikzlibrarycd.code.tex create mode 100644 Master/texmf-dist/tex/tex/generic/tikz-cd/tikzlibrarycd.code.tex (limited to 'Master') 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 be878f26e8f..56fd4656dcd 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 2d0e1b53c2c..0e8e93f2921 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 @@ -1,4 +1,4 @@ -% Copyright 2011, 2012, 2014 by Florêncio Neves +% Copyright 2011, 2012, 2014 by Florêncio Neves % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by @@ -126,12 +126,8 @@ inner ysep=0.5cm} } -\usepackage{iftex,tikz-cd,xr} -\ifLuaTeX - \usepackage{fontspec} -\else - \usepackage[utf8]{inputenc} -\fi +\usepackage{tikz-cd,xr,multicol,microtype} +\usepackage[utf8]{inputenc} \hypersetup{unicode, pdftitle={The tikz-cd package}, @@ -153,25 +149,11 @@ \title{The \texttt{tikz-cd} package} \author{Florêncio Neves} -\date{Version 0.9, of February 28, 2014} +\date{Version 0.9b, of March 8, 2014} \tikzset{/codeexample/every codeexample/.append style={/tikz/commutative diagrams/background color=graphicbackground}} -\pgfarrowsdeclare{gray x}{gray x} -{ - \pgfarrowsrightextend{4\pgflinewidth} -} -{ - \pgfsetdash{}{0pt} - \pgfsetlinewidth{0.8\pgflinewidth} - \pgfsetstrokecolor{gray} - \pgfpathmoveto{\pgfpoint{5\pgflinewidth}{5\pgflinewidth}} - \pgfpathlineto{\pgfpoint{-5\pgflinewidth}{-5\pgflinewidth}} - \pgfusepathqstroke - \pgfpathmoveto{\pgfpoint{-5\pgflinewidth}{5\pgflinewidth}} - \pgfpathlineto{\pgfpoint{5\pgflinewidth}{-5\pgflinewidth}} - \pgfusepathqstroke -} +\tikzset{gray x/.tip={Rays[color=gray]}} \newcommand{\displayarrow}[2][]{% \index{#2@\protect\texttt{#2} arrow tip}% @@ -189,8 +171,6 @@ \tikz[baseline=-axis_height, line width=rule_thickness] \draw[arrows=gray x-gray x,commutative diagrams/.cd, #1] (0,0) -- (0.6,0);} -\usepackage{multicol,microtype,ellipsis} - \begin{document} \maketitle @@ -202,8 +182,8 @@ reasonable default settings. Familiarity with Ti\emph{k}Z is helpful but not necessary, since the examples contained here cover the most common situations. -This software is distributed under the GNU General Public License, -version 3 or later. +This software is distributed under the terms of the GNU General Public +License, version 3 or later. \tableofcontents @@ -254,7 +234,7 @@ between matrix entries can be created with the |\arrow| command described below. Everything inside |{tikzcd}| is typeset in math mode, but you will -probably want use it inside an |{equation}| environment or |\[| \dots\ +probably want use it inside an |{equation}| environment or |\[| \dots |\]|, so that the diagram is placed on a new line and centered. It is important to note that \textsc{dvi} viewers will not display @@ -322,8 +302,7 @@ of the arrow. \end{tikzcd} \end{codeexample} -We provide one more example, reproduced from the -X\raisebox{-0.3ex}{Y}-pic user's guide. +We provide two real-life examples. \begin{codeexample}[] \begin{tikzcd} @@ -338,6 +317,21 @@ X\raisebox{-0.3ex}{Y}-pic user's guide. \end{tikzcd} \end{codeexample} +\begin{codeexample}[] +\begin{tikzcd}[column sep=tiny] + & \pi_1(U_1) \ar[dr] \ar[drr, "j_1", bend left=20] + & + &[1.5em] \\ + \pi_1(U_1\cap U_2) \ar[ur, "i_1"] \ar[dr, "i_2"'] + & + & \pi_1(U_1) \ast_{ \pi_1(U_1\cap U_2)} \pi_1(U_2) \ar[r, dashed, "\simeq"] + & \pi_1(X) \\ + & \pi_1(U_2) \ar[ur]\ar[urr, "j_2"', bend right=20] + & + & +\end{tikzcd} +\end{codeexample} + \subsection{Changing arrow tips} \label{sec:changing-arrow-tips} @@ -374,6 +368,8 @@ style key located in |/tikz/commutative diagrams|). \displayarrowstyle{maps to}\\ \displayarrowstyle{mapsto}\\ \displayarrowstyle{mapsfrom}\\ + \displayarrowstyle{Mapsto}\\ + \displayarrowstyle{Mapsfrom}\\ \end{tabular} \subsubsection*{Arrows with hook} @@ -432,18 +428,9 @@ style key located in |/tikz/commutative diagrams|). \end{tabular} \end{multicols} -A gray cross -(\begin{tikzpicture}[baseline=0pt, yshift=axis_height] - \pgfsetdash{}{0pt} \pgfsetlinewidth{0.8\pgflinewidth} - \pgfsetstrokecolor{gray} - \pgfpathmoveto{\pgfpoint{5\pgflinewidth}{5\pgflinewidth}} - \pgfpathlineto{\pgfpoint{-5\pgflinewidth}{-5\pgflinewidth}} - \pgfusepathqstroke - \pgfpathmoveto{\pgfpoint{-5\pgflinewidth}{5\pgflinewidth}} - \pgfpathlineto{\pgfpoint{5\pgflinewidth}{-5\pgflinewidth}} - \pgfusepathqstroke -\end{tikzpicture}) in the samples above indicates that the corresponding tip -is kept unchanged. This allows several arrow styles to be superimposed. +A gray cross (\tikz \path[/pgf/tips=true,gray x-] (0,0) -- (1mm,0);) +in the samples above indicates that the corresponding tip is kept +unchanged. This allows several arrow styles to be superimposed. \begin{codeexample}[] \begin{tikzcd} @@ -726,28 +713,21 @@ Section \ref*{pgfman-section-matrices}.3.2 of the \pgfname{} manual This key appends \meta{options} to the style |every arrow|. \end{key} -\begin{key}{/tikz/commutative diagrams/arrow style=\meta{style} (initially Computer Modern)} +\begin{key}{/tikz/commutative diagrams/arrow style=\meta{style}} This key determines which collection of arrow tips is used by the arrow tip selection styles listed in - \S\ref{sec:changing-arrow-tips}. Currently, \meta{style} can be one - of the following: + \S\ref{sec:changing-arrow-tips}. The initial setting is suitable + for documents using the Computer Modern font at any size. The + available choices for \meta{style} are: \begin{description} - \item[\texttt{Computer Modern}] This is the initial setting and is suitable - for documents using the Computer Modern font. - \item[\texttt{Latin Modern}] A small variant of the above, intended - for documents using the Latin Modern font. + \item[\texttt{Latin Modern}] A small variant of the initial + settings, intended for documents using the Latin Modern font at + any size. \item[\texttt{math font}] This setting uses the |Glyph| meta arrow tip described in \S\ref{sec:font-arrow-tips}. - \item[\texttt{arrows.meta}] This setting uses the arrow tips defined - in \tikzname's |arrows.meta| library (which has to be loaded - manually before setting this option). It honors the option - |/tikz/>|. \item[\texttt{tikz}] This setting uses the arrow tips defined in - \tikzname's older \texttt{arrows} library (which has to be loaded - manually before setting this option). It honors the option - |/tikz/>|. Unless you have backwards compatibility requirements, - you should use the \texttt{arrows.meta} option and library - instead. + \tikzname's |arrows.meta| library. It honors the option + |/tikz/>|. \end{description} \end{key} @@ -756,15 +736,13 @@ Modern, you may find the best results by selecting the |math font| style. As detailed in \S\ref{sec:font-arrow-tips}, this is not guaranteed to work perfectly with all fonts, but gives good results in many cases. If the \texttt{math font} style gives unsatisfactory -results, you can try selecting the \texttt{arrows.meta} style, and -setting |/tikz/>| to the value that best matches your font (among -those shown in \cite[\S\ref*{pgfman-section-arrows-meta}]{pgfman}). +results, you can try selecting the \texttt{tikz} style, and setting +|/tikz/>| to the value that best matches your font (among those shown +in \cite[\S\ref*{pgfman-section-arrows-meta}]{pgfman}). \begin{codeexample}[] -\usetikzlibrary{arrows.meta} - \tikzcdset{ - arrow style=arrows.meta, + arrow style=tikz, diagrams={>={Straight Barb[scale=0.8]}} } @@ -1173,7 +1151,7 @@ line to your document after all packages have been loaded: |\def\temp{&} \catcode`&=\active \let&=\temp| \end{quote} However, this may interfere in unexpected ways with other -packages. Use it at your own risk. +packages. Use this trick at your own risk. \section{Additional goodies} \label{sec:general-infra} @@ -1185,7 +1163,8 @@ its goals. These additional goodies are documented in this section. \label{sec:asymm-rect-shape} The following shape is used inside |{tikzcd}| to ensure that arrows -between nodes in the same row are horizontal. +between nodes in the same row are perfectly horizontal, even if the +nodes contain text with different heights and depths. \begin{shape}{asymmetrical rectangle} This shape is similar to the |rectangle| shape, but its |center| is @@ -1254,8 +1233,6 @@ The following arrow tips mimic the Computer Modern designs. It is useful to know that at size 10\,pt, the Computer Modern arrow stems are 0.4\,pt thick; for larger font sizes, this parameter should be scaled accordingly, or replaced by the equivalent figure 0.0928\,ex. -Two tips that look significantly different in the Latin Modern font -are also supplied. Notice that by using the mechanism explained in \S\ref{sec:changing-arrow-tips}, it is not necessary, and in fact not @@ -1268,19 +1245,15 @@ inside a |{tikzcd}|. \displayarrow[/tikz/commutative diagrams/double line]{cm implies}\\ \displayarrow[line width=1.5*rule_thickness]{cm bold to}\\ \displayarrow{cm double to}\\ - \displayarrow{cm left hook}\\ - \displayarrow{cm right hook}\\ + \displayarrow{cm to reversed}\\ \end{tabular} \begin{tabular}{ll} \displayarrow{cm bar}\\ -% \displayarrow{cm o}\\ -% \displayarrow{cm *}\\ \displayarrow{cm left to}\\ \displayarrow{cm right to}\\ - \displayarrow{cm to reversed}\\ - \displayarrow{lm left hook}\\ - \displayarrow{lm bar}\\ + \displayarrow{cm left hook}\\ + \displayarrow{cm right hook}\\ \end{tabular} \end{multicols} @@ -1380,7 +1353,7 @@ cases where unusual design choices are made. \bibitem{pgfman} Till Tantau, \emph{The \tikzname{} and \pgfname{} packages: Manual for version 3.0.0}. - Available at \url{http://www.ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf}. + Available at \url{http://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf}. \end{thebibliography} \printindex 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 cabf3aab1e4..191924cbf19 100644 --- a/Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty +++ b/Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty @@ -1,4 +1,4 @@ -% Copyright 2011, 2012, 2014 by Florêncio Neves +% Copyright 2011, 2012, 2014 by Florêncio Neves % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by @@ -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/02/28 v0.9 Commutative diagrams with tikz] +\ProvidesPackage{tikz-cd}[2014/03/08 v0.9b Commutative diagrams with tikz] \RequirePackage{tikz}[2013/12/13] % pgf version 3.0.0 required \usetikzlibrary{cd} diff --git a/Master/texmf-dist/tex/latex/tikz-cd/tikzlibrarycd.code.tex b/Master/texmf-dist/tex/latex/tikz-cd/tikzlibrarycd.code.tex deleted file mode 100644 index f14c162c5a9..00000000000 --- a/Master/texmf-dist/tex/latex/tikz-cd/tikzlibrarycd.code.tex +++ /dev/null @@ -1,683 +0,0 @@ -% Copyright 2011, 2012, 2014 by Florêncio Neves -% -% This program is free software: you can redistribute it and/or modify -% it under the terms of the GNU General Public License as published by -% the Free Software Foundation, either version 3 of the License, or -% (at your option) any later version. - -% This program is distributed in the hope that it will be useful, -% but WITHOUT ANY WARRANTY; without even the implied warranty of -% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -% GNU General Public License for more details. - -% You should have received a copy of the GNU General Public License -% along with this program. If not, see . - -\ProvidesFile{tikzlibrarycd.code.tex}[2014/02/28 v0.9 Commutative diagrams with tikz] - -\usetikzlibrary{matrix,quotes} - -\newif\iftikzcd@mathmode - -\def\tikzcdset{\pgfqkeys{/tikz/commutative diagrams}} - -\def\tikzcd@x@addto@macro#1#2{% - \pgfutil@toks@\expandafter{#1}% - \xdef#1{\the\pgfutil@toks@#2}} - -\tikzcdset{ - arrows/.code={\tikzcdset{every arrow/.append style={#1}}}, - labels/.code={\tikzcdset{every label/.append style={#1}}}, - cells/.code={\tikzcdset{every cell/.append style={#1}}}, - diagrams/.code={\tikzcdset{every diagram/.append style={#1}}}, - to/.code={% - \pgfutil@ifundefined{pgf@sh@ns@\tikzcdmatrixname-#1} - {\def\tikzcd@ar@target{#1}} - {\def\tikzcd@ar@target{\tikzcdmatrixname-#1}}}, - from/.code={% - \pgfutil@ifundefined{pgf@sh@ns@\tikzcdmatrixname-#1} - {\def\tikzcd@ar@start{#1}} - {\def\tikzcd@ar@start{\tikzcdmatrixname-#1}}}, - description/.style={ - /tikz/anchor=center, - /tikz/fill=\pgfkeysvalueof{/tikz/commutative diagrams/background color}}, - phantom/.style={ - /tikz/draw=none, - /tikz/commutative diagrams/labels={ - /tikz/font=, - /tikz/anchor=center}}, - crossing over/.style={ - /tikz/preaction={ - /tikz/draw=\pgfkeysvalueof{/tikz/commutative diagrams/background color}, - /tikz/arrows=-, - /tikz/line width=\pgfkeysvalueof{/tikz/commutative diagrams/crossing over clearance}}}, - row sep/.code={\tikzcd@sep{row}{#1}}, - column sep/.code={\tikzcd@sep{column}{#1}}, - math mode/.is if=tikzcd@mathmode, - arrow style/.is choice} - -\def\tikzcd@sep#1#2{ - \pgfkeysifdefined{/tikz/commutative diagrams/#1 sep/#2}% - {\pgfkeysgetvalue{/tikz/commutative diagrams/#1 sep/#2}\tikzcd@temp% - \pgfkeysalso{/tikz/#1 sep/.expand once=\tikzcd@temp}}% - {\pgfkeysalso{/tikz/#1 sep={#2}}}} - -% The unknown key handler and direction argument parser -\tikzcdset{ - .unknown/.code={% - \ifpgfkeysaddeddefaultpath% - \c@pgf@counta=0% - \c@pgf@countb=0% - \let\tikzcd@temp=\tikzcd@parse% - \expandafter\tikzcd@temp\pgfkeyscurrentname\relax% - \ifx\tikzcd@temp\pgfutil@empty% true if it was a direction parameter - \advance\c@pgf@counta by\tikzcd@currentrow% - \advance\c@pgf@countb by\tikzcd@currentcolumn% - \edef\tikzcd@ar@target{\tikzcdmatrixname-\the\c@pgf@counta-\the\c@pgf@countb}% - \else% - \pgfqkeys{/tikz}{\pgfkeyscurrentname={#1}}% - \fi% - \else% - \def\pgfutilnext{\pgfkeysvalueof{/handlers/.unknown/.@cmd}#1\pgfeov}\pgfutilnext% - \fi}} - -\def\tikzcd@parse#1{% parser for arrow direction argument - \ifx#1r\advance\c@pgf@countb by1\else% - \ifx#1d\advance\c@pgf@counta by1\else% - \ifx#1l\advance\c@pgf@countb by-1\else% - \ifx#1u\advance\c@pgf@counta by-1\else% - \ifx#1\relax\let\tikzcd@temp\pgfutil@empty% - \else\let\tikzcd@temp\pgfutil@gobble@until@relax\fi\fi\fi\fi\fi% - \tikzcd@temp} - -% The `tikzcd' environment -\def\tikzcd{% - \pgfutil@ifnextchar&% - {\expandafter\tikzcd@@\expandafter\pgfmatrixnextcell\pgfutil@gobble}% - {\tikzcd@@}} - -\def\tikzcd@@{\pgfutil@ifnextchar[{\tikzcd@}{\tikzcd@[]}} - -\def\tikzcd@[#1]{% - \tikzpicture[/tikz/commutative diagrams/.cd,every diagram,#1]% - \def\arrow{\tikzcd@arrow}% - \def\ar{\tikzcd@arrow}% - \def\rar{\tikzcd@xar{r}}% - \def\lar{\tikzcd@xar{l}}% - \def\dar{\tikzcd@xar{d}}% - \def\uar{\tikzcd@xar{u}}% - \def\urar{\tikzcd@xar{ur}}% - \def\ular{\tikzcd@xar{ul}}% - \def\drar{\tikzcd@xar{dr}}% - \def\dlar{\tikzcd@xar{dl}}% - \global\let\tikzcd@savedpaths\pgfutil@empty% - \matrix[/tikz/matrix of \iftikzcd@mathmode math \fi nodes, - /tikz/every cell/.append code={\tikzcdset{every cell}}, - /tikz/commutative diagrams/.cd,every matrix]% - \bgroup} - -\def\endtikzcd{% - \pgfmatrixendrow\egroup% - \pgfextra{\global\let\tikzcdmatrixname\tikzlastnode};% - \tikzcdset{\the\pgfmatrixcurrentrow-row diagram/.try}% - \begingroup% - \tikzcd@enablequotes% - \tikzcd@patcherrmsg% - \tikzcd@savedpaths% - \endgroup% - \endtikzpicture} - -% The arrow commands -\def\tikzcd@arrow{% - \relax% - \tikzcd@x@addto@macro\tikzcd@savedpaths{% - \noexpand\def\noexpand\tikzcd@currentcolumn{\the\pgfmatrixcurrentcolumn}% - \noexpand\def\noexpand\tikzcd@currentrow{\the\pgfmatrixcurrentrow}% - \noexpand\def\noexpand\tikzcd@lineno{\the\inputlineno}}% - \pgfutil@ifnextchar[{\tikzcd@@arrow}{\tikzcd@ar@old[]}} - -\def\tikzcd@@arrow[#1]{\pgfutil@ifnextchar\bgroup{\tikzcd@ar@old[#1]}{\tikzcd@ar@new[#1]}} - -\def\tikzcd@ar@new[#1]{% new syntax - \pgfutil@g@addto@macro\tikzcd@savedpaths{% - \path[/tikz/commutative diagrams/.cd,every arrow,#1]% - (\tikzcd@ar@start\tikzcd@startanchor) to (\tikzcd@ar@target\tikzcd@endanchor); }} - -\def\tikzcd@ar@old[#1]#2{% old syntax - \pgfutil@g@addto@macro\tikzcd@savedpaths{% - \path[/tikz/commutative diagrams/.cd,every arrow,{#2},#1] (\tikzcd@ar@start\tikzcd@startanchor) to }% - \pgfutil@ifnextchar[{\tikzcd@ar@getlabel}{\pgfutil@ifnextchar\bgroup{\tikzcd@ar@getlabel[]}{\tikzcd@ar@final}}} - -\def\tikzcd@ar@getlabel[#1]#2{% - \pgfutil@g@addto@macro\tikzcd@savedpaths{% - node[/tikz/commutative diagrams/.cd,every label,#1]{\tikzcd@mathmaybe{#2}}}% - \pgfutil@ifnextchar[{\tikzcd@ar@getlabel}{\pgfutil@ifnextchar\bgroup{\tikzcd@ar@getlabel[]}{\tikzcd@ar@final}}} - -\def\tikzcd@ar@final{% - \pgfutil@g@addto@macro\tikzcd@savedpaths{(\tikzcd@ar@target\tikzcd@endanchor); }} - -\def\tikzcd@xar#1{\relax\pgfutil@ifnextchar[{\tikzcd@@xar{#1}}{\tikzcd@arrow[]{#1}}} - -\def\tikzcd@@xar#1[#2]{\tikzcd@arrow[#2]{#1}} - -\def\tikzcd@mathmaybe#1{\iftikzcd@mathmode$\relax #1$\else#1\fi} - -\def\tikzcd@ar@target{\tikzcdmatrixname-\tikzcd@currentrow-\tikzcd@currentcolumn} -\def\tikzcd@ar@start{\tikzcdmatrixname-\tikzcd@currentrow-\tikzcd@currentcolumn} - -% `quotes' library support -\def\tikzcd@passquotes#1{\tikzset{every to/.append style={#1}}} - -\def\tikzcd@enablequotes{% - \pgfkeys{ - /handlers/first char syntax/the character "/.initial=\tikzcd@passquotes, - /tikz/edge quotes mean={% - edge node={node [/tikz/commutative diagrams/.cd,every label,##2]{\tikzcd@mathmaybe{##1}}}}}} - -% Improve error messages -\def\tikzcd@patcherrmsg{% - \let\tikzcd@errmessage\errmessage% - \def\errmessage##1{\tikzcd@errmessage{##1^^J...^^Jl.\tikzcd@lineno\space% - I think the culprit is a tikzcd arrow in cell \tikzcd@currentrow-\tikzcd@currentcolumn}}} - -% `start anchor', `end anchor', and `shift' keys -\def\tikzcd@setanchor#1[#2]#3\relax{% - \ifx\relax#2\relax\else% - \tikzcdset{@#1transform/.append style={#2},@shiftabletopath}% - \fi% - \ifx\relax#3\relax% - \pgfutil@namelet{tikzcd@#1anchor}{pgfutil@empty}% - \else% - \pgfutil@namedef{tikzcd@#1anchor}{.#3}% - \fi} - -\tikzcdset{ - @shiftabletopath/.style={ - /tikz/execute at begin to={% - \begingroup% - \def\tikz@tonodes{coordinate[pos=0,commutative diagrams/@starttransform/.try](tikzcd@nodea) % - coordinate[pos=1,commutative diagrams/@endtransform/.try](tikzcd@nodeb)}% - \path (\tikztostart) \tikz@to@path;% - \endgroup% - \def\tikztostart{tikzcd@nodea}% - \def\tikztotarget{tikzcd@nodeb}% - \tikzset{insert path={(tikzcd@nodea)}}}, - /tikz/commutative diagrams/@shiftabletopath/.code={}}, - start anchor/.code={% - \pgfutil@ifnextchar[{\tikzcd@setanchor{start}}{\tikzcd@setanchor{start}[]}#1\relax},%] - end anchor/.code={% - \pgfutil@ifnextchar[{\tikzcd@setanchor{end}}{\tikzcd@setanchor{end}[]}#1\relax},%] - start anchor=, - end anchor=, - shift left/.style={ - /tikz/commutative diagrams/@shiftabletopath, - /tikz/execute at begin to={% - \pgfpointnormalised{% - \pgfpointdiff{\pgfpointanchor{tikzcd@nodeb}{center}}{\pgfpointanchor{tikzcd@nodea}{center}}}% - \pgfgetlastxy{\tikzcd@x}{\tikzcd@y}% - \pgfmathparse{#1}% - \ifpgfmathunitsdeclared\else - \pgfmathparse{\pgfmathresult*\pgfkeysvalueof{/tikz/commutative diagrams/shift left/.@def}} - \fi - \coordinate (tikzcd@nodea) at ([shift={(\pgfmathresult*\tikzcd@y,-\pgfmathresult*\tikzcd@x)}]tikzcd@nodea);% - \coordinate (tikzcd@nodeb) at ([shift={(\pgfmathresult*\tikzcd@y,-\pgfmathresult*\tikzcd@x)}]tikzcd@nodeb);% - \tikzset{insert path={(tikzcd@nodea)}}}}, - shift right/.style={ - /tikz/commutative diagrams/shift left={-(#1)}}, - transform nodes/.style={ - /tikz/commutative diagrams/@shiftabletopath, - /tikz/commutative diagrams/@starttransform/.append style={#1}, - /tikz/commutative diagrams/@endtransform/.append style={#1}}, - shift/.style={ - /tikz/shift={#1},% we need this for labels to receive a shift - /tikz/commutative diagrams/transform nodes={/tikz/shift={#1}}}, - xshift/.style={ - /tikz/xshift={#1}, - /tikz/commutative diagrams/transform nodes={/tikz/xshift={#1}}}, - yshift/.style={ - /tikz/yshift={#1}, - /tikz/commutative diagrams/transform nodes={/tikz/yshift={#1}}}} - -% pgfmath functions to obtain math fontdimens -\pgfutil@ifluatex - - \directlua{tex.enableprimitives('tikzcd@', {'Umathaxis', 'Umathfractionrule'})} - - \pgfmathdeclarefunction{axis_height}{0}{% - \begingroup% - $\relax$% update fontdimens - \pgfmathreturn\the\tikzcd@Umathaxis\textstyle% - \endgroup} - - \pgfmathdeclarefunction{rule_thickness}{0}{% - \begingroup% - $\relax$% - \pgfmathreturn\the\tikzcd@Umathfractionrule\textstyle% - \endgroup} - -\else% if using (pdf)tex - - \pgfmathdeclarefunction{axis_height}{0}{% - \begingroup% - $\relax$% update fontdimens - \pgfmathreturn\the\fontdimen22\textfont2% - \endgroup} - - \pgfmathdeclarefunction{rule_thickness}{0}{% - \begingroup% - $\relax$% - \pgfmathreturn\the\fontdimen8\textfont3% - \endgroup} - -\fi - -% The shape used inside matrices -\pgfdeclareshape{asymmetrical rectangle} { - \inheritsavedanchors[from={rectangle}] - \inheritanchor[from={rectangle}]{base} - \inheritanchor[from={rectangle}]{north} - \inheritanchor[from={rectangle}]{south} - \inheritanchor[from={rectangle}]{base west} - \inheritanchor[from={rectangle}]{north west} - \inheritanchor[from={rectangle}]{south west} - \inheritanchor[from={rectangle}]{base east} - \inheritanchor[from={rectangle}]{north east} - \inheritanchor[from={rectangle}]{south east} - \inheritanchor[from={rectangle}]{mid} - \inheritanchor[from={rectangle}]{mid west} - \inheritanchor[from={rectangle}]{mid east} - \inheritbackgroundpath[from={rectangle}] - \anchor{center}{\pgf@anchor@rectangle@center\pgfmathsetlength\pgf@y% - {\pgfkeysvalueof{/tikz/commutative diagrams/center yshift}}} - \anchor{west}{\pgf@anchor@rectangle@west\pgfmathsetlength\pgf@y% - {\pgfkeysvalueof{/tikz/commutative diagrams/center yshift}}} - \anchor{east}{\pgf@anchor@rectangle@east\pgfmathsetlength\pgf@y% - {\pgfkeysvalueof{/tikz/commutative diagrams/center yshift}}} - \anchor{real center}{\pgf@anchor@rectangle@center} - \anchor{real west}{\pgf@anchor@rectangle@west} - \anchor{real east}{\pgf@anchor@rectangle@east} - \anchorborder{% - \pgfmathsetlength\pgfutil@tempdima% - {\pgfkeysvalueof{/tikz/commutative diagrams/center yshift}}% - \pgf@xb=\pgf@x% xb/yb is target - \pgf@yb=\pgf@y% - \southwest% - \pgf@xa=\pgf@x% xa/ya is se - \pgf@ya=\pgf@y% - \northeast% - \advance\pgf@x by-\pgf@xa% - \advance\pgf@y by-\pgf@ya% - \pgf@xc=.5\pgf@x% x/y is half width/height - \pgf@yc=.5\pgf@y% - \advance\pgf@xa by\pgf@xc% xa/ya becomes center - \advance\pgf@ya by\pgf@yc% - \ifdim\pgf@yb>0pt% - \northeast% - \pgf@yc=\pgf@y% - \advance\pgf@yc by-\pgfutil@tempdima% - \else% - \southwest% - \pgf@yc=-\pgf@y% - \advance\pgf@yc by\pgfutil@tempdima% - \fi - \edef\pgf@marshal{% - \noexpand\pgfpointborderrectangle - {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}} - {\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}% - }% - \pgf@process{\pgf@marshal}% - \advance\pgf@x by\pgf@xa% - \advance\pgf@y by\pgfutil@tempdima% - }% -}% - -% Computer modern arrow tips -\pgfdeclarearrow{ - name=cm to, - parameters={\ifpgfarrowharpoon h\fi}, - setup code={% - \pgfarrowssetbackend{-5.8\pgflinewidth}% - \pgfarrowssettipend{0.5\pgflinewidth}}, - drawing code={ - \pgfsetdash{}{+0pt}% - \pgfsetroundcap% - \pgfsetroundjoin% - \pgfpathmoveto{\pgfqpoint{-5.3\pgflinewidth}{6\pgflinewidth}}% - \pgfpathcurveto% - {\pgfqpoint{\ifpgfarrowharpoon-4\else-4.5\fi\pgflinewidth}{\ifpgfarrowharpoon3\else2.5\fi\pgflinewidth}}% - {\pgfqpoint{\ifpgfarrowharpoon-2\else-2.133\fi\pgflinewidth}{\ifpgfarrowharpoon1\else0.6\fi\pgflinewidth}}% - {\pgfpointorigin}% - \ifpgfarrowharpoon\else% - \pgfpathcurveto% - {\pgfqpoint{-2.133\pgflinewidth}{-0.6\pgflinewidth}}% - {\pgfqpoint{-4.5\pgflinewidth}{-2.5\pgflinewidth}}% - {\pgfqpoint{-5.3\pgflinewidth}{-6\pgflinewidth}}% - \fi% - \pgfusepathqstroke}} - -\pgfdeclarearrow{ - name=cm implies, - setup code={% - \pgfarrowssetbackend{\pgfinnerlinewidth\pgf@x=0.25\pgf@x\advance\pgf@x by-0.792\pgflinewidth}% - \pgfarrowssettipend{\pgfinnerlinewidth\pgf@x=-0.25\pgf@x\advance\pgf@x by1.094\pgflinewidth}}, - drawing code={% - \pgfutil@tempdima\pgflinewidth% - \pgfsetlinewidth{.5\pgflinewidth-.5*\pgfinnerlinewidth}% - \pgfsetdash{}{+0pt}% - \pgfsetroundcap% - \pgfsetroundjoin% - \pgfpathmoveto{\pgfqpoint{-0.542\pgfutil@tempdima}{1.1\pgfutil@tempdima}}% - \pgfpathcurveto% - {\pgfqpoint{-0.2\pgfutil@tempdima}{0.5\pgfutil@tempdima}}% - {\pgfqpoint{0.29\pgfutil@tempdima}{0.114\pgfutil@tempdima}}% - {\pgfqpoint{0.844\pgfutil@tempdima}{0pt}}% - \pgfpathcurveto% - {\pgfqpoint{0.29\pgfutil@tempdima}{-0.114\pgfutil@tempdima}}% - {\pgfqpoint{-0.2\pgfutil@tempdima}{-0.5\pgfutil@tempdima}}% - {\pgfqpoint{-0.542\pgfutil@tempdima}{-1.1\pgfutil@tempdima}}% - \pgfusepathqstroke}} - -\pgfdeclarearrow{ - name=cm bold to, - setup code={ - \pgfarrowssetbackend{-4.035\pgflinewidth} - \pgfarrowssettipend{0.5\pgflinewidth}}, - drawing code={% - \pgfutil@tempdima=0.667\pgflinewidth% - \pgfsetdash{}{+0pt} - \pgfsetroundcap - \pgfsetroundjoin - \pgfpathmoveto{\pgfqpoint{-5.3\pgfutil@tempdima}{6\pgfutil@tempdima}} - \pgfpathcurveto - {\pgfqpoint{-4.5\pgfutil@tempdima}{2.5\pgfutil@tempdima}} - {\pgfqpoint{-2.133\pgfutil@tempdima}{0.6\pgfutil@tempdima}} - {\pgfpointorigin} - \pgfpathcurveto - {\pgfqpoint{-2.133\pgfutil@tempdima}{-0.6\pgfutil@tempdima}} - {\pgfqpoint{-4.5\pgfutil@tempdima}{-2.5\pgfutil@tempdima}} - {\pgfqpoint{-5.3\pgfutil@tempdima}{-6\pgfutil@tempdima}} - \pgfusepathqstroke}} - -\pgfdeclarearrow{, - name=cm bar, - setup code={% - \pgfarrowssetbackend{-0.5\pgflinewidth}% - \pgfarrowssettipend{0.5\pgflinewidth}}, - drawing code={% - \pgfsetdash{}{+0pt}% - \pgfsetroundcap% - \pgfpathmoveto{\pgfqpoint{0pt}{-4.1\pgflinewidth}}% - \pgfpathlineto{\pgfqpoint{0pt}{4.1\pgflinewidth}}% - \pgfusepathqstroke}} - -\pgfdeclarearrow{ - name=cm left hook, - setup code={% - \pgfarrowssetbackend{-0.5\pgflinewidth}% - \pgfarrowssettipend{3.5\pgflinewidth}}, - drawing code={% - \pgfsetdash{}{+0pt}% - \pgfsetroundcap% - \pgfpathmoveto{\pgfqpoint{0pt}{4.8\pgflinewidth}}% - \pgfpathcurveto% - {\pgfqpoint{4\pgflinewidth}{4.8\pgflinewidth}}% - {\pgfqpoint{4\pgflinewidth}{0pt}}% - {\pgfpointorigin}% - \pgfusepathqstroke}} - -\pgfdeclarearrow{ - name=cm *, - parameters={\ifpgfarrowopen o\fi}, - setup code={ - \pgfarrowssetbackend{-.5\pgflinewidth} - \pgfarrowssettipend{7.167\pgflinewidth}}, - drawing code={ - \pgfpathcircle{\pgfqpoint{3.333\pgflinewidth}{0pt}}{3.333\pgflinewidth} - \ifpgfarrowopen\pgfusepathqstroke\else\pgfusepathqfillstroke\fi}} - -\pgfdeclarearrow{ - name=lm left hook, - setup code={ - \pgfarrowssetbackend{+-2\pgflinewidth}% - \pgfarrowssettipend{+3.5\pgflinewidth}}, - drawing code={ - \pgfsetdash{}{+0pt} - \pgfsetroundcap - \pgfpathmoveto{\pgfqpoint{+-1.5\pgflinewidth}{+7\pgflinewidth}} - \pgfpathcurveto - {\pgfqpoint{+4.3\pgflinewidth}{+7\pgflinewidth}} - {\pgfqpoint{+4.3\pgflinewidth}{+\pgflinewidth}} - {\pgfpointorigin} - \pgfusepathqstroke}} - -\pgfdeclarearrow{ - name=lm bar, - setup code={% - \pgfarrowssetbackend{+-0.5\pgflinewidth}% - \pgfarrowssettipend{+0.5\pgflinewidth}}, - drawing code={% - \pgfsetdash{}{+0pt}% - \pgfsetroundcap% - \pgfpathmoveto{\pgfqpoint{0pt}{-6\pgflinewidth}}% - \pgfpathlineto{\pgfqpoint{0pt}{6\pgflinewidth}}% - \pgfusepathqstroke}} - -\pgfkeys{ - cm left to/.tip={cm to[left]}, - cm right to/.tip={cm to[right]}, - cm right hook/.tip={cm left hook[swap]}, - cm double to/.tip={cm to[sep=0pt -2.8]cm to}, - cm to reversed/.tip={cm to[reversed]}, - cm o/.tip={cm *[open]}, - cm |/.tip={cm bar}}%| - -% The `Glyph' meta arrow tip -\pgfqkeys{/pgf/arrow keys}{ - glyph math command/.code={\pgfarrowsaddtooptions{\def\tikzcd@glyph{$\csname #1\endcsname$}}}, - glyph axis/.code={\pgfarrowsaddtooptions{\pgfmathsetlengthmacro\tikzcd@glyph@axis{#1}}}, - glyph length/.code={\pgfarrowsaddtooptions{\pgfmathsetlengthmacro\tikzcd@glyph@len{#1}}}, - glyph shorten/.code={\pgfarrowsaddtooptions{\pgfmathsetlengthmacro\tikzcd@glyph@shorten{#1}}}} - -\pgfdeclarearrow{ - name=Glyph, - cache=false, - bending mode=none, - parameters={\tikzcd@glyph@len,\tikzcd@glyph@shorten}, - setup code={ - \pgfarrowssettipend{\tikzcd@glyph@len\advance\pgf@x by\tikzcd@glyph@shorten}}, - defaults={ - glyph axis=axis_height, - glyph length=+0.9ex, - glyph shorten=+-0.1ex}, - drawing code={ - \pgfpathrectangle{\pgfpoint{+0pt}{+-1ex}}{\pgfpoint{+\tikzcd@glyph@len}{+2ex}}% - \pgfusepathqclip% - \pgftransformxshift{+\tikzcd@glyph@len}% - \pgftransformyshift{+-\tikzcd@glyph@axis}% - \pgftext[right,base]{\tikzcd@glyph}}} - -% ConTeXt-specific stuff -\pgfutil@IfUndefined{starttikzpicture}{}{% - \def\starttikzcd{\tikzcd}% - \def\stoptikzcd{\endtikzcd}} - -% Generic arrow tip selection styles -\tikzcdset{ - arrow style/.initialize/.style={ - double line/.code={\tikzset{double=\pgfkeysvalueof{/tikz/commutative diagrams/background color}}}, - squiggly/.default={}, - tikzcd to/.tip={>}, - tikzcd bar/.tip={cm bar}, - tikzcd left hook/.tip={cm left hook}, - tikzcd right hook/.tip={tikzcd left hook[swap]}, - tikzcd left to/.tip={tikzcd to[harpoon]}, - tikzcd right to/.tip={tikzcd left to[swap]}, - tikzcd double to/.tip={tikzcd to[]tikzcd to}, - tikzcd to reversed/.tip={tikzcd to[reversed]}, - tikzcd cap/.tip={}, - tikzcd implies cap/.tip={}, - tikzcd implies/.tip={cm implies}}, - no tail/.code={\pgfsetarrowsstart{tikzcd cap}}, - to head/.code={\pgfsetarrowsend{tikzcd to}}, - maps to/.code={\pgfsetarrowsstart{tikzcd bar}}, - hook/.code={\pgfsetarrowsstart{tikzcd right hook}}, - hook'/.code={\pgfsetarrowsstart{tikzcd left hook}}, - harpoon/.code={\pgfsetarrowsend{tikzcd left to}}, - harpoon'/.code={\pgfsetarrowsend{tikzcd right to}}, - two heads/.code={\pgfsetarrowsend{tikzcd double to}}, - tail/.code={\pgfsetarrowsstart{tikzcd to reversed}}, - rightarrow/.code={\pgfsetarrows{tikzcd cap-tikzcd to}}, - Rightarrow/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies cap-tikzcd implies}}, - leftarrow/.code={\pgfsetarrows{tikzcd to-tikzcd cap}}, - Leftarrow/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies-tikzcd implies cap}}, - leftrightarrow/.code={\pgfsetarrows{tikzcd to-tikzcd to}}, - Leftrightarrow/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies-tikzcd implies}}, - mapsto/.code={\pgfsetarrows{tikzcd bar-tikzcd to}}, - mapsfrom/.code={\pgfsetarrows{tikzcd to-tikzcd bar}}, - hookrightarrow/.code={\pgfsetarrows{tikzcd right hook-tikzcd to}}, - hookleftarrow/.code={\pgfsetarrows{tikzcd to-tikzcd left hook}}, - rightharpoonup/.code={\pgfsetarrows{tikzcd cap-tikzcd left to}}, - rightharpoondown/.code={\pgfsetarrows{tikzcd cap-tikzcd right to}}, - leftharpoonup/.code={\pgfsetarrows{tikzcd right to-tikzcd cap}}, - leftharpoondown/.code={\pgfsetarrows{tikzcd left to-tikzcd cap}}, - rightarrowtail/.code={\pgfsetarrows{tikzcd to reversed-tikzcd to}}, - leftarrowtail/.code={\pgfsetarrows{tikzcd to-tikzcd to reversed}}, - twoheadrightarrow/.code={\pgfsetarrows{tikzcd cap-tikzcd double to}}, - twoheadleftarrow/.code={\pgfsetarrows{tikzcd double to-tikzcd cap}}, - no head/.code={\pgfsetarrowsend{tikzcd cap}}, - dash/.code={\pgfsetarrows{tikzcd cap-tikzcd cap}}, - dashrightarrow/.code={\tikzcdset{rightarrow,dashed}}, - dashleftarrow/.code={\tikzcdset{leftarrow,dashed}}, - equal/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies cap-tikzcd implies cap}}, - equals/.code={\tikzcdset{equal}}, - rightsquigarrow/.code={\tikzcdset{rightarrow,squiggly}}, - leftsquigarrow/.code={\tikzcdset{leftarrow,squiggly}}, - leftrightsquigarrow/.code={\tikzcdset{leftrightarrow,squiggly}}, - squiggly/.code={% - \pgfutil@ifundefined{tikz@library@decorations.pathmorphing@loaded}% - {\pgfutil@packageerror{tikz-cd}{You need to say % - \string\usetikzlibrary{decorations.pathmorphing} to use squiggly arrows}{}}{}% - \pgfkeysalso{ - /tikz/decorate, - /tikz/decoration={ - zigzag, - segment length=9.25\pgflinewidth, - amplitude=1.9\pgflinewidth, - post=lineto, post length=6\pgflinewidth, - pre=lineto, pre length=6\pgflinewidth, - #1}}}} - -% The `Computer Modern' arrow style -\pgfkeysdef{/tikz/commutative diagrams/arrow style/Computer Modern}{% - \tikzcdset{ - arrow style/.initialize, - double line/.append code={\tikzset{double distance=3.85\pgflinewidth}}, - tikzcd to/.tip={cm to}, - tikzcd double to/.tip={cm double to}, - dashed/.style={/tikz/dash pattern={on 7\pgflinewidth off 4\pgflinewidth}}}} - -% The `Latin Modern' arrow style -\pgfkeysdef{/tikz/commutative diagrams/arrow style/Latin Modern}{% - \tikzcdset{ - arrow style=Computer Modern, - tikzcd left hook/.tip={lm left hook}, - tikzcd bar/.tip={lm bar}}} - -% The `math font' arrow style -% -% The method used to guess the correct value of `double distance' -% inside the `double line' style is not robust at all. If it fails, -% set -% \tikzcdset{double line/.append style={double distance=2*rule_thickness}} -% and find the correct value for `double distance' by trial and error -% (or measure the distance between the \Rightarrow stems in a font -% editor). -\pgfkeysdef{/tikz/commutative diagrams/arrow style/math font}{% - \pgfutil@IfUndefined{mapsfrom} - {\def\tikzcd@mapsfrom{\pgfpicture\pgfsetbaseline{+0pt}\pgftransformxscale{-1}\pgftext[base]{$\mapsto$}\endpgfpicture}} - {\def\tikzcd@mapsfrom{\mapsfrom}} - \tikzcdset{ - arrow style/.initialize, - tikzcd to/.tip={Glyph[glyph math command=rightarrow]}, - tikzcd cap/.tip={Glyph[glyph math command=leftarrow]}, - tikzcd to reversed/.tip={Glyph[glyph math command=leftarrowtail]}, - tikzcd bar/.tip={Glyph[glyph math command=tikzcd@mapsfrom]}, - tikzcd left hook/.tip={Glyph[glyph math command=hookleftarrow]}, - tikzcd right hook/.tip={Glyph[glyph math command=hookleftarrow, swap]}, - tikzcd implies/.tip={Glyph[glyph math command=Rightarrow, glyph length=1.2ex]}, - tikzcd implies cap/.tip={Glyph[glyph math command=Leftarrow]}, - tikzcd double to/.tip={Glyph[glyph math command=twoheadrightarrow, glyph length=1.4ex]}, - tikzcd left to/.tip={Glyph[glyph math command=rightharpoonup]}, - tikzcd right to/.tip={Glyph[glyph math command=rightharpoonup,swap]}, - double line/.append code={\tikzset{double distance={2*(height("$=$")-axis_height-rule_thickness)}}}, - dashed/.code={\tikzset{dash pattern=on 0.8ex off 0.4ex, dash phase=0.8ex}}, - squiggly/.default={pre length=1ex, post length=1ex}}} - -% The `arrows.meta' arrow style -\pgfkeysdef{/tikz/commutative diagrams/arrow style/arrows.meta}{% - \pgfutil@ifundefined{tikz@library@arrows.meta@loaded}% - {\pgfutil@packageerror{tikz-cd}{You need to say % - \string\usetikzlibrary{arrows.meta} to use the `arrows.meta' arrow style}{}}{}% - \tikzcdset{ - arrow style/.initialize, - double line/.append style={/tikz/double equal sign distance}, - tikzcd bar/.tip={Bar}, - tikzcd left hook/.tip={Hooks[harpoon]}, - tikzcd implies/.tip={Implies}, - dashed/.style={/tikz/dashed}}} - -% The `tikz' arrow style -\pgfkeysdef{/tikz/commutative diagrams/arrow style/tikz}{% - \pgfutil@ifundefined{tikz@library@arrows@loaded}% - {\pgfutil@packageerror{tikz-cd}{You need to say % - \string\usetikzlibrary{arrows} to use the `tikz' arrow style}{}}{}% - \tikzcdset{ - arrow style/.initialize, - double line/.append style={/tikz/double equal sign distance}, - tikzcd bar/.tip={|},%| - tikzcd left hook/.tip={left hook}, - tikzcd left to/.tip={left to}, - tikzcd implies/.tip={implies}, - dashed/.style={/tikz/dashed}}} - -% Default settings -\tikzcdset{ - every arrow/.style={ - /tikz/draw, - /tikz/line width=rule_thickness, - /tikz/commutative diagrams/rightarrow}, - every label/.style={ - /tikz/auto, - /tikz/font=\everymath\expandafter{\the\everymath\scriptstyle}, - /tikz/inner sep=+0.5ex}, - every cell/.style={ - /tikz/shape={asymmetrical rectangle}, - /tikz/inner xsep=+1ex, - /tikz/inner ysep=+0.85ex}, - every matrix/.style={/tikz/inner sep=+0pt}, - every diagram/.style={ - /tikz/commutative diagrams/row sep=normal, - /tikz/commutative diagrams/column sep=normal, - /tikz/baseline=+0pt}, - arrow style=Computer Modern, - 1-row diagram/.style={/tikz/baseline=(\tikzcdmatrixname.base)}, - math mode=true, - center yshift/.initial=axis_height, - row sep/huge/.initial=+3.6em, - row sep/large/.initial=+2.7em, - row sep/normal/.initial=+1.8em, - row sep/scriptsize/.initial=+1.35em, - row sep/small/.initial=+0.9em, - row sep/tiny/.initial=+0.45em, - column sep/huge/.initial=+4.8em, - column sep/large/.initial=+3.6em, - column sep/normal/.initial=+2.4em, - column sep/scriptsize/.initial=+1.8em, - column sep/small/.initial=+1.2em, - column sep/tiny/.initial=+0.6em, - crossing over clearance/.initial=+1.5ex, - shift left/.default=+0.56ex, - shift right/.default=1, - background color/.initial=white} - -\endinput diff --git a/Master/texmf-dist/tex/tex/generic/tikz-cd/tikzlibrarycd.code.tex b/Master/texmf-dist/tex/tex/generic/tikz-cd/tikzlibrarycd.code.tex new file mode 100644 index 00000000000..43b204c29e2 --- /dev/null +++ b/Master/texmf-dist/tex/tex/generic/tikz-cd/tikzlibrarycd.code.tex @@ -0,0 +1,540 @@ +% tikzlibrarycd.code.tex [2014/03/08 v0.9b Commutative diagrams with tikz] +% +% Copyright 2011, 2012, 2014 by Florêncio Neves +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . + +\usetikzlibrary{matrix,quotes,arrows.meta} + +\newif\iftikzcd@mathmode + +\def\tikzcdset{\pgfqkeys{/tikz/commutative diagrams}} + +\def\tikzcd@x@addto@macro#1#2{% + \pgfutil@toks@\expandafter{#1}% + \xdef#1{\the\pgfutil@toks@#2}} + +\tikzcdset{ + arrows/.code={\tikzcdset{every arrow/.append style={#1}}}, + labels/.code={\tikzcdset{every label/.append style={#1}}}, + cells/.code={\tikzcdset{every cell/.append style={#1}}}, + diagrams/.code={\tikzcdset{every diagram/.append style={#1}}}, + to/.code={% + \pgfutil@ifundefined{pgf@sh@ns@\tikzcdmatrixname-#1} + {\def\tikzcd@ar@target{#1}} + {\def\tikzcd@ar@target{\tikzcdmatrixname-#1}}}, + from/.code={% + \pgfutil@ifundefined{pgf@sh@ns@\tikzcdmatrixname-#1} + {\def\tikzcd@ar@start{#1}} + {\def\tikzcd@ar@start{\tikzcdmatrixname-#1}}}, + description/.style={ + /tikz/anchor=center, + /tikz/fill=\pgfkeysvalueof{/tikz/commutative diagrams/background color}}, + phantom/.style={ + /tikz/draw=none, + /tikz/commutative diagrams/labels={ + /tikz/font=, + /tikz/anchor=center}}, + crossing over/.style={ + /tikz/preaction={ + /tikz/draw=\pgfkeysvalueof{/tikz/commutative diagrams/background color}, + /tikz/arrows=-, + /tikz/line width=\pgfkeysvalueof{/tikz/commutative diagrams/crossing over clearance}}}, + row sep/.code={\tikzcd@sep{row}{#1}}, + column sep/.code={\tikzcd@sep{column}{#1}}, + math mode/.is if=tikzcd@mathmode, + arrow style/.is choice} + +\def\tikzcd@sep#1#2{ + \pgfkeysifdefined{/tikz/commutative diagrams/#1 sep/#2}% + {\pgfkeysgetvalue{/tikz/commutative diagrams/#1 sep/#2}\tikzcd@temp% + \pgfkeysalso{/tikz/#1 sep/.expand once=\tikzcd@temp}}% + {\pgfkeysalso{/tikz/#1 sep={#2}}}} + +% The unknown key handler and direction argument parser +\tikzcdset{ + .unknown/.code={% + \ifpgfkeysaddeddefaultpath% + \c@pgf@counta=0% + \c@pgf@countb=0% + \let\tikzcd@temp=\tikzcd@parse% + \expandafter\tikzcd@temp\pgfkeyscurrentname\relax% + \ifx\tikzcd@temp\pgfutil@empty% true if it was a direction parameter + \advance\c@pgf@counta by\tikzcd@currentrow% + \advance\c@pgf@countb by\tikzcd@currentcolumn% + \edef\tikzcd@ar@target{\tikzcdmatrixname-\the\c@pgf@counta-\the\c@pgf@countb}% + \else% + \pgfqkeys{/tikz}{\pgfkeyscurrentname={#1}}% + \fi% + \else% + \def\pgfutilnext{\pgfkeysvalueof{/handlers/.unknown/.@cmd}#1\pgfeov}\pgfutilnext% + \fi}} + +\def\tikzcd@parse#1{% parser for arrow direction argument + \ifx#1r\advance\c@pgf@countb by1\else% + \ifx#1d\advance\c@pgf@counta by1\else% + \ifx#1l\advance\c@pgf@countb by-1\else% + \ifx#1u\advance\c@pgf@counta by-1\else% + \ifx#1\relax\let\tikzcd@temp\pgfutil@empty% + \else\let\tikzcd@temp\pgfutil@gobble@until@relax\fi\fi\fi\fi\fi% + \tikzcd@temp} + +% The `tikzcd' environment +\def\tikzcd{% + \iffalse{\fi\ifnum0=`}\fi% standard trick to allow nesting of tabular-like environments (cf. the tabularx manual) + \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@[#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}}% + \def\lar{\tikzcd@xar{l}}% + \def\dar{\tikzcd@xar{d}}% + \def\uar{\tikzcd@xar{u}}% + \def\urar{\tikzcd@xar{ur}}% + \def\ular{\tikzcd@xar{ul}}% + \def\drar{\tikzcd@xar{dr}}% + \def\dlar{\tikzcd@xar{dl}}% + \global\let\tikzcd@savedpaths\pgfutil@empty% + \matrix[/tikz/matrix of \iftikzcd@mathmode math \fi nodes, + /tikz/every cell/.append code={\tikzcdset{every cell}}, + /tikz/commutative diagrams/.cd,every matrix]% + \bgroup} + +\def\endtikzcd{% + \pgfmatrixendrow\egroup% + \pgfextra{\global\let\tikzcdmatrixname\tikzlastnode};% + \tikzcdset{\the\pgfmatrixcurrentrow-row diagram/.try}% + \begingroup% + \tikzcd@enablequotes% + \tikzcd@patcherrmsg% + \tikzcd@savedpaths% + \endgroup% + \endtikzpicture% + \ifnum0=`{}\fi} + +% The arrow commands +\def\tikzcd@arrow{% + \relax% + \tikzcd@x@addto@macro\tikzcd@savedpaths{% + \noexpand\def\noexpand\tikzcd@currentcolumn{\the\pgfmatrixcurrentcolumn}% + \noexpand\def\noexpand\tikzcd@currentrow{\the\pgfmatrixcurrentrow}% + \noexpand\def\noexpand\tikzcd@lineno{\the\inputlineno}}% + \pgfutil@ifnextchar[{\tikzcd@@arrow}{\tikzcd@ar@old[]}} + +\def\tikzcd@@arrow[#1]{\pgfutil@ifnextchar\bgroup{\tikzcd@ar@old[#1]}{\tikzcd@ar@new[#1]}} + +\def\tikzcd@ar@new[#1]{% new syntax + \pgfutil@g@addto@macro\tikzcd@savedpaths{% + \path[/tikz/commutative diagrams/.cd,every arrow,#1]% + (\tikzcd@ar@start\tikzcd@startanchor) to (\tikzcd@ar@target\tikzcd@endanchor); }} + +\def\tikzcd@ar@old[#1]#2{% old syntax + \pgfutil@g@addto@macro\tikzcd@savedpaths{% + \path[/tikz/commutative diagrams/.cd,every arrow,{#2},#1] (\tikzcd@ar@start\tikzcd@startanchor) to }% + \pgfutil@ifnextchar[{\tikzcd@ar@getlabel}{\pgfutil@ifnextchar\bgroup{\tikzcd@ar@getlabel[]}{\tikzcd@ar@final}}} + +\def\tikzcd@ar@getlabel[#1]#2{% + \pgfutil@g@addto@macro\tikzcd@savedpaths{% + node[/tikz/commutative diagrams/.cd,every label,#1]{\tikzcd@mathmaybe{#2}}}% + \pgfutil@ifnextchar[{\tikzcd@ar@getlabel}{\pgfutil@ifnextchar\bgroup{\tikzcd@ar@getlabel[]}{\tikzcd@ar@final}}} + +\def\tikzcd@ar@final{% + \pgfutil@g@addto@macro\tikzcd@savedpaths{(\tikzcd@ar@target\tikzcd@endanchor); }} + +\def\tikzcd@xar#1{\relax\pgfutil@ifnextchar[{\tikzcd@@xar{#1}}{\tikzcd@arrow[]{#1}}} + +\def\tikzcd@@xar#1[#2]{\tikzcd@arrow[#2]{#1}} + +\def\tikzcd@mathmaybe#1{\iftikzcd@mathmode$\relax #1$\else#1\fi} + +\def\tikzcd@ar@target{\tikzcdmatrixname-\tikzcd@currentrow-\tikzcd@currentcolumn} +\def\tikzcd@ar@start{\tikzcdmatrixname-\tikzcd@currentrow-\tikzcd@currentcolumn} + +% `quotes' library support +\def\tikzcd@passquotes#1{\tikzset{every to/.append style={#1}}} + +\def\tikzcd@enablequotes{% + \pgfkeys{ + /handlers/first char syntax/the character "/.initial=\tikzcd@passquotes, + /tikz/edge quotes mean={% + edge node={node [/tikz/commutative diagrams/.cd,every label,##2]{\tikzcd@mathmaybe{##1}}}}}} + +% Improve error messages +\def\tikzcd@patcherrmsg{% + \let\tikzcd@errmessage\errmessage% + \def\errmessage##1{\tikzcd@errmessage{##1^^J...^^Jl.\tikzcd@lineno\space% + I think the culprit is a tikzcd arrow in cell \tikzcd@currentrow-\tikzcd@currentcolumn}}} + +% `start anchor', `end anchor', and `shift' keys +\def\tikzcd@setanchor#1[#2]#3\relax{% + \ifx\relax#2\relax\else% + \tikzcdset{@#1transform/.append style={#2},@shiftabletopath}% + \fi% + \ifx\relax#3\relax% + \pgfutil@namelet{tikzcd@#1anchor}{pgfutil@empty}% + \else% + \pgfutil@namedef{tikzcd@#1anchor}{.#3}% + \fi} + +\tikzcdset{ + @shiftabletopath/.style={ + /tikz/execute at begin to={% + \begingroup% + \def\tikz@tonodes{coordinate[pos=0,commutative diagrams/@starttransform/.try](tikzcd@nodea) % + coordinate[pos=1,commutative diagrams/@endtransform/.try](tikzcd@nodeb)}% + \path (\tikztostart) \tikz@to@path;% + \endgroup% + \def\tikztostart{tikzcd@nodea}% + \def\tikztotarget{tikzcd@nodeb}% + \tikzset{insert path={(tikzcd@nodea)}}}, + /tikz/commutative diagrams/@shiftabletopath/.code={}}, + start anchor/.code={% + \pgfutil@ifnextchar[{\tikzcd@setanchor{start}}{\tikzcd@setanchor{start}[]}#1\relax},%] + end anchor/.code={% + \pgfutil@ifnextchar[{\tikzcd@setanchor{end}}{\tikzcd@setanchor{end}[]}#1\relax},%] + start anchor=, + end anchor=, + shift left/.style={ + /tikz/commutative diagrams/@shiftabletopath, + /tikz/execute at begin to={% + \pgfpointnormalised{% + \pgfpointdiff{\pgfpointanchor{tikzcd@nodeb}{center}}{\pgfpointanchor{tikzcd@nodea}{center}}}% + \pgfgetlastxy{\tikzcd@x}{\tikzcd@y}% + \pgfmathparse{#1}% + \ifpgfmathunitsdeclared\else + \pgfmathparse{\pgfmathresult*\pgfkeysvalueof{/tikz/commutative diagrams/shift left/.@def}} + \fi + \coordinate (tikzcd@nodea) at ([shift={(\pgfmathresult*\tikzcd@y,-\pgfmathresult*\tikzcd@x)}]tikzcd@nodea);% + \coordinate (tikzcd@nodeb) at ([shift={(\pgfmathresult*\tikzcd@y,-\pgfmathresult*\tikzcd@x)}]tikzcd@nodeb);% + \tikzset{insert path={(tikzcd@nodea)}}}}, + shift right/.style={ + /tikz/commutative diagrams/shift left={-(#1)}}, + transform nodes/.style={ + /tikz/commutative diagrams/@shiftabletopath, + /tikz/commutative diagrams/@starttransform/.append style={#1}, + /tikz/commutative diagrams/@endtransform/.append style={#1}}, + shift/.style={ + /tikz/shift={#1},% we need this for labels to receive a shift + /tikz/commutative diagrams/transform nodes={/tikz/shift={#1}}}, + xshift/.style={ + /tikz/xshift={#1}, + /tikz/commutative diagrams/transform nodes={/tikz/xshift={#1}}}, + yshift/.style={ + /tikz/yshift={#1}, + /tikz/commutative diagrams/transform nodes={/tikz/yshift={#1}}}} + +% pgfmath functions to obtain math fontdimens +\pgfutil@ifluatex + + \directlua{tex.enableprimitives('tikzcd@', {'Umathaxis', 'Umathfractionrule'})} + + \pgfmathdeclarefunction{axis_height}{0}{% + \begingroup% + $\relax$% update fontdimens + \pgfmathreturn\the\tikzcd@Umathaxis\textstyle% + \endgroup} + + \pgfmathdeclarefunction{rule_thickness}{0}{% + \begingroup% + $\relax$% + \pgfmathreturn\the\tikzcd@Umathfractionrule\textstyle% + \endgroup} + +\else% if using (pdf)tex + + \pgfmathdeclarefunction{axis_height}{0}{% + \begingroup% + $\relax$% update fontdimens + \pgfmathreturn\the\fontdimen22\textfont2% + \endgroup} + + \pgfmathdeclarefunction{rule_thickness}{0}{% + \begingroup% + $\relax$% + \pgfmathreturn\the\fontdimen8\textfont3% + \endgroup} + +\fi + +% The shape used inside matrices +\pgfdeclareshape{asymmetrical rectangle} { + \inheritsavedanchors[from={rectangle}] + \inheritanchor[from={rectangle}]{base} + \inheritanchor[from={rectangle}]{north} + \inheritanchor[from={rectangle}]{south} + \inheritanchor[from={rectangle}]{base west} + \inheritanchor[from={rectangle}]{north west} + \inheritanchor[from={rectangle}]{south west} + \inheritanchor[from={rectangle}]{base east} + \inheritanchor[from={rectangle}]{north east} + \inheritanchor[from={rectangle}]{south east} + \inheritanchor[from={rectangle}]{mid} + \inheritanchor[from={rectangle}]{mid west} + \inheritanchor[from={rectangle}]{mid east} + \inheritbackgroundpath[from={rectangle}] + \anchor{center}{\pgf@anchor@rectangle@center\pgfmathsetlength\pgf@y% + {\pgfkeysvalueof{/tikz/commutative diagrams/center yshift}}} + \anchor{west}{\pgf@anchor@rectangle@west\pgfmathsetlength\pgf@y% + {\pgfkeysvalueof{/tikz/commutative diagrams/center yshift}}} + \anchor{east}{\pgf@anchor@rectangle@east\pgfmathsetlength\pgf@y% + {\pgfkeysvalueof{/tikz/commutative diagrams/center yshift}}} + \anchor{real center}{\pgf@anchor@rectangle@center} + \anchor{real west}{\pgf@anchor@rectangle@west} + \anchor{real east}{\pgf@anchor@rectangle@east} + \anchorborder{% + \pgfmathsetlength\pgfutil@tempdima% + {\pgfkeysvalueof{/tikz/commutative diagrams/center yshift}}% + \pgf@xb=\pgf@x% xb/yb is target + \pgf@yb=\pgf@y% + \southwest% + \pgf@xa=\pgf@x% xa/ya is se + \pgf@ya=\pgf@y% + \northeast% + \advance\pgf@x by-\pgf@xa% + \advance\pgf@y by-\pgf@ya% + \pgf@xc=.5\pgf@x% x/y is half width/height + \pgf@yc=.5\pgf@y% + \advance\pgf@xa by\pgf@xc% xa/ya becomes center + \advance\pgf@ya by\pgf@yc% + \ifdim\pgf@yb>0pt% + \northeast% + \pgf@yc=\pgf@y% + \advance\pgf@yc by-\pgfutil@tempdima% + \else% + \southwest% + \pgf@yc=-\pgf@y% + \advance\pgf@yc by\pgfutil@tempdima% + \fi + \edef\pgf@marshal{% + \noexpand\pgfpointborderrectangle + {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}} + {\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}% + }% + \pgf@process{\pgf@marshal}% + \advance\pgf@x by\pgf@xa% + \advance\pgf@y by\pgfutil@tempdima% + }% +}% + +% 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]}, + cm bold to/.tip={cm to[scale=0.667]}, + cm double to/.tip={cm to[sep=+0pt -2.6]cm to}, + cm bar/.tip={Bar[width=+0pt 8.2 0.89,line cap=round]}, + cm left hook/.tip={Hooks[width=+0pt 10.8,length=+0pt 3.6,harpoon,line cap=round]}, + cm implies/.tip={Implies}, + cm left to/.tip={cm to[left]}, + cm right to/.tip={cm to[right]}, + cm right hook/.tip={cm left hook[swap]}, + cm to reversed/.tip={cm to[reversed]}, + cm */.tip={Circle[length=+0pt 7.6]}, + cm o/.tip={cm *[open]}, + cm |/.tip={cm bar}}%| + +% The `Glyph' meta arrow tip +\pgfqkeys{/pgf/arrow keys}{ + glyph math command/.code={% if csname #1 is undefined, we want it to remain so + \pgfarrowsaddtooptions{\def\tikzcd@glyph{$\begingroup\expandafter\endgroup\csname #1\endcsname$}}}, + glyph axis/.code={\pgfarrowsaddtooptions{\pgfmathsetlengthmacro\tikzcd@glyph@axis{#1}}}, + glyph length/.code={\pgfarrowsaddtooptions{\pgfmathsetlengthmacro\tikzcd@glyph@len{#1}}}, + glyph shorten/.code={\pgfarrowsaddtooptions{\pgfmathsetlengthmacro\tikzcd@glyph@shorten{#1}}}} + +\pgfdeclarearrow{ + name=Glyph, + cache=false, + bending mode=none, + parameters={\tikzcd@glyph@len,\tikzcd@glyph@shorten}, + setup code={ + \pgfarrowssettipend{\tikzcd@glyph@len\advance\pgf@x by\tikzcd@glyph@shorten}}, + defaults={ + glyph axis=axis_height, + glyph length=+0.9ex, + glyph shorten=+-0.1ex}, + drawing code={ + \pgfpathrectangle{\pgfpoint{+0pt}{+-1ex}}{\pgfpoint{+\tikzcd@glyph@len}{+2ex}}% + \pgfusepathqclip% + \pgftransformxshift{+\tikzcd@glyph@len}% + \pgftransformyshift{+-\tikzcd@glyph@axis}% + \pgftext[right,base]{\tikzcd@glyph}}} + +% Arrow tip selection styles +\tikzcdset{ + double line/.code={\tikzset{% + double equal sign distance, + double=\pgfkeysvalueof{/tikz/commutative diagrams/background color}}}, + dashed/.style={/tikz/dash pattern={on 7\pgflinewidth off 4\pgflinewidth}}, + tikzcd to/.tip={cm to}, + tikzcd bar/.tip={cm bar}, + tikzcd left hook/.tip={cm left hook}, + tikzcd double to/.tip={cm double to}, + tikzcd implies/.tip={Implies}, + tikzcd right hook/.tip={tikzcd left hook[swap]}, + tikzcd left to/.tip={tikzcd to[harpoon]}, + tikzcd right to/.tip={tikzcd left to[swap]}, + tikzcd to reversed/.tip={tikzcd to[reversed]}, + tikzcd cap/.tip={}, + tikzcd implies cap/.tip={}, + tikzcd implies bar/.tip={tikzcd bar}, + no tail/.code={\pgfsetarrowsstart{tikzcd cap}}, + to head/.code={\pgfsetarrowsend{tikzcd to}}, + maps to/.code={\pgfsetarrowsstart{tikzcd bar}}, + hook/.code={\pgfsetarrowsstart{tikzcd right hook}}, + hook'/.code={\pgfsetarrowsstart{tikzcd left hook}}, + harpoon/.code={\pgfsetarrowsend{tikzcd left to}}, + harpoon'/.code={\pgfsetarrowsend{tikzcd right to}}, + two heads/.code={\pgfsetarrowsend{tikzcd double to}}, + tail/.code={\pgfsetarrowsstart{tikzcd to reversed}}, + rightarrow/.code={\pgfsetarrows{tikzcd cap-tikzcd to}}, + Rightarrow/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies cap-tikzcd implies}}, + leftarrow/.code={\pgfsetarrows{tikzcd to-tikzcd cap}}, + Leftarrow/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies-tikzcd implies cap}}, + leftrightarrow/.code={\pgfsetarrows{tikzcd to-tikzcd to}}, + Leftrightarrow/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies-tikzcd implies}}, + mapsto/.code={\pgfsetarrows{tikzcd bar-tikzcd to}}, + mapsfrom/.code={\pgfsetarrows{tikzcd to-tikzcd bar}}, + Mapsto/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies bar-tikzcd implies}}, + Mapsfrom/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies-tikzcd implies bar}}, + hookrightarrow/.code={\pgfsetarrows{tikzcd right hook-tikzcd to}}, + hookleftarrow/.code={\pgfsetarrows{tikzcd to-tikzcd left hook}}, + rightharpoonup/.code={\pgfsetarrows{tikzcd cap-tikzcd left to}}, + rightharpoondown/.code={\pgfsetarrows{tikzcd cap-tikzcd right to}}, + leftharpoonup/.code={\pgfsetarrows{tikzcd right to-tikzcd cap}}, + leftharpoondown/.code={\pgfsetarrows{tikzcd left to-tikzcd cap}}, + rightarrowtail/.code={\pgfsetarrows{tikzcd to reversed-tikzcd to}}, + leftarrowtail/.code={\pgfsetarrows{tikzcd to-tikzcd to reversed}}, + twoheadrightarrow/.code={\pgfsetarrows{tikzcd cap-tikzcd double to}}, + twoheadleftarrow/.code={\pgfsetarrows{tikzcd double to-tikzcd cap}}, + no head/.code={\pgfsetarrowsend{tikzcd cap}}, + dash/.code={\pgfsetarrows{tikzcd cap-tikzcd cap}}, + dashrightarrow/.code={\tikzcdset{rightarrow,dashed}}, + dashleftarrow/.code={\tikzcdset{leftarrow,dashed}}, + equal/.code={\tikzcdset{double line}\pgfsetarrows{tikzcd implies cap-tikzcd implies cap}}, + equals/.code={\tikzcdset{equal}}, + rightsquigarrow/.code={\tikzcdset{rightarrow,squiggly}}, + leftsquigarrow/.code={\tikzcdset{leftarrow,squiggly}}, + leftrightsquigarrow/.code={\tikzcdset{leftrightarrow,squiggly}}, + squiggly/.code={% + \pgfutil@ifundefined{tikz@library@decorations.pathmorphing@loaded}% + {\pgfutil@packageerror{tikz-cd}{You need to say % + \string\usetikzlibrary{decorations.pathmorphing} to use squiggly arrows}{}}{}% + \pgfkeysalso{ + /tikz/decorate, + /tikz/decoration={ + zigzag, + segment length=9.25\pgflinewidth, + amplitude=1.9\pgflinewidth, + post=lineto, post length=6\pgflinewidth, + pre=lineto, pre length=6\pgflinewidth, + #1}}}} + +% The `Latin Modern' arrow style +\pgfkeysdef{/tikz/commutative diagrams/arrow style/Latin Modern}{% + \tikzcdset{ + tikzcd bar/.tip={Bar[width=+0pt 12 .992,line cap=round]}, + tikzcd left hook/.tip={Hooks[width=+0pt 15,length=+0pt 4.2,arc=190,harpoon,line cap=round]}}} + +% The `tikz' arrow style +\pgfkeysdef{/tikz/commutative diagrams/arrow style/tikz}{% + \tikzcdset{ + tikzcd to/.tip={>}, + tikzcd bar/.tip={Bar[width=+3pt 4 0.9]}, + tikzcd left hook/.tip={Hooks[harpoon]}, + tikzcd double to/.tip={tikzcd to[]tikzcd to}}} + +% The `math font' arrow style +% +% If your font does not define the command \mapsfrom, do so by saying +% \def\mapsfrom{\pgfpicture\pgfsetbaseline{+0pt}\pgftransformxscale{-1}\pgftext[base]{$\mapsto$}\endpgfpicture} +% +% The method used to guess the correct value of `double distance' +% inside the `double line' style is not robust at all. If it fails, +% set +% \tikzcdset{double line/.append style={double distance=2*rule_thickness}} +% and find the correct value for `double distance' by trial and error +% (or measure the distance between the \Rightarrow stems in a font +% editor). +% +\pgfkeysdef{/tikz/commutative diagrams/arrow style/math font}{% + \tikzcdset{ + tikzcd to/.tip={Glyph[glyph math command=rightarrow]}, + tikzcd cap/.tip={Glyph[glyph math command=leftarrow]}, + tikzcd to reversed/.tip={Glyph[glyph math command=leftarrowtail]}, + tikzcd bar/.tip={Glyph[glyph math command=mapsfrom]}, + tikzcd left hook/.tip={Glyph[glyph math command=hookleftarrow]}, + tikzcd right hook/.tip={Glyph[glyph math command=hookleftarrow, swap]}, + tikzcd implies/.tip={Glyph[glyph math command=Rightarrow, glyph length=1.2ex]}, + tikzcd implies cap/.tip={Glyph[glyph math command=Leftarrow]}, + tikzcd implies bar/.tip={Glyph[glyph math command=Mapsfrom]}, + tikzcd double to/.tip={Glyph[glyph math command=twoheadrightarrow, glyph length=1.4ex]}, + tikzcd left to/.tip={Glyph[glyph math command=rightharpoonup]}, + tikzcd right to/.tip={Glyph[glyph math command=rightharpoonup,swap]}, + double line/.append code={\tikzset{double distance={2*(height("$=$")-axis_height-rule_thickness)}}}, + dashed/.code={\tikzset{dash pattern=on 0.8ex off 0.4ex, dash phase=0.8ex}}, + squiggly/.default={pre length=1ex, post length=1ex}}} + +% Default settings +\tikzcdset{ + every arrow/.style={ + /tikz/draw, + /tikz/line width=rule_thickness, + /tikz/commutative diagrams/rightarrow}, + every label/.style={ + /tikz/auto, + /tikz/font=\everymath\expandafter{\the\everymath\scriptstyle}, + /tikz/inner sep=+0.5ex}, + every cell/.style={ + /tikz/shape={asymmetrical rectangle}, + /tikz/inner xsep=+1ex, + /tikz/inner ysep=+0.85ex}, + every matrix/.style={/tikz/inner sep=+0pt}, + every diagram/.style={ + /tikz/commutative diagrams/row sep=normal, + /tikz/commutative diagrams/column sep=normal, + /tikz/baseline=+0pt}, + 1-row diagram/.style={/tikz/baseline/.expanded=(\tikzcdmatrixname.base)}, + math mode=true, + center yshift/.initial=axis_height, + row sep/huge/.initial=+3.6em, + row sep/large/.initial=+2.7em, + row sep/normal/.initial=+1.8em, + row sep/scriptsize/.initial=+1.35em, + row sep/small/.initial=+0.9em, + row sep/tiny/.initial=+0.45em, + column sep/huge/.initial=+4.8em, + column sep/large/.initial=+3.6em, + column sep/normal/.initial=+2.4em, + column sep/scriptsize/.initial=+1.8em, + column sep/small/.initial=+1.2em, + column sep/tiny/.initial=+0.6em, + crossing over clearance/.initial=+1.5ex, + shift left/.default=+0.56ex, + shift right/.default=1, + background color/.initial=white} + +\endinput diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 4ef22e1d4f7..43159994345 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -1196,6 +1196,7 @@ chomp ($Build = `cd $Master/../Build/source && pwd`); 'splitindex' => '&POST_do_man', 'tap', => '&POSTtap', 'texdraw', => '&POSTtexdraw', + 'tikz-cd', => '&POSTtikz_cd', 'tipa-de' => '&POST_rmsymlink', 'xecyr' => '&POSTxecyr', 'xetex-pstricks' => '&POSTxetexpstricks', @@ -5660,6 +5661,12 @@ sub POSTtexdraw { # or forcing the output file name. } +sub POSTtikz_cd { + print "POST$package - generic file in generic subdirectory\n"; + &xchdir ("$TOPDEST/texmf-dist/tex"); + &mv_with_mkdir ("latex/tikz-cd/tikzlibrary*tex", "tex/generic/tikz-cd/"); +} + sub POSTxecyr { print "POST$package - handling bat, moving language.dat.add from runtime\n"; &SYSTEM ("$MV $DEST/tex/generic/xecyr/language.dat.add" -- cgit v1.2.3