blob: 0d8f10e08192aa93c4a7c3492ab979bd38bfe720 (
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
|
% 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 Free Documentation License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
% Make sure to use tex4ht (or htlatex, to be precise) to compile this.
\usepackage{tex4ht}
\def\pgfsysdriver{pgfsys-tex4ht.def}
\usepackage{xkeyval}
\usepackage{colortbl}
\makeatletter
\AtBeginDocument{
\CutAt{section,part}
\definecolor{graphicbackground}{rgb}{0.96,0.96,0.8}
\definecolor{codebackground}{rgb}{0.8,0.8,1}
\definecolor{declarebg}{rgb}{1,0.8,0.8}
\definecolor{gray}{gray}{.5}
\definecolor{darkgreen}{rgb}{0,.5,0}
% Patches of macros...
\renewenvironment{pgfmanualentry}{\begin{description}}{\end{description}}
\renewcommand\pgfmanualentryheadline[1]{\item[\colorbox{declarebg}{\normalfont{#1}}]\par}
\renewcommand\pgfmanualbody{}
\def\endofcodeexample#1{%
\endgroup%
\ifcode@execute%
\setbox\codeexamplebox=\hbox{%
{%
{%
\returntospace%
\commenthandler%
\xdef\code@temp{#1}% removes returns and comments
}%
\color{black}\ignorespaces%
\code@pre\expandafter\scantokens\expandafter{\code@temp\ignorespaces}\code@post\ignorespaces%
}%
}%
\ifdim\wd\codeexamplebox>\codeexamplewidth%
\box\codeexamplebox
\begin{tabular}{>{\columncolor{codebackground}}l}
\begin{minipage}{\textwidth}
{%
\let\do\@makeother
\dospecials
\frenchspacing\@vobeyspaces
\normalfont\ttfamily\footnotesize
\typesetcomment%
\@tempswafalse
\def\par{%
\if@tempswa
\leavevmode \null \@@par\penalty\interlinepenalty
\else
\@tempswatrue
\ifhmode\@@par\penalty\interlinepenalty\fi
\fi}%
\obeylines
\everypar \expandafter{\the\everypar \unpenalty}%
#1}
\end{minipage}
\end{tabular}%
\else
\begin{tabular}{>{\columncolor{graphicbackground}}l>{\columncolor{codebackground}}l}
\ \box\codeexamplebox\ \par &
\begin{minipage}[t]{\textwidth}
{\let\do\@makeother
\dospecials
\frenchspacing\@vobeyspaces
\normalfont\ttfamily\footnotesize
\typesetcomment%
\@tempswafalse
\def\par{%
\if@tempswa
\leavevmode \null \@@par\penalty\interlinepenalty
\else
\@tempswatrue
\ifhmode\@@par\penalty\interlinepenalty\fi
\fi}%
\obeylines
\everypar \expandafter{\the\everypar \unpenalty}%
#1}
\end{minipage}
\end{tabular}
\fi
\else%
\begin{tabular}{>{\columncolor{codebackground}}l}
\begin{minipage}[t]{\textwidth}
{%
\let\do\@makeother
\dospecials
\frenchspacing\@vobeyspaces
\normalfont\ttfamily\footnotesize
\typesetcomment%
\@tempswafalse
\def\par{%
\if@tempswa
\leavevmode \null \@@par\penalty\interlinepenalty
\else
\@tempswatrue
\ifhmode\@@par\penalty\interlinepenalty\fi
\fi}%
\obeylines
\everypar \expandafter{\the\everypar \unpenalty}%
#1}
\end{minipage}
\end{tabular}%
\fi%
\par%
\end{codeexample}
}
}
\makeatother
|