summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/interfaces/interfaces-tikz.sty
blob: ff86af7e16b426bf4224996d2d388eedadae9a70 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
%%
%% This is file `interfaces-tikz.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% interfaces.dtx  (with options: `tikz')
%% 
%% This is a generated file.
%% 
%% interfaces : 2011/01/17 v2.8 - interfaces : interfaces with keys for other packages (FC)
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3 of this license or (at your option) any later
%% version. The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% 
%% This work consists of the main source file interfaces.dtx
%% and the derived files
%%     interfaces.sty, interfaces.pdf, interfaces.ins,
%%     interfaces-base.sty,
%%     interfaces-LaTeX.sty,
%%     interfaces-tikz.sty,
%%     interfaces-titlesec.sty,
%%     interfaces-hyperref.sty,
%%     interfaces-bookmark.sty,
%%     interfaces-hypbmsec.sty,
%%     interfaces-fancyhdr.sty,
%%     interfaces-marks.sty,
%%     interfaces-tocloft.sty,
%%     interfaces-makecell.sty,
%%     interfaces-enumitem.sty,
%%     interfaces-truncate.sty,
%%     interfaces-appendix.sty,
%%     interfaces-embedfile.sty,
%%     interfaces-environ.sty,
%%     interfaces-umrand.sty,
%%     interfaces-scrlfile.sty,
%%     interfaces-pgfkeys.sty,
%%     interfaces-etoolbox.sty
%% 
%% interfaces: interfaces with keys for other packages (FC)
%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
%% 
\let\CTANLinks=y
\ProvidesPackage{interfaces-tikz}
   [2011/01/17 v2.8 load tikz libraries easily (FC)]
\RequirePackage{interfaces-base}
\itf@pgfkeys
%% Some catcode checking
\AfterPackage*{tikz}{%
   \AtEndPreamble{%
      \tikzset{every picture/.add style={%
            /utils/exec={\@makeother\!\@makeother\:}}{}}%
   }%
}%
\newcommand*\alltikzpackages{%
   tikz,pgf,pgfcore,pgfcalendar,pgffor,pgfkeys,pgfpages,pgfrcs,xxcolor,%
   pgfplots,pgfsys,
   pgfpict2e,fp%%,%           + fp required for fixedpointarithmetic
%%   tikzexternal,%% needs special setup
%%   pgfmath,% pgfmath should not be loaded twice (\pgfmathdeclarefunction)
}% \alltikzpackages
\newcommand*\allpgfmodules{datavisualization,%
decorations,%
matrix,%
oo,%
parser,%
plot,%
shapes,%
snakes%
%%sorting% bug in pgfmodulesorting.code.tex
}% \allpgfmodules
\newcommand*\alltikzlibraries{3d,%
arrows,%
automata,%
backgrounds,%
calc,%
calendar,%
chains,%
circuits,%
circuits.ee,%
circuits.ee.IEC,%
circuits.logic,%
circuits.logic.CDH,%
circuits.logic.IEC,%
circuits.logic.US,%
datavisualization,%
datavisualization.3d,%
datavisualization.barcharts,%
datavisualization.formats.functions,%
datavisualization.polar,%
datavisualization.sparklines,%
decorations,%
decorations.footprints,%
decorations.fractals,%
decorations.markings,%
decorations.pathmorphing,%
decorations.pathreplacing,%
decorations.shapes,%
decorations.text,%
er,%
%%external,% needs special setup
fadings,%
fit,%
fixedpointarithmetic,%
folding,%
fpu,%
graphs,%
graphs.basic,%
intersections,%
lindenmayersystems,%
matrix,%
mindmap,%
patterns,%
petri,%
plothandlers,%
plotmarks,%
positioning,%
scopes,%
shadings,%
shadows,%
shapes,%
shapes.arrows,%
shapes.callouts,%
shapes.gates.logic.IEC,%
shapes.gates.logic.US,%
shapes.geometric,%
shapes.misc,%
shapes.multipart,%
shapes.symbols,%
snakes,%
spy,%
svg.path,%
through,%
topaths,%
trees,%
turtle%
}% \alltikzlibraries
\pgfqkeys{/itf/tikz}{%
   basic/.code={%
      \usetikzlibrary{calc,%           for coordinate calculations
                      arrows,%         for arrows
                      backgrounds,%    for framed
                      scopes,%         for scopes and shortcut : { [scope] ... }
                      shapes,%         for ellipse shapes of nodes
      }%
   },%
   basic/.value forbidden,%   \alltikzpackages
   base/.alias=basic,%
   all/.code={%
      \expandafter\RequirePackage\expandafter{\alltikzpackages}%
      \expandafter\usepgfmodule\expandafter{\allpgfmodules}% see pgfcorescopes.code.tex
      \expandafter\usetikzlibrary\expandafter{\alltikzlibraries}% from:  tikz.code.tex
   },%
   .unknown/.code=\itf@usetikzcode\pgfkeyscurrentname
}% \pgfkeys for \usetikz
\newrobustcmd*\usetikz[1]{%
   \RequirePackage{tikz}%
   \ifblank{#1}
      {\pgfqkeys{/itf/tikz}{all}}
      {\pgfqkeys{/itf/tikz}{#1}}%
   \itf@pgfkeys% overwritten by \input primitive otherwise
   \itf@usetikzsetup
}% \usetikz
\def\itf@usetikzsetup{%
   \pgfkeysifdefined{/tikz/shorten>}{}{%
      \pgfkeys{/tikz/shorten>/.alias=tikz/shorten >}}%
   \pgfkeysifdefined{/tikz/shorten<}{}{%
      \pgfkeys{/tikz/shorten</.alias=tikz/shorten <}}%
   \pgfkeysifdefined{/tikz/shorten <>}{}{%
      \pgfkeys{/tikz/shorten <>/.style={/tikz/shorten >={##1},/tikz/shorten<={##1}}}}%
   \pgfkeysifdefined{/tikz/shorten<>}{}{%
      \pgfkeys{/tikz/shorten<>/.alias=tikz/shorten <>}}%
}%
\newrobustcmd*\itf@usetikzcode[1]{\begingroup
   \edef\x{%
      \noexpand\in@{,#1,}{,\alltikzpackages,}%
      \noexpand\ifin@  \noexpand\usepackage{#1}%
      \noexpand\else
         \noexpand\in@{,#1,}{,\allpgfmodules,}%
         \noexpand\ifin@ \noexpand\usepgfmodule{#1}%
         \noexpand\else  \noexpand\usetikzlibrary{#1}% \usetikzlibrary by default
         \noexpand\fi
      \noexpand\fi
   }\expandafter\endgroup\x
}% \itf@usetikzcode
\newrobustcmd*\papergraduate[1][]{%
   \ifpgfpicture  \expandafter \itf@papergraduate
   \else          \expandafter \itf@wallpapergraduate
   \fi{#1}%
}% \papergraduate
\def\itf@graduation@vert[#1]#2#3#4#5{%
   \node at (0,0) [{inner sep=0pt,outer sep=0pt,anchor=south west,#1}] {%
      \rlap{\hbox to#2{\leaders\hbox to#4{\kern-\dimexpr#5/2\relax\vrule height#3 depth\z@ width#5}\hss}}}}
\def\itf@graduation@horiz[#1]#2#3#4#5{
   \node at (0,0) [{inner sep=0pt,outer sep=0pt,anchor=north west,yscale=-1,#1}] {%
      \rlap{\vbox to#3{\leaders\vbox to#4{\kern-\dimexpr#5/2\relax\hrule width#2 depth0pt height#5}\vss}}}}
\def\itf@wallpapergraduate #1{%
   \tikz[remember picture,overlay]{
      \itf@papergraduate {#1} (current page.south west) - (current page.north east);}
}% \itf@wallpapergraduate
\def\itf@papergraduate #1#2-#3;{%
   \path let \p1 = ($#2-#3$)
         in node {\global\@tempdima\x1 \global\@tempdimb\y1};
   \@tempdima \ifdim\@tempdima<\z@-\fi\dimexpr\@tempdima*2540/7227\relax
   \@tempdimb \ifdim\@tempdimb<\z@-\fi\dimexpr\@tempdimb*2540/7227\relax
   \begin{scope}[shift={#2}]
   \@expandtwoargs\itf@paper@graduate{\strip@pt\@tempdima}{\strip@pt\@tempdimb}%
   \end{scope}
}% \paper@graduate
\def\itf@paper@graduate#1#2{{\hfuzz\maxdimen\vfuzz\hfuzz\hbadness\@M\vbadness\hbadness
   \itf@graduation@horiz [magenta,very nearly transparent] {#1mm}{#2mm}{1mm}{.1pt};
   \itf@graduation@horiz [magenta,nearly transparent] {#1mm}{#2mm}{5mm}{.1pt};
   \itf@graduation@horiz [magenta,nearly transparent] {#1mm}{#2mm}{10mm}{.2pt};
   \itf@graduation@horiz [black,nearly opaque] {1mm}{#2mm}{1mm}{.1pt};
   \itf@graduation@horiz [black,nearly opaque] {1.5mm}{#2mm}{5mm}{.1pt};
   \itf@graduation@horiz [black,opaque] {2mm}{#2mm}{10mm}{.1pt};
   \foreach \y in {0,10,...,#2}
      \node [inner sep=0pt,outer sep=0pt,font=\tiny,yshift=\y mm,xshift=3mm] at (0,0) {\y};
   \itf@graduation@vert [cyan,very nearly transparent] {#1mm}{#2mm}{1mm}{.1pt};
   \itf@graduation@vert [cyan,nearly transparent] {#1mm}{#2mm}{5mm}{.1pt};
   \itf@graduation@vert [cyan,nearly transparent] {#1mm}{#2mm}{10mm}{.2pt};
   \itf@graduation@vert [black,nearly opaque] {#1mm}{1mm}{1mm}{.1pt};
   \itf@graduation@vert [black,nearly opaque] {#1mm}{1.5mm}{5mm}{.1pt};
   \itf@graduation@vert [black,opaque] {#1mm}{2mm}{10mm}{.1pt};
   \foreach \x in {0,10,...,#1}
      \node [inner sep=0pt,outer sep=0pt,font=\tiny,xshift=\x mm,yshift=3mm] at (0,0) {\x};
}}% \itf@paper@graduate
\endinput
%%
%% End of file `interfaces-tikz.sty'.