summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/commutative-diagrams/kodi.sty
blob: 149c1cbe10963b45c3cb69fd2299552042dacd83 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
%
% CoDi: Commutative Diagrams for TeX
% Copyright (c) 2015-2020 Paolo Brasolin <paolo.brasolin@gmail.com>
% SPDX-License-Identifier: MIT
%
% This file is part of CoDi 1.0.1, released on 2020/06/11 under MIT license.
%

\RequirePackage{commutative-diagrams}

\PackageWarningNoLine{kodi}{this package is only a compatibility layer
to help you migrate from 'kodi' to 'commutative-diagrams'. It is NOT
intended for production use. Please solve all other warnings and then
switch to 'commutative-diagrams'}

% TikZ keys: /kodi/**/* -> /codi/**/*

\pgfkeys{
  /handlers/.unknown/.code={%
    \def\pgfkeysisdescendantof@impl/##1/##2\pgf@@eov{%
      \def\wot{##1}%
      \def\asd{kD}%
      \ifx\wot\asd
        \def\tmp{/codi/##2}%
        \PackageWarning{kodi}{automatically remapped key '\pgfkeyscurrentkey'
        to key '\tmp'. Please switch to the latter}
        \ifx\pgfkeyscurrentvalue\pgfkeysnovalue
          \expandafter\pgfkeysalso\expandafter{\tmp}%
        \else
          \expandafter\expandafter\expandafter\pgfkeysalso\expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter\tmp\expandafter=\pgfkeyscurrentvalue}%
        \fi
      \else
        % NOTE: this is the default /handlers/.unknown/.code
        \def\pgf@marshal{\pgfkeysvalueof{/errors/unknown key/.@cmd}}%
        {\expandafter\expandafter\expandafter\pgf@marshal\expandafter\expandafter\expandafter{\expandafter\pgfkeyscurrentkey\expandafter}\expandafter{\pgfkeyscurrentvalue}\pgfeov}%
      \fi
    }%
    \expandafter\pgfkeysisdescendantof@impl\pgfkeyscurrentkey\pgf@@eov
  }
}

% TikZ key: /tikz/kodi -> /tikz/codi

\pgfkeys{
  /tikz/kodi/.code={%
    \PackageWarning{kodi}{automatically remapped key '/tikz/kodi'
    to key '/tikz/codi'. Please switch to the latter}%
    \pgfkeysalso{/tikz/codi}%
  }
}

% Environment: kodi -> codi

\def\kodi{%
  \PackageWarning{kodi}{automatically remapped environment 'kodi'
  to environment 'codi'. Please switch to the latter}%
  \codi}
\let\endkodi\endcodi

\endinput