diff options
Diffstat (limited to 'macros/latex/contrib/oberdiek/hycolor.dtx')
-rw-r--r-- | macros/latex/contrib/oberdiek/hycolor.dtx | 554 |
1 files changed, 1 insertions, 553 deletions
diff --git a/macros/latex/contrib/oberdiek/hycolor.dtx b/macros/latex/contrib/oberdiek/hycolor.dtx index 1a72eae9ce..d55a709153 100644 --- a/macros/latex/contrib/oberdiek/hycolor.dtx +++ b/macros/latex/contrib/oberdiek/hycolor.dtx @@ -67,13 +67,6 @@ % TDS:tex/latex/oberdiek/hycolor.sty % TDS:tex/latex/oberdiek/xcolor-patch.sty % TDS:doc/latex/oberdiek/hycolor.pdf -% TDS:doc/latex/oberdiek/test/hycolor-test1.tex -% TDS:doc/latex/oberdiek/test/hycolor-test2.tex -% TDS:doc/latex/oberdiek/test/hycolor-test3.tex -% TDS:doc/latex/oberdiek/test/hycolor-test-xcol1.tex -% TDS:doc/latex/oberdiek/test/hycolor-test-xcol2.tex -% TDS:doc/latex/oberdiek/test/hycolor-test-xcol3.tex -% TDS:doc/latex/oberdiek/test/hycolor-test-xcol4.tex % TDS:source/latex/oberdiek/hycolor.dtx % %<*ignore> @@ -151,10 +144,6 @@ and the derived files % \file{hycolor-test-xcol2.tex}{\from{hycolor.dtx}{test-xcolor,xcol2}}% % \file{hycolor-test-xcol3.tex}{\from{hycolor.dtx}{test-xcolor,xcol3}}% % \file{hycolor-test-xcol4.tex}{\from{hycolor.dtx}{test-xcolor-fbox}}% - \nopreamble - \nopostamble -% \usedir{source/latex/oberdiek/catalogue}% -% \file{hycolor.xml}{\from{hycolor.dtx}{catalogue}}% } \catcode32=13\relax% active space @@ -226,21 +215,6 @@ and the derived files % \fi % % -% \CharacterTable -% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} % % \GetFileInfo{hycolor.drv} % @@ -1443,526 +1417,7 @@ and the derived files % \begin{macrocode} %</xcolor> % \end{macrocode} -% -% \section{Test} -% -% \begin{macrocode} -%<*test1> -\ProvidesFile{hycolor-test1.tex}[2016/05/16 test file 1] -%</test1> -% \end{macrocode} -% -% \begin{macrocode} -%<*test2> -\ProvidesFile{hycolor-test2.tex}[2016/05/16 test file 2] -\let\pdfmatch\relax -%</test2> -% \end{macrocode} -% -% \begin{macrocode} -%<test3>\ProvidesFile{hycolor-test3.tex}[2016/05/16 test file 3] -% \end{macrocode} -% -% \begin{macrocode} -%<*test> -% \end{macrocode} -% \begin{macrocode} -\documentclass{article} - -\usepackage{qstest} -\IncludeTests{*} -\LogTests{log}{*}{*} - -\makeatletter - -\newcommand*{\TestPackageName}{test-package} -\newcommand*{\TestOptionName}{test-option} - -\newcommand\Message{} -\def\Message#1#{\immediate\write16} - -\newcommand*{\ExpectError}[2]{% - \begingroup - \global\let\saved@errhelp\errhelp - \global\let\saved@errmessage\errmessage - \let\errhelp\@gobble - \def\errmessage##1{% - \xdef\@ExpectErrorMessage{##1}% - }% - \PackageError\TestPackageName{#1}\@ehc - \def\errhelp##1{% - \global\let\errhelp\saved@errhelp - }% - \global\let\@ResultErrorMessage\@empty - \def\errmessage##1{% - \xdef\@ResultErrorMessage{##1}% - \global\let\errmessage\saved@errmessage - % \Message{[ ##1}% - % \Message{] (ignored error)}% - % \Message{}% - }% - #2% - \endgroup - \Expect*{\@ResultErrorMessage}*{\@ExpectErrorMessage}% -} -\usepackage{scrlfile} -\usepackage{hycolor}[2016/05/16] -%</test> -% \end{macrocode} -% -% \begin{macrocode} -%<*test1> -\begin{qstest}{NumNormalize}{num, normalize} - \def\test#1#2{% - \HyColor@NormalizeNum{#1}\cmd - \Expect*{\cmd}{#2}% - }% - \test{0}{0}% - \test{000}{0}% - \test{-1}{0}% - \test{ 0 }{0}% - \test{1.1}{1}% - \test{100}{1}% - \test{00100}{1}% - \test{99.99}{1}% - \test{0.0}{0}% - \test{00.00}{0}% - \test{0.}{0}% - \test{.0}{0}% - \test{0.1}{.1}% - \test{0.10}{.1}% - \test{0.1000}{.1}% - \test{.1000}{.1}% - \test{0.01}{.01}% - \test{0.01010}{.0101}% - \test{.0000000001}{.0000000001}% - \test{.9999999999}{.9999999999}% -\end{qstest} - -\begin{qstest}{BookmarkColor without xcolor}{bookmark, noxcolor} - \def\test#1#2{% - \HyColor@BookmarkColor{#1}\cmd\TestPackageName\TestOptionName - \Expect*{\cmd}{#2}% - }% - \test{[rgb]{1,0,0}}{1 0 0}% - \test{[gray]{0.10}}{.1 .1 .1}% - \test{}{}% - \test{[rgb]{ 1 , 1 , 0 }}{1 1 0}% - \def\errortest[#1]#2{% - \ExpectError{% - Color model `#1' is not supported\MessageBreak - without package `xcolor' in\MessageBreak - `\TestOptionName=[#1]{#2}'% hash-ok - }{% - \test{[#1]{#2}}{}% hash-ok - }% - }% - \errortest[cmyk]{1,0,0,0}% - \errortest[empty]{}% - \def\errortest#1{% - \ExpectError{% - This color specification is not supported\MessageBreak - without package `xcolor' in\MessageBreak - `\TestOptionName=#1'% - }{% - \test{#1}{}% - }% - }% -\end{qstest} -%</test1> -% \end{macrocode} -% -% \begin{macrocode} -%<*test1|test2> -\begin{qstest}{X0134 without xcolor}{X0134, noxcolor} - \def\test#1#2{% - \HyColor@XZeroOneThreeFour{#1}\cmd\TestPackageName\TestOptionName - \Expect*{\cmd}{#2}% - }% - \test{[empty]{}}{}% - \test{[rgb]{1,0,0}}{1 0 0}% - \test{[gray]{0.10}}{.1}% - \test{[cmyk]{0,1,0,0}}{0 1 0 0}% - \test{[rgb]{ 1 , 1 , 0 }}{1 1 0}% - \def\errortest[#1]#2{% - \ExpectError{% - Color model `#1' is not supported\MessageBreak - without package `xcolor' in\MessageBreak - `test-option=[#1]{#2}'% hash-ok - }{% - \HyColor@XZeroOneThreeFour{[{#1}]{#2}}\cmd - \TestPackageName\TestOptionName - \Expect{true}*{\ifx\cmd\relax true\else false\fi}% - }% - }% - \errortest[Gray]{10}% - \errortest[cmy]{1,0,0}% - \def\errortest#1{% - \ExpectError{% - This color specification is not supported\MessageBreak - without package `xcolor' in\MessageBreak - `test-option=#1'% - }{% - \HyColor@XZeroOneThreeFour{#1}\cmd\TestPackageName\TestOptionName - \Expect{true}*{\ifx\cmd\relax true\else false\fi}% - }% - }% - \errortest{yellow}% -\end{qstest} - -\begin{qstest}{HyperrefBorderColor without xcolor}% - {hyperef bordercolor, noxcolor}% - \def\test#1#2{% - \HyColor@HyperrefBorderColor{#1}\cmd\TestPackageName\TestOptionName - \Expect*{\cmd}{#2}% - }% - \test{[rgb]{1,0,0}}{1 0 0}% - \test{[gray]{0.10}}{.1 .1 .1}% - \test{[rgb]{ 1 , 1 , 0 }}{1 1 0}% - \def\errortest[#1]#2{% - \ExpectError{% - Color model `#1' is not supported\MessageBreak - without package `xcolor' in\MessageBreak - `test-option=[#1]{#2}'% hash-ok - }{% - \HyColor@HyperrefBorderColor{[{#1}]{#2}}\cmd - \TestPackageName\TestOptionName - \Expect{true}*{\ifx\cmd\relax true\else false\fi}% - }% - }% - \errortest[Gray]{10}% - \errortest[cmy]{1,0,0}% - \errortest[cmyk]{0,1,0,0}% - \def\errortest#1{% - \ExpectError{% - This color specification is not supported\MessageBreak - without package `xcolor' in\MessageBreak - `test-option=#1'% - }{% - \HyColor@HyperrefBorderColor{#1}\cmd - \TestPackageName\TestOptionName - \Expect{true}*{\ifx\cmd\relax true\else false\fi}% - }% - }% - \errortest{yellow}% -\end{qstest} -%</test1|test2> -% \end{macrocode} -% -% \begin{macrocode} -%<*test1|test2> -\usepackage{xcolor} -\definecolor[named]{MyGreen}{rgb}{0,0.7,0} -\definecolor{mygreen}{named}{MyGreen} -%</test1|test2> -% \end{macrocode} -% -% \begin{macrocode} -%<*test1> -\begin{qstest}{BookmarkColor with xcolor}{bookmark, xcolor} - \def\test#1#2{% - \HyColor@BookmarkColor{#1}\cmd\PackageName\OptionName - \Expect*{\cmd}{#2}% - }% - \test{[rgb]{1,0,0}}{1 0 0}% - \test{[gray]{0.10}}{.1 .1 .1}% - \test{}{}% - \test{[rgb]{ 1 , 1 , 0 }}{1 1 0}% - \test{[cmyk]{1,0,0,0}}{0 1 1}% - \test{red}{1 0 0}% - \test{cyan}{0 1 1}% - \test{red!40!blue}{.4 0 .6}% - \test{[Gray]{10}}{.66667 .66667 .66667}% - \test{[RGB]{100,200,50}}{.39217 .78432 .19609}% - \test{[wave]{363}}{.00316 0 .00316}% - \test{[wave]814}{.00797 0 0}% - \test{[HSB]{100,200,50}}{.03473 .20833 .12152}% - \test{[HTML]{A800FF}}{.65881 0 1}% - \test{[cmy]{.3,.5,.2}}{.7 .5 .8}% - \test{[cmyk]{.3,.5,.2,.1}}{.6 .4 .7}% - \test{[hsb]{.3,.5,.2}}{.12 .2 .1}% - \test{[Hsb]{120,.5,.2}}{.1 .2 .1}% - \test{[tHsb]{120,.5,.2}}{.2 .2 .1}% - \test{[named]{MyGreen}}{0 .7 0}% - \test{mygreen}{0 .7 0}% -\end{qstest} - -\begin{qstest}{HyperrefColor}{hyperref, color} - \def\test#1#2{% - \HyColor@HyperrefColor{#1}\cmd - \Expect*{\cmd}{#2}% - }% - \test{red}{red}% - \test{[rgb]{1,0,0}}{[{rgb}]{1,0,0}}% - \HyColor@HyperrefColor{}\cmd - \Expect{true}*{\ifx\cmd\relax true\else false\fi}% -\end{qstest} -%</test1> -% \end{macrocode} -% \begin{macrocode} -%<*test1|test2> -\begin{qstest}{X0134 with xcolor}{hyperref, X0134, xcolor} - \def\test#1#2{% - \HyColor@XZeroOneThreeFour{#1}\cmd\PackageName\OptionName - \Expect*{\cmd}{#2}% - }% - \test{[empty]{}}{}% - \test{[gray]{0.1}}{.1}% - \test{[rgb]{1,0.5,0.0}}{1 .5 0}% - \test{[cmyk]{0,1,0,0.5}}{0 1 0 .5}% - \test{[Gray]{10}}{.66667}% - \test{red}{1 0 0}% - \test{1 0 0}{1 0 0}% - \test{001.0 .23 0}{1 .23 0}% - \test{[named]{MyGreen}}{0 .7 0}% - \test{mygreen}{0 .7 0}% - \HyColor@XZeroOneThreeFour{}\cmd\PackageName\OptionName - \Expect{true}*{\ifx\cmd\relax true\else false\fi}% -\end{qstest} - -\begin{qstest}{FieldColor}{hyperref, field, FieldColor} - \def\test#1#2{% - \HyColor@FieldColor{#1}\cmd\PackageName\OptionName - \Expect*{\cmd}{#2}% - }% - \test{}{}% - \test{[gray]{0.7}}{.7 g}% - \test{[rgb]{1,0,0}}{1 0 0 rg}% - \test{[cmyk]{0,1,0,0}}{0 1 0 0 k}% - \test{[cmy]{.5,.4,.3}}{.5 .6 .7 rg}% -\end{qstest} -%</test1|test2> -% \end{macrocode} -% -% \subsection{Test for package \xpackage{attachfile2}} -% -% \begin{macrocode} -%<*test3> -\def\atfi@SETRGBCOLORtest{set-rgb} -\def\atfi@SETGRAYCOLORtest{set-gray} -\def\atfi@SETCMYKCOLORtest{set-cmyk} -\def\Test#1#2#3#4#5{% - \begingroup - \setbox0=\hbox{% - \begingroup - \chardef\HyColor@PdfVersion=6 % - \HyColor@AttachfileColor{#1}\spec\inlinemacro\annot - \TestPackageName\TestOptionName - \edef\inline{\inlinemacro{test}}% - \expandafter\Expect\expandafter{\spec}{#2}% - \expandafter\Expect\expandafter{\inline}{#3}% - \expandafter\Expect\expandafter{\annot}{#4}% - \endgroup - \begingroup - \chardef\HyColor@PdfVersion=7 % - \HyColor@AttachfileColor{#1}\spec\inlinemacro\annot - \TestPackageName\TestOptionName - \edef\inline{\inlinemacro{test}}% - \expandafter\Expect\expandafter{\spec}{#2}% - \expandafter\Expect\expandafter{\inline}{#3}% - \expandafter\Expect\expandafter{\annot}{#5}% - \endgroup - }% - \Expect*{\the\wd0}{0.0pt}% - \endgroup -} -\newif\ifError -\def\TestError[#1]#2#3#4#5#6{% - \begingroup - \global\Errorfalse - \let\OrgPackageError\PackageError - \def\PackageError##1##2##3{% - \edef\TestTemp{##1}% - \ifx\TestTemp\TestPackageName - \Expect*{\ifError too many errors\else ok\fi}{ok}% - \Expect*{#6}*{##2}% - \global\Errortrue - \else - \OrgPackageError{##1}{##2}{##3}% - \fi - }% - \setbox0=\hbox{% - \begingroup - \chardef\HyColor@PdfVersion=#1 % - \HyColor@AttachfileColor{#2}\spec\inlinemacro\annot - \TestPackageName\TestOptionName - \edef\inline{\inlinemacro{test}}% - \expandafter\Expect\expandafter{\spec}{#3}% - \expandafter\Expect\expandafter{\inline}{#4}% - \expandafter\Expect\expandafter{\annot}{#5}% - \endgroup - \ifx\\#6\\% - \else - \Expect*{\ifError ok\else missing error\fi}{ok}% - \fi - }% - \Expect*{\the\wd0}{0.0pt}% - \endgroup -} -\def\NoEmptyModel{% - Color model `empty' is not permitted for option `\TestOptionName'% -} -\def\ModelNoXcolor#1#2{% - Color model `#1' is not supported\MessageBreak - without package `xcolor' in\MessageBreak - `\TestOptionName=[#1]{#2}'% hash-ok -} -\def\SpecNoXColor#1{% - This color specification is not supported\MessageBreak - without package `xcolor' in\MessageBreak - `test-option=#1'% -} -% \end{macrocode} -% -% \begin{macrocode} -\begin{qstest}{AttachfileColor}{AttachfileColor} - \Test{}{}{}{}{}% - \Test{0.1 0.2 0.3}{[rgb]{.1,.2,.3}}{.1 .2 .3 set-rgb}% - {/C[.1 .2 .3]}{/C[.1 .2 .3]}% - \Test{[gray]{0.4}}{[gray]{0.4}}{.4 set-gray}% - {/C[.4 .4 .4]}{/C[.4]}% - \Test{[rgb]{0.3,.2,.1}}{[rgb]{0.3,.2,.1}}{.3 .2 .1 set-rgb}% - {/C[.3 .2 .1]}{/C[.3 .2 .1]}% - \Test{0.0 1.0 1}{[rgb]{0,1,1}}{0 1 1 set-rgb}% - {/C[0 1 1]}{/C[0 1 1]}% - \Test{[gray]1}{[gray]1}{1 set-gray}{/C[1 1 1]}{/C[1]}% - \TestError[6]{[empty]{}}{}{}{}\NoEmptyModel - \TestError[7]{[empty]{}}{}{}{}\NoEmptyModel - \TestError[6]{[cmyk]{.1,.2,.3,.4}}{[cmyk]{.1,.2,.3,.4}}% - {.1 .2 .3 .4 set-cmyk}{}% - {\ModelNoXcolor{cmyk}{.1,.2,.3,.4}}% - \TestError[7]{[cmyk]{.1,.2,.3,.4}}{[cmyk]{.1,.2,.3,.4}}% - {.1 .2 .3 .4 set-cmyk}{/C[.1 .2 .3 .4]}{}% - \TestError[6]{red}{red}{}{}{\SpecNoXColor{red}}% - \TestError[7]{red}{red}{}{}{\SpecNoXColor{red}}% -\end{qstest} -% \end{macrocode} -% -% \begin{macrocode} -\usepackage{xcolor} -\definecolor[named]{MyGreen}{rgb}{0,0.7,0} -\definecolor{mygreen}{named}{MyGreen} -\definecolor{graynine}{gray}{0.9} -\definecolor{GraySix}{Gray}{9} -% \end{macrocode} -% -% \begin{macrocode} -\begin{qstest}{AttachfileColorX}{AttachfileColorX} - \Test{}{}{}{}{}% - \Test{0.1 0.2 0.3}{[rgb]{.1,.2,.3}}{.1 .2 .3 set-rgb}% - {/C[.1 .2 .3]}{/C[.1 .2 .3]}% - \Test{[gray]{0.4}}{[gray]{0.4}}{.4 set-gray}% - {/C[.4 .4 .4]}{/C[.4]}% - \Test{[rgb]{0.3,.2,.1}}{[rgb]{0.3,.2,.1}}{.3 .2 .1 set-rgb}% - {/C[.3 .2 .1]}{/C[.3 .2 .1]}% - \Test{0.0 1.0 1}{[rgb]{0,1,1}}{0 1 1 set-rgb}% - {/C[0 1 1]}{/C[0 1 1]}% - \Test{[gray]1}{[gray]1}{1 set-gray}{/C[1 1 1]}{/C[1]}% - \Test{red}{red}{1 0 0 set-rgb}{/C[1 0 0]}{/C[1 0 0]}% - \Test{black}{black}{0 set-gray}{/C[0 0 0]}{/C[0]}% - \Test{cyan}{cyan}{1 0 0 0 set-cmyk}{/C[0 1 1]}{/C[1 0 0 0]}% - \Test{[named]{black}}{[named]{black}}{0 0 0 set-rgb}% - {/C[0 0 0]}{/C[0 0 0]}% - \Test{[Gray]{9}}{[Gray]{9}}{.6 set-gray}{/C[.6 .6 .6]}{/C[.6]}% - \Test{[HTML]{0080FF}}{[HTML]{0080FF}}{0 .50195 1 set-rgb}% - {/C[0 .50195 1]}{/C[0 .50195 1]}% - \Test{graynine}{graynine}{.9 set-gray}{/C[.9 .9 .9]}{/C[.9]}% - \Test{GraySix}{GraySix}{.6 set-gray}{/C[.6 .6 .6]}{/C[.6]}% - \Test{[wave]{500}}{[wave]{500}}{0 1 .49846 set-rgb}% - {/C[0 1 .49846]}{/C[0 1 .49846]}% - \TestError[6]{[empty]{}}{}{}{}\NoEmptyModel - \TestError[7]{[empty]{}}{}{}{}\NoEmptyModel -\end{qstest} -% \end{macrocode} -% -% \begin{macrocode} -%</test3> -% \end{macrocode} -% -% \begin{macrocode} -%<*test> -\begin{document} -\end{document} -%</test> -% \end{macrocode} -% -% \subsection{Test for package \xpackage{xcolor}} -% -% \begin{macrocode} -%<*test-xcolor> -\NeedsTeXFormat{LaTeX2e} -\nofiles -\documentclass{minimal} -%<*xcol1> -\usepackage{xcolor} -\usepackage{xcolor-patch}[2016/05/16] -%</xcol1> -%<*xcol2> -\usepackage{scrlfile} -\usepackage{xcolor-patch}[2016/05/16] -\usepackage{xcolor} -%</xcol2> -%<*xcol3> -\usepackage{xcolor-patch}[2016/05/16] -\usepackage{xcolor} -\begin{document} -%</xcol3> -\makeatletter -\newcommand*{\ColModList}{% - rgb,% - cmy,% - cmyk,% - hsb,% - Hsb,% - tHsb,% - gray,% - RGB,% - HTML,% - HSB,% - Gray,% - % wave, -} -\newcommand*{\StartModel}{rgb} -\newcommand*{\StartValues}{.1,.2,.3} -\@for\x:=\ColModList\do{% - \ifx\x\@empty - \else - \convertcolorspec\StartModel\StartValues\x\y - \typeout{* [\StartModel]{\StartValues} ==> [\x]{\y}}% - \@for\xx:=\ColModList\do{% - \ifx\xx\@empty - \else - \convertcolorspec\x\y\xx\yy - \typeout{* [\x]{\y} ==> [\xx]{\yy}}% - \fi - }% - \fi -} -%<xcol3>\end{document} -%<xcol1|xcol2>\@@end -%</test-xcolor> -% \end{macrocode} -% -% \subsubsection{Test for \cs{@frameb@x}/\cs{fbox}} -% -% \begin{macrocode} -%<*test-xcolor-fbox> -\NeedsTeXFormat{LaTeX2e} -\documentclass{article} -\usepackage{xcolor} -\usepackage{xcolor-patch}[2016/05/16] -\makeatletter -\protected@edef\x{\fbox{abc}} -\let\@tempa\@undefined -\protected@edef\x{\fbox{abc}} -\makeatother -\begin{document} -\MakeUppercase{\fbox{abc}} -\end{document} -%</test-xcolor-fbox> -% \end{macrocode} -% -% \section{Installation} +%% \section{Installation} % % \subsection{Download} % @@ -2012,13 +1467,6 @@ and the derived files % hycolor.sty & tex/latex/oberdiek/hycolor.sty\\ % xcolor-patch.sty & tex/latex/oberdiek/xcolor-patch.sty\\ % hycolor.pdf & doc/latex/oberdiek/hycolor.pdf\\ -% test/hycolor-test1.tex & doc/latex/oberdiek/test/hycolor-test1.tex\\ -% test/hycolor-test2.tex & doc/latex/oberdiek/test/hycolor-test2.tex\\ -% test/hycolor-test3.tex & doc/latex/oberdiek/test/hycolor-test3.tex\\ -% test/hycolor-test-xcol1.tex & doc/latex/oberdiek/test/hycolor-test-xcol1.tex\\ -% test/hycolor-test-xcol2.tex & doc/latex/oberdiek/test/hycolor-test-xcol2.tex\\ -% test/hycolor-test-xcol3.tex & doc/latex/oberdiek/test/hycolor-test-xcol3.tex\\ -% test/hycolor-test-xcol4.tex & doc/latex/oberdiek/test/hycolor-test-xcol4.tex\\ % hycolor.dtx & source/latex/oberdiek/hycolor.dtx\\ % \end{tabular}^^A % }^^A |