summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/doc/version-for-tex4ht/pgfmanual-tex4ht.cfg
blob: 698a089573337edad623502708e2307bccaeefbf (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
% Copyright 2008 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}
\definecolor{orange}{rgb}{1,.5,0}
\definecolor{mintgreen}{rgb}{.5,.75,.5}
\definecolor{input}{rgb}{0,0,0.8}
\definecolor{output}{rgb}{0.7,0,0}
\definecolor{triangle}{rgb}{1,0.5,0}
\definecolor{border}{rgb}{0,0.8,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