diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/tikz-cd/tikz-cd-doc.tex | 173 |
1 files changed, 93 insertions, 80 deletions
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} |