diff options
author | Karl Berry <karl@freefriends.org> | 2014-10-27 22:14:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-10-27 22:14:29 +0000 |
commit | 3db680aa56c30ff89687d0536b35052c4d54d309 (patch) | |
tree | 0b82ef5a676021a21d7fd8ff5e88c735bca696fd /Master | |
parent | 657ef09b48e97fe2e24a3990ba7611df99b7a72c (diff) |
tikz-cd (27oct14)
git-svn-id: svn://tug.org/texlive/trunk@35450 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf | bin | 337327 -> 337004 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.tex | 173 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/tikz-cd/tikzlibrarycd.code.tex | 95 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty | 2 |
4 files changed, 141 insertions, 129 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 Binary files differindex 14fa829099c..d2968c9a814 100644 --- a/Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf +++ b/Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.pdf 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 c09863910ad..9975e5ef3a0 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 @@ -32,7 +32,7 @@ \usepackage{hyperref} \hypersetup{% - colorlinks=true, % use true to enable colors below: + colorlinks=false, % use true to enable colors below: linkcolor=blue,%red, filecolor=blue,%magenta, pagecolor=blue,%red, @@ -102,16 +102,24 @@ \usepackage{xxcolor} \usepackage{pifont} \usepackage{makeidx} +\usepackage{tikz-cd,xr,multicol,microtype} -\graphicspath{{../../images/}} % TODOsp: under windows this would go up 2 directories, but the file is only one directory up -\input{pgfmanual-en-macros} % TODOsp: same here -\makeindex +\IfFileExists{pgfmanual-en-macros} + {\input{pgfmanual-en-macros}} + {\PackageError{tikz-cd-doc}{ +This document requires the file pgfmanual-en-macros.tex (distributed +with pgf) to compile. Please place a copy of that file in the current +directory}{}} + +\IfFileExists{pgfmanual.aux} + {\externaldocument[pgfman-]{pgfmanual}} + {\PackageWarning{tikz-cd-doc}{ +Couldn't find pgfmanual.aux. To get cross-references to the pgf +manual, compile it and copy all resulting .aux files to the current +directory}{}} -\makeatletter -\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.8em}} -\renewcommand*\l@subsubsection{\@dottedtocline{3}{4.3em}{3.2em}} -\makeatother +\makeindex % Global styles: \tikzset{ @@ -125,16 +133,11 @@ inner ysep=0.5cm} } -\usepackage{tikz-cd,xr,multicol,microtype} -\usepackage[utf8]{inputenc} - \hypersetup{unicode, pdftitle={tikzcd: Commutative diagrams with TikZ}, pdfkeywords={Commutative diagrams; TeX; LaTeX; ConTeXt; TikZ; pgf; tikz-cd; tikzcd}, } -\externaldocument[pgfman-]{pgfmanual} - \pgfkeys{ /pdflinks/search key prefixes in= {/tikz/commutative diagrams/},%,/tikz/,/pgf/} % This really needs to be commented out! @@ -167,13 +170,18 @@ \begin{document} \begin{center} -{\Huge |{tikzcd}|} -\\[4mm] -{\Large\bf Commutative diagrams with \tikzname} -\\[3mm] -{Version 0.9c $\quad$ October 20, 2014} +\vspace*{1em} +\tikz\node[scale=1.2]{% + \color{gray}\Huge\ttfamily \char`\{\textcolor{red!75!black}{tikzcd}\char`\}}; + +\vspace{0.5em} +{\Large\bfseries Commutative diagrams with \tikzname} + +\vspace{1em} +{Version 0.9d $\quad$ October 26, 2014} \end{center} +\vspace{1.5em} The general-purpose drawing package Ti\emph{k}Z can be used to typeset commutative diagrams and other kinds of mathematical pictures, generating high-quality results. The present package facilitates the @@ -204,17 +212,17 @@ your documents), keep a copy of the current version of the file To invoke this package in \LaTeX, type -\begin{quote} - \index{tikz-cd@\protect\texttt{tikz-cd} package}% +\begin{verse} + \index{tikz-cd@\protect\texttt{tikz-cd} package}% \index{Packages and files!tikz-cd@\protect\texttt{tikz-cd}}% -{{\ttfamily\char`\\usepackage\char`\{\declare{tikz-cd}\char`\}}} -\end{quote} + |\usepackage{tikz-cd}| +\end{verse} or load \tikzname{} and then type -\begin{quote}% +\begin{verse}% \index{cd@\protect\texttt{cd} library}% \index{Libraries!cd@\protect\texttt{cd}}% - {{\ttfamily\char`\\usetikzlibrary\char`\{\declare{cd}\char`\}}}\pgfmanualpdflabel{cd}{}% -\end{quote} + |\usetikzlibrary{cd}|% +\end{verse} \subsection{Creating a diagram} \label{sec:creating-diagrams} @@ -240,8 +248,8 @@ so that the diagram is placed on a new line and centered. It is important to note that \textsc{dvi} viewers will not display diagrams correctly. It is necessary to convert the \textsc{dvi} file -to the \textsc{pdf} or \textsc{ps} format---or, even better, use -\texttt{pdflatex} to obtain a \textsc{pdf} file directly. +to \textsc{pdf} or \textsc{ps} format---or, even better, use a tool +that generates \textsc{pdf} files directly, such as \texttt{pdflatex}. \subsection{Inserting arrows} \label{sec:inserting-arrows} @@ -276,9 +284,9 @@ of |"\phi"| in the example below. To further modify the appearance of an arrow, note that \meta{options} may contain any key that can be passed to \tikzname's |\path| command. Similarly, a label can receive additional options via the syntax -\begin{quote} +\begin{verse} |"|\meta{label text}|"|\opt{\meta{label options}}. -\end{quote} +\end{verse} Both \meta{label text} and \meta{label options} need to be enclosed in curly braces if they contain commas. @@ -463,9 +471,9 @@ you can specify an explicit matrix cell by replacing \meta{direction} with something of the form \meta{row number}\texttt{-}\meta{column number}, or the name of a node. The trailing \meta{labels} can be the empty string or of the form -\begin{quote} +\begin{verse} \opt{\oarg{label options}}\marg{label text}\meta{more labels}. -\end{quote} +\end{verse} The equivalent command |\ar| can also be used in this form. Here is an example. @@ -491,9 +499,9 @@ There are further shortened forms: \pgfmanualbody \end{pgfmanualentry} The first one is equivalent to -\begin{quote} +\begin{verse} |\arrow|{\oarg{options}}|{r}|\meta{labels} -\end{quote} +\end{verse} and the other ones work analogously. \subsection{Usage in plain \TeX{}} @@ -501,12 +509,12 @@ and the other ones work analogously. To use this software in plain \TeX{}, load \tikzname{} and the \texttt{cd} library by saying -\begin{quote} - \ttfamily\char`\\input \declare{tikz}.tex\\ +\begin{verse} + |\input tikz.tex|\\ \index{cd@\protect\texttt{cd} library}% \index{Libraries!cd@\protect\texttt{cd}}% - \ttfamily\char`\\usetikzlibrary\char`\{\declare{cd}\char`\} -\end{quote} + |\usetikzlibrary{cd}| +\end{verse} The |{tikzcd}| environment should then be replaced by the following: \begin{plainenvironment}{{tikzcd}\opt{\oarg{options}}} \end{plainenvironment} @@ -518,12 +526,12 @@ without change. To use this software in Con\TeX t, load \tikzname{} and then the \texttt{cd} library by saying -\begin{quote} - \ttfamily\char`\\usemodule[\declare{tikz}]\\ +\begin{verse} + |\usemodule[tikz]|\\ \index{cd@\protect\texttt{cd} library}% \index{Libraries!cd@\protect\texttt{cd}}% - \ttfamily\char`\\usetikzlibrary[\declare{cd}] -\end{quote} + |\usetikzlibrary[cd]| +\end{verse} The |{tikzcd}| environment should then be replaced by the following: \begin{contextenvironment}{{tikzcd}\opt{\oarg{options}}} \end{contextenvironment} @@ -571,11 +579,11 @@ manual~\cite[\S\ref*{pgfman-section-nodes}, esp.\ \begin{stylekey}{/tikz/commutative diagrams/every diagram} This style is applied to every |{tikzcd}| environment. Initially, it contains the following: -\begin{quote} +\begin{verse} |row sep=normal||,|\\ |column sep=normal||,|\\ |/tikz/baseline=0pt| -\end{quote} +\end{verse} \end{stylekey} The |baseline=0pt| setting is used to make equation numbers be placed @@ -589,19 +597,19 @@ matrix base, which is exactly what you want). \begin{stylekey}{/tikz/commutative diagrams/every matrix} This style is applied to the \tikzname{} matrix created internally by |{tikzcd}|. Initially, it contains the following: -\begin{quote} +\begin{verse} |/tikz/inner sep=0pt| -\end{quote} +\end{verse} \end{stylekey} \begin{stylekey}{/tikz/commutative diagrams/every cell} This style is applied to every \tikzname{} matrix cell created by |{tikzcd}|. Initially, it contains the following: -\begin{quote} +\begin{verse} |/tikz/shape=asymmetrical rectangle||,|\\ |/tikz/inner xsep=1ex||,|\\ |/tikz/inner ysep=0.85ex| -\end{quote} +\end{verse} \end{stylekey} The |asymmetrical rectangle| shape is described in @@ -619,9 +627,9 @@ it. \begin{key}{/tikz/commutative diagrams/row sep=\meta{size}} This key acts as a ``frontend'' to \tikzname's |/tikz/row sep| key. If the key - \begin{quote} + \begin{verse} |/tikz/commutative diagrams/row sep/|\meta{size} - \end{quote} + \end{verse} stores a \meta{value}, then it is read and |/tikz/row sep|=\meta{value} is set. If the key above is not initialized, then \meta{size} is @@ -641,15 +649,15 @@ Notice that setting, say, |row sep=1cm| globally with |\tikzcdset| will have no effect, since the |row sep| option is re-set at the beginning of each diagram. To make all diagrams have |row sep| equal to 1\,cm, you can modify the meaning of |normal| by saying -\begin{quote} +\begin{verse} |\tikzcdset{row sep/normal=1cm}|. -\end{quote} +\end{verse} You can also create new sizes, but note that \pgfname\ requires new keys to be initialized explicitly. For example, to create a size |my size|, meaning 1\,ex, you should use -\begin{quote} +\begin{verse} |\tikzcdset{row sep/my size/.initial=1ex}|. -\end{quote} +\end{verse} \begin{key}{/tikz/commutative diagrams/column sep=\meta{size}} This works analogously to the |row sep| key above. The sizes available @@ -703,11 +711,11 @@ Section \ref*{pgfman-section-matrices}.3.2 of the \pgfname{} manual \begin{stylekey}{/tikz/commutative diagrams/every arrow} This style is applied to every |\arrow|. Initially, it contains the following: -\begin{quote} +\begin{verse} |/tikz/draw,|\\ |/tikz/line width=rule_thickness||,|\\ |rightarrow| -\end{quote} +\end{verse} \end{stylekey} \begin{key}{/tikz/commutative diagrams/arrows=\meta{options}} @@ -730,6 +738,9 @@ Section \ref*{pgfman-section-matrices}.3.2 of the \pgfname{} manual \tikzname's |arrows.meta| library. It honors the option |/tikz/>|. \end{description} + + This key is usually invoked in the document preamble, and should be + set only once. \end{key} If you are using a font different from Computer Modern or Latin @@ -742,11 +753,13 @@ results, you can try selecting the \texttt{tikz} style, and setting in \cite[\S\ref*{pgfman-section-arrows-meta}]{pgfman}). \begin{codeexample}[] +% in preamble \tikzcdset{ arrow style=tikz, diagrams={>={Straight Barb[scale=0.8]}} } - + +% in document body \begin{tikzcd} A \arrow[r, tail] \arrow[rd] & B \arrow[d, two heads]\\ & D @@ -967,11 +980,11 @@ following picture. This style is applied to every label produced with |\arrow|. It is initially set to -\begin{quote} +\begin{verse} |/tikz/auto,|\\ |/tikz/font=|\meta{something}|,|\\ |/tikz/inner sep=0.5ex| -\end{quote} +\end{verse} where \meta{something} is something that makes |\scriptstyle| be applied to labels in math mode. \end{stylekey} @@ -1007,20 +1020,20 @@ less arbitrary use of other \tikzname{} features within |{tikzcd}|. \label{sec:intern-arrow-comm} The |{tikzcd}| environment works by substituting code of the form -\begin{quote} +\begin{verse} |\begin{tikzcd}[|\meta{options}|]|\\ \hspace*{1.5ex} \meta{contents}\\ |\end{tikzcd}| -\end{quote} +\end{verse} with roughly the following: -\begin{quote} - |\begin{tikzpicture} [|\meta{options}|]|\\ - \hspace*{1.5ex}| \matrix [matrix of nodes] {|\\ +\begin{verse} + |\begin{tikzpicture}[|\meta{options}|]|\\ + \hspace*{1.5ex}| \matrix[matrix of nodes] {|\\ \hspace*{3ex}| |\meta{contents} |\\|\\ \hspace*{1.5ex}| };|\\ \hspace*{1.5ex}| |\meta{paths}\\ |\end{tikzpicture}| -\end{quote} +\end{verse} Not shown above are a number of initialization procedures, such as defining |\arrow| and its relatives, as well as applying the default @@ -1033,13 +1046,14 @@ to have arbitrary \tikzname{} code executed after a diagram is drawn. Initially, \meta{paths} is the empty string. A command |\arrow[|\meta{options}|]| does nothing at the point it is inserted, and causes the following code to be appended to \meta{paths}: -\begin{quote} - |\path[|\meta{options}|] (|\meta{current node}|) to (|\meta{target~node}|);| -\end{quote} -Here, \meta{current node} is the node corresponding to the matrix cell -where the command |\arrow| is present. A special |.unknown| key -handler is set up to parse direction arguments in \meta{options} and -set \meta{target node} accordingly. +\begin{verse} + |\path[|\meta{options}|] (|\meta{source~node}|) to (|\meta{target~node}|);| +\end{verse} +By default, \meta{source node} and \meta{target node} refer to the +node corresponding to the matrix cell where the command |\arrow| is +present. This can be changed using the |from| and |to| keys, or a +direction argument (a string consisting of characters |r|, |l|, |d|, +|u|). \subsection{Tweaking \texttt{to} paths} \label{sec:tweaking-to-paths} @@ -1131,9 +1145,9 @@ adapted from \cite{milne}). By default, \tikzname{} makes the character |&| active inside matrices, and this causes the error message -\begin{quote} +\begin{verse} |! Package pgfbasematrix Error: Single ampersand used with wrong catcode.| -\end{quote} +\end{verse} when |{tikzcd}| is used inside the argument to a macro such as a Beamer frame or a footnote. One solution to this problem is to call |{tikzcd}| with the option |ampersand replacement=\&|, and replace all @@ -1150,20 +1164,19 @@ needed if you want to use matrices in a diagram cell or label. An alternative fix to this issue that does not require replacing |&| with a different column separator consists in adding the following line to your document after all packages have been loaded: -\begin{quote} +\begin{verse} |\def\temp{&} \catcode`&=\active \let&=\temp| -\end{quote} +\end{verse} However, this may interfere in unexpected ways with other packages. Use this trick at your own risk. A different but related issue is that some packages, notably \texttt{babel}, modify the catcodes of certain characters in a way that may upset \tikzname's parser. To fix this, add -\begin{quote} - \ttfamily\char`\\usetikzlibrary\char`\{\declare{babel}\char`\} -\end{quote} -to your document preamble. Characters inside |{tikzcd}| cells will be -assigned their standard (non-\texttt{babel}) catcode. +\begin{verse} + |\usetikzlibrary{babel}| +\end{verse} +to your document preamble. \section{Additional goodies} \label{sec:general-infra} 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 7f4d44896bd..ddd2312b89e 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/20 v0.9c Commutative diagrams with tikz] +% tikzlibrarycd.code.tex [2014/10/26 v0.9d Commutative diagrams with tikz] % % Copyright 2011, 2012, 2014 by FlorĂȘncio Neves <florencioneves@gmail.com> % @@ -21,15 +21,12 @@ \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}}}, + execute before arrows/.code={\expandafter\def\expandafter\tikzcd@before@paths@hook\expandafter{\tikzcd@before@paths@hook#1}}, to/.code={\tikzcd@setarrowend\tikzcd@ar@target{#1}}, from/.code={\tikzcd@setarrowend\tikzcd@ar@start{#1}}, description/.style={ @@ -105,6 +102,10 @@ % 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@@}} @@ -112,10 +113,7 @@ \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% + \tikzcdset{every diagram,#1}% \let\arrow\tikzcd@arrow% \let\ar\tikzcd@arrow% \def\rar{\tikzcd@xar{r}}% @@ -127,10 +125,9 @@ \def\drar{\tikzcd@xar{dr}}% \def\dlar{\tikzcd@xar{dl}}% \global\let\tikzcd@savedpaths\pgfutil@empty% - \matrix[ - /tikz/handle active characters in code=false, - /tikz/matrix of \iftikzcd@mathmode math \fi nodes, - /tikz/every cell/.append code={\tikzcdset{every cell}}, + \matrix[% + /tikz/matrix of \iftikzcd@mathmode math \fi nodes,% + /tikz/every cell/.append code={\tikzcdset{every cell}},% /tikz/commutative diagrams/.cd,every matrix]% \bgroup} @@ -139,8 +136,16 @@ \pgfextra{\global\let\tikzcdmatrixname\tikzlastnode};% \tikzcdset{\the\pgfmatrixcurrentrow-row diagram/.try}% \begingroup% - \tikzcd@enablequotes% - \tikzcd@patcherrmsg% + \pgfkeys{% `quotes' library support + /handlers/first char syntax/the character "/.initial=\tikzcd@forward@quotes,% + /tikz/edge quotes mean={% + edge node={node [execute at begin node=\iftikzcd@mathmode$\fi,%$ + execute at end node=\iftikzcd@mathmode$\fi,%$ + /tikz/commutative diagrams/.cd,every label,##2]{##1}}}}% + \let\tikzcd@errmessage\errmessage% improve error messages + \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}}% + \tikzcd@before@paths@hook% \tikzcd@savedpaths% \endgroup% \endtikzpicture% @@ -149,11 +154,12 @@ % The arrow commands \def\tikzcd@arrow{% \relax% this was added to avoid errors when a cell starts with \arrow, but it seems unnecessary now - \tikzcd@x@addto@macro\tikzcd@savedpaths{% + \edef\tikzcd@temp{% \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[]}} + \expandafter\pgfutil@g@addto@macro\expandafter\tikzcd@savedpaths\expandafter{\tikzcd@temp}% + \pgfutil@ifnextchar[{\tikzcd@handle@shortcuts@next\tikzcd@@arrow}{\tikzcd@ar@old[]}} \def\tikzcd@@arrow[#1]{\pgfutil@ifnextchar\bgroup{\tikzcd@ar@old[#1]}{\tikzcd@ar@new[#1]}} @@ -163,43 +169,36 @@ (\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,to={#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]{\tikzcdmathmaybe{#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}}} - + \pgfutil@ifnextchar[% + {\tikzcd@handle@shortcuts@next\tikzcd@ar@getlabel{to={#2},#1}}% + {\pgfutil@ifnextchar\bgroup% + {\tikzcd@ar@getlabel{to={#2},#1}[]}% + {\tikzcd@ar@new[to={#2},#1]}}} + +\def\tikzcd@ar@getlabel#1[#2]#3{% + \pgfutil@ifnextchar[% + {\tikzcd@handle@shortcuts@next\tikzcd@ar@getlabel{#1,"{#3}"{#2}}}% + {\pgfutil@ifnextchar\bgroup% + {\tikzcd@ar@getlabel{#1,"{#3}"{#2}}[]}% + {\tikzcd@ar@new[#1,"{#3}"{#2}]}}} + +\def\tikzcd@xar#1{\relax\pgfutil@ifnextchar[{\tikzcd@handle@shortcuts@next\tikzcd@@xar{#1}}{\tikzcd@arrow[]{#1}}} \def\tikzcd@@xar#1[#2]{\tikzcd@arrow[#2]{#1}} -\def\tikzcdmathmaybe#1{% this must be a user-accessible command to avoid clash with babel library - \iftikzcd@mathmode$\relax #1$\else#1\fi} +\def\tikzcd@handle@shortcuts@next{% expand next macro using standard catcodes + \iftikz@handle@active@code% + \begingroup% + \tikz@switchoff@shorthands\expandafter% + \endgroup\expandafter% + \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]{\tikzcdmathmaybe{##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}}} - +\def\tikzcd@forward@quotes#1{\tikzset{every to/.append style={#1}}} + +\let\tikzcd@before@paths@hook\pgfutil@empty + % `start anchor', `end anchor', and `shift' keys \def\tikzcd@setanchor#1[#2]#3\relax{% \ifx\relax#2\relax\else% 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 9354939cb10..6a49ae1db70 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 <http://www.gnu.org/licenses/>. -\ProvidesPackage{tikz-cd}[2014/10/20 v0.9c Commutative diagrams with tikz] +\ProvidesPackage{tikz-cd}[2014/10/26 v0.9d Commutative diagrams with tikz] \RequirePackage{tikz}[2013/12/13] % pgf version 3.0.0 required \usetikzlibrary{cd} |