~ubuntu-branches/debian/sid/tex4ht/sid

« back to all changes in this revision

Viewing changes to texmf/tex/generic/tex4ht/color.4ht

  • Committer: Bazaar Package Importer
  • Author(s): Kapil Hari Paranjape
  • Date: 2005-04-05 14:14:41 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050405141441-x4dojdgz3frkfyet
Tags: 20050402.1817-1
* New upstream release (2005-04-02-18:17). Closes: #299934.
* See README.src, README.validate, README.Debian and copyright
  for information on minor changes.
* This upload fixes a some .htf files. Closes: #295109.
* Updated the description to reflect recent changes.
* Fixed some typos in src/tex4ht-mkht.tex and consequently
  in the mk4ht script.
* Updated the man page to include mk4ht. 
* Updated the description of options for the scripts in the man page.
  Put more information in the man page about the way the system works.
  Closes: #219348, #219347.
* Added debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
2
% color.4ht                             2005-03-27-10:43 %
 
3
% Copyright (C) 1997--2005       Eitan M. Gurari         %
 
4
%                                                        %
 
5
% This work may be distributed and/or modified under the %
 
6
% conditions of the LaTeX Project Public License, either %
 
7
% version 1.3 of this license or (at your option) any    %
 
8
% later version. The latest version of this license is   %
 
9
% in                                                     %
 
10
%   http://www.latex-project.org/lppl.txt                %
 
11
% and version 1.3 or later is part of all distributions  %
 
12
% of LaTeX version 2003/12/01 or later.                  %
 
13
%                                                        %
 
14
% This work has the LPPL maintenance status "maintained".%
 
15
%                                                        %
 
16
% This Current Maintainer of this work                   %
 
17
% is Eitan M. Gurari.                                    %
 
18
%                                                        %
 
19
% If you modify this program your changing its signature %
 
20
% with a directive of the following form will be         %
 
21
% appreciated.                                           %
 
22
%            \message{signature}                         %
 
23
%                                                        %
 
24
%                             gurari@cse.ohio-state.edu  %
 
25
%                 http://www.cse.ohio-state.edu/~gurari  %
 
26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
27
\immediate\write-1{version 2005-03-27-10:43}
 
28
 
 
29
 
 
30
\let\:temp\begingroup
 
31
\HLet\color@setgroup\:temp
 
32
\def\HColor{\:warning{\string\Hcode{...}{...} is deprecated; Use
 
33
   \string\Configure{HColor}{...}{...}}\Configure{HColor}}
 
34
\NewConfigure{HColor}[2]{\if !#1!\if!#2!\let\HColor\relax \else \edef\HColor{#2}\fi
 
35
\else
 
36
   \expandafter\edef\csname CLR:#1\endcsname{#2}\fi}
 
37
\pend:defIII\definecolor{%
 
38
  \expandafter\ifx\csname HColor:##2\endcsname\relax\else
 
39
     \csname HColor:##2\endcsname ##3 //%
 
40
     \edef\:temp{{HColor}{##1}{\HColor}}%
 
41
     \expandafter\Configure\:temp
 
42
  \fi}
 
43
 
 
44
\NewConfigure{color}{1}
 
45
\def\@textcolor#1#2#3{\protect\leavevmode{\protect\a:textcolor
 
46
      \color#1{#2}#3\protect\b:textcolor}}
 
47
\NewConfigure{textcolor}{2}
 
48
   \def\pagecolor{%
 
49
  \begingroup \a:pagecolor
 
50
      \let\ignorespaces\endgroup
 
51
      \let\set@color\set@page@color
 
52
      \color}
 
53
\NewConfigure{pagecolor}{1}
 
54
\def\@undeclaredcolor[#1]#2{\a:color{#1 #2}%
 
55
  \@ifundefined{color@#1}%
 
56
    {\@latex@error{Undefined color model `#1'}\@ehd}%
 
57
    {\csname color@#1\endcsname\current@color{#2}%
 
58
     \set@color}%
 
59
  \ignorespaces}
 
60
\pend:defI\@declaredcolor{\a:color{##1}}
 
61
\NewConfigure{SetHColor}[2]{{%
 
62
   \expandafter\let\expandafter\:temp \csname CLR:#2\endcsname
 
63
   \ifx \:temp\relax \edef\:temp{#2 //}\expandafter\get:colortyp\:temp
 
64
   \else             \let\HColor=\:temp \fi
 
65
   \ifx \HColor\relax
 
66
      \:warning{missing \string\Configure{HColor}{#2}{...}
 
67
           (in LaTeX: \csname\string\color @#2\endcsname)}%
 
68
      \expandafter\global\expandafter\let\csname CLR:#2\endcsname\empty
 
69
    \else #1\fi }}
 
70
\def\c:HColor:gray:{\def\HColor:gray##1 ##2//}
 
71
\Configure{HColor:gray}{\Configure{HColor}{}{}}
 
72
\def\c:HColor:rgb:{\def\HColor:rgb##1,##2,##3 ##4//}
 
73
\Configure{HColor:rgb}{\Configure{HColor}{}{}}
 
74
\def\c:HColor:cmyk:{\def\HColor:cmyk##1,##2,##3,##4 ##5//}
 
75
\Configure{HColor:cmyk}{\Configure{HColor}{}{}}
 
76
\def\get:colortyp#1 #2//{%
 
77
  \expandafter\ifx \csname HColor:#1\endcsname\relax
 
78
     \let\HColor=\relax
 
79
     \expandafter\ifx \csname\string\color @#1\endcsname \relax\else
 
80
   \expandafter\ifx \csname colortyp:\endcsname\relax \else
 
81
      \csname colortyp:\expandafter\expandafter\expandafter\endcsname
 
82
         \csname\string\color @#1\expandafter\endcsname
 
83
         \space . //%
 
84
\fi \fi
 
85
%
 
86
  \else
 
87
     \csname HColor:#1\endcsname #2//%
 
88
  \fi
 
89
}
 
90
 
 
91
\long\def\:temp#1#2#3{%
 
92
   \ifcolors@
 
93
      \def\:temp{#1}\def\:tempa{\relax}\ifx\:temp\:tempa
 
94
      \a:colorbox \else \a:fcolorbox \fi
 
95
   \fi
 
96
   {#1{\leavevmode #2{\set@color#3}}}%
 
97
   \ifcolors@
 
98
      \def\:temp{#1}\def\:tempa{\relax}\ifx\:temp\:tempa
 
99
      \b:colorbox \else \b:fcolorbox \fi
 
100
   \fi
 
101
}
 
102
\HLet\color@b@x\:temp
 
103
\NewConfigure{colorbox}{2}
 
104
\NewConfigure{fcolorbox}{2}
 
105
 
 
106
\Hinput{color}
 
107
\endinput
 
108