diff options
author | Karl Berry <karl@freefriends.org> | 2012-03-18 23:22:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-03-18 23:22:20 +0000 |
commit | 4259209d35460c4a5011aa52ffb619c557591c03 (patch) | |
tree | 65dfce8d44ac48c4982be94e085ce4f2b55bfb92 /Master/texmf-dist/tex/latex/tikz-cd | |
parent | 61065674de81d0dccba11b46076f426e424ad58a (diff) |
tikz-cd (18mar12)
git-svn-id: svn://tug.org/texlive/trunk@25687 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikz-cd')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty | 74 |
1 files changed, 65 insertions, 9 deletions
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 d7d13d98166..bd5202c82d4 100644 --- a/Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty +++ b/Master/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty @@ -1,11 +1,11 @@ -% Copyright 2011 by FlorĂȘncio Neves +% Copyright 2011, 2012 by FlorĂȘncio Neves % % This file may be distributed and/or modified % % 1. under the LaTeX Project Public License and/or % 2. under the GNU Public License. % -\ProvidesPackage{tikz-cd}[2011/12/09 v0.2a Commutative diagrams with tikz.] +\ProvidesPackage{tikz-cd}[2012/03/18 v0.2b Commutative diagrams with tikz.] \RequirePackage{tikz} \usetikzlibrary{matrix} @@ -33,8 +33,6 @@ /tikz/commutative diagrams/every diagram/.append style={#1}}, description/.style={ /tikz/anchor=center, - text height=, - text depth=, /tikz/fill=\pgfkeysvalueof{/tikz/commutative diagrams/background color}, /tikz/inner sep=% \pgfkeysvalueof{/tikz/commutative diagrams/description clearance}}, @@ -193,17 +191,15 @@ /tikz/commutative diagrams/.cd, /tikz/auto, /tikz/font=\scriptsize, - /tikz/inner sep=0.5ex, - /tikz/text height=, - /tikz/text depth=}, + /tikz/inner sep=0.5ex}, every diagram/.style={ /tikz/commutative diagrams/.cd, + /tikz/cells={/tikz/nodes={/tikz/shape={asymmetrical rectangle}}}, row sep=normal, column sep=normal, - /tikz/text height=1.5ex, - /tikz/text depth=0.25ex, /tikz/baseline=0pt}, math mode=true, + center shift/.initial=0.575ex, row sep/huge/.initial=10ex, row sep/large/.initial=7.5ex, row sep/normal/.initial=5ex, @@ -223,6 +219,66 @@ crossing over clearance/.initial=6pt, background color/.initial=white} +% 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 shift}}} + \anchor{west}{\pgf@anchor@rectangle@west\pgfmathsetlength\pgf@y% + {\pgfkeysvalueof{/tikz/commutative diagrams/center shift}}} + \anchor{east}{\pgf@anchor@rectangle@east\pgfmathsetlength\pgf@y% + {\pgfkeysvalueof{/tikz/commutative diagrams/center shift}}} + \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 shift}}% + \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% + } +} + % Branch depending on whether the next character is [, { or none of those. \def\tikzcd@threefold#1#2#3{% \def\tikzcd@tempa{#1}% |