summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
blob: f9681aa4a560b4437e4ec1f1d158ba382f3a9437 (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
% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.


\catcode`\@=11\relax

\let\pgfutil@auxout=\@auxout
\let\pgfutil@tempcnta=\@tempcnta
\let\pgfutil@tempcntb=\@tempcntb
\let\pgfutil@voidb@x=\voidb@x
\let\pgfutil@toks@=\toks@


\def\pgfutil@definecolor{\definecolor}
\def\pgfutil@color{\color}
\def\pgfutil@colorlet{\colorlet}
\def\pgfutil@extractcolorspec{\extractcolorspec}
\def\pgfutil@convertcolorspec{\convertcolorspec}

\def\pgfutil@globalcolorsfalse{\let\ifglobalcolors\iffalse}
\def\pgfutil@globalcolorstrue{\let\ifglobalcolors\iftrue}

\let\pgfutil@minipage=\minipage
\let\pgfutil@endminipage=\endminipage

\def\pgfutil@doifcolorelse#1#2#3{%
  \expandafter\ifx\csname\string\color@#1\endcsname\relax%
    \let\pgf@next=\pgfutil@secondoftwo%
  \else
    \let\pgf@next=\pgfutil@firstoftwo%
  \fi%
  \pgf@next{#2}{#3}%  
}

\def\pgfutil@font@tiny{\tiny}
\def\pgfutil@font@scriptsize{\scriptsize}
\def\pgfutil@font@footnotesize{\footnotesize}
\def\pgfutil@font@small{\small}
\def\pgfutil@font@normalsize{\normalsize}
\def\pgfutil@font@large{\large}
\def\pgfutil@font@Large{\Large}
\def\pgfutil@font@huge{\huge}
\def\pgfutil@font@Huge{\Huge}

\def\pgfutil@font@itshape{\itshape}
\def\pgfutil@font@bfseries{\bfseries}

\def\pgfutil@font@normalfont{\normalfont}

\def\pgfutil@usemodule#1{\usepackage{#1}}

\let\pgfutil@selectfont=\selectfont

\let\pgfutil@tempboxa=\@tempboxa

\let\pgfutil@tempdima=\@tempdima
\let\pgfutil@tempdimb=\@tempdimb

\AtEndDocument{\the\pgfutil@everybye}

\def\pgfutil@insertatbegincurrentpagefrombox#1{%
  \global\setbox\pgfutil@abb\hbox{\unhbox\pgfutil@abb#1}%
}
\newbox\pgfutil@abb%
\def\pgfutil@insertatbegincurrentpage#1{%
  \expandafter\gdef\expandafter\pgfutil@abc\expandafter{\pgfutil@abc#1}%
}
\let\pgfutil@abc\pgfutil@empty%
\def\pgfutil@insertatbegineverypage#1{%
  \expandafter\gdef\expandafter\pgfutil@abe\expandafter{\pgfutil@abe#1}%
}
\let\pgfutil@abe\pgfutil@empty%

\RequirePackage{everyshi}
\EveryShipout{%
  % Add at begin page stuff
 \setbox\@cclv=\vbox{%
    \setbox\z@=\hbox{\pgfutil@abe\unhbox\pgfutil@abb\pgfutil@abc\global\let\pgfutil@abc\pgfutil@empty}%
    \wd\z@=\z@
    \ht\z@=\z@
    \dp\z@=\z@
    \box\z@
	% if TeX changes into vertical mode, it inserts \parskip and
	% \lineskip. Disable it here:
    \nointerlineskip
    \ifvbox\@cclv \unvbox\@cclv \else\hsize=\wd\@cclv \unhbox\@cclv \fi%
	%\box\@cclv
	% using \box instead of \unhbox or \unvbox 
	% has the advantage that glue settings won't be
	% altered (as for \unhbox/\unvbox). But \box breaks compatibility
	% with the 'remember picture' feature.
  }%
}

\endinput