summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/tikz-ext/tikzlibraryext.shapes.uncenteredrectangle.code.tex
blob: 71ee1d6be8fc1aa80b149f946151ffa5e618a793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% Copyright 2023 by Qrrbrbirlbel
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Free Documentation License.
%
\usepgflibrary{ext.shapes.uncenteredrectangle}
\newif\iftikzext@uncrec@mathmode
\pgfqkeys{/tikz-ext}{
  tikz-cd fix/.code={% #1
    \tikzcdset{
    /tikz-ext/tikz-cd fix/.code=,
      urc/.style={/pgf/uncentered rectangle center={##1}},
      every diagram/.append style={% ##1
        /pgf/uncentered rectangle center yshift=axis_height,
        /tikz/uncentered rectangle/.style={
          /tikz/shape=uncentered rectangle,
          /tikz/commutative diagrams/math mode=false,
        },
        /tikz/matrix of math nodes/.style={
          /tikz/matrix of nodes,
          /tikz/nodes={
            execute at begin node=\iftikzcd@mathmode$\fi,
            execute at end node=\iftikzcd@mathmode$\fi
          }
        },
        /utils/exec=%
          \def\uncrec####1####2####3{%
            \iftikzext@uncrec@mathmode$\fi####2\iftikzext@uncrec@mathmode$\fi
            \nodepart{left}\iftikzext@uncrec@mathmode$\fi####1\iftikzext@uncrec@mathmode$\fi
            \nodepart{right}\iftikzext@uncrec@mathmode$\fi####3\iftikzext@uncrec@mathmode$\fi
          },
        /tikz/uncrec math mode/.is if=tikzext@uncrec@mathmode,
        /tikz/uncrec math mode=true,
        /tikz/uncrec/.style={% ####1
          /tikz/uncentered rectangle,
          /pgf/uncentered rectangle center={####1}
        },
        install uncentered rectangle in column/.style={
          /tikz/column ####1/.append style={/tikz/uncentered rectangle}
        }
      }
    }
  }
}