diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/attachfile2.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/attachfile2.dtx | 130 |
1 files changed, 103 insertions, 27 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/attachfile2.dtx b/Master/texmf-dist/source/latex/oberdiek/attachfile2.dtx index aa66b73bda0..b29fc168600 100644 --- a/Master/texmf-dist/source/latex/oberdiek/attachfile2.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/attachfile2.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2005, 2006 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +% Copyright (C) 2005-2008 by Heiko Oberdiek <oberdiek@uni-freiburg.de> % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -70,7 +70,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: attachfile2 2007/04/11 v2.3 attach files into PDF (HO)} +\Msg{* Package: attachfile2 2008/07/29 v2.4 attach files into PDF (HO)} \Msg{************************************************************************} \keepsilent @@ -81,7 +81,7 @@ This is a generated file. -Copyright (C) 2005, 2006 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +Copyright (C) 2005-2008 by Heiko Oberdiek <oberdiek@uni-freiburg.de> This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -144,7 +144,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{attachfile2.drv}% - [2007/04/11 v2.3 attach files into PDF (HO)]% + [2008/07/29 v2.4 attach files into PDF (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2007/11/11] \begin{document} @@ -153,7 +153,7 @@ and the derived files %</driver> % \fi % -% \CheckSum{1383} +% \CheckSum{1380} % % \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 @@ -174,7 +174,7 @@ and the derived files % \GetFileInfo{attachfile2.drv} % % \title{The \xpackage{attachfile2} package} -% \date{2007/04/11 v2.3} +% \date{2008/07/29 v2.4} % \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}} % % \maketitle @@ -282,6 +282,67 @@ and the derived files % the generation of the auxiliary file \xfile{.atfi}. % \end{itemize} % +% \subsubsection{Option \xoption{color}} +% +% Package \xpackage{attachfile}'s option \xoption{color} only +% understands explicit RGB values as three space separated +% real numbers in the range from 0 to 1. +% +% This package \xpackage{attachfile2} extends the syntax. +% The usual color specifications of packages \xpackage{color} +% or \xpackage{xcolor} may be used. The latter one requires +% that package \xpackage{xcolor} is loaded. +% Without package \xpackage{xcolor} a limited range of +% explicit color specifications are supported, the color models +% \texttt{rgb} and \texttt{gray} (and \texttt{cmyk} if +% package \xpackage{hyperref}'s option \xoption{pdfversion} is set +% to \texttt{1.7} or greater. +% +% Example without package \xpackage{xcolor}: +%\begin{quote} +%\begin{verbatim} +%\documentclass{article} +%\usepackage[color={1 0 .5}]{attachfile2} +% % Spaces in option values in \usepackage or \documentclass +% % must be protected by curly braces. Otherwise LaTeX strips +% % the spaces and the package would see `color=10.5'. +% % This protection is not necessary for \attachfilesetup. +%\attachfilesetup{color=1 0 .5} +%\attachfilesetup{color=[rgb]{1,0,.5}} +%\attachfilesetup{color=[gray]{.5}} +%\end{verbatim} +%\end{quote} +% +% The following example with package \xpackage{xcolor} shows +% additional color specifications: +%\begin{quote} +%\begin{verbatim} +%\documentclass{article} +%\usepackage{xcolor} +%\definecolor{attachfilecolor}{cmyk}{.1,.2,.3,.4} +%\usepackage{color=red}{attachfile2} +%\attachfilesetup{color=red} +%\attachfilesetup{color=attachfilecolor} +%\end{verbatim} +%\end{quote} +% +% \paragraph{For experts.}% +% If the color is used in annotations, the color is converted +% with the help of package \xpackage{xcolor} to RGB. +% PDF versions 1.7 or later also understand color models Gray and +% CMYK. The PDF version is detected if the experimental +% option \xoption{pdfversion} +% of package \xpackage{hyperref} is used, example: +%\begin{quote} +%\begin{verbatim} +%\documentclass{article} +%\usepackage[pdfversion=1.7]{hyperref} +%\usepackage{attachfile2} +%\end{verbatim} +%\end{quote} +% However, currently only driver \xoption{pdftex} also supports +% the actual setting of the PDF version in the output PDF file. +% % \subsubsection{Perl script \xfile{pdfatfi.pl}} % % This package also tries to get and add meta information data, @@ -331,7 +392,7 @@ and the derived files %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{attachfile2}% - [2007/04/11 v2.3 attach files into PDF (HO)]% + [2008/07/29 v2.4 attach files into PDF (HO)]% % \end{macrocode} % \begin{macrocode} \RequirePackage{ifpdf} @@ -343,6 +404,7 @@ and the derived files \RequirePackage{hyperref} % because of \pdfstringdef +\RequirePackage{hycolor}[2008/07/29] \def\atfi@pdfstringdef#1#2{% \pdfstringdef\atfi@temp@string{#2}% @@ -470,8 +532,9 @@ and the derived files % option color \define@key{AtFi}{color}{% - \def\atfi@color{/C[#1]}% hash-ok - \def\atfi@color@rgb{#1}% + \HyColor@AttachfileColor{#1}% + \atfi@color@tex\atfi@color@inline\atfi@color@annot + {attachfile2}{color}% } \setkeys{AtFi}{color=1 0.9255 0.7765} @@ -611,10 +674,11 @@ and the derived files \begingroup \setkeys{AtFi}{#1}% \ifatfi@print - \def\atfi@textcolor(##1 ##2 ##3)##4{% - \textcolor[rgb]{##1,##2,##3}{##4}}% - \expandafter\atfi@textcolor\expandafter - (\atfi@color@rgb){#2\strut}% + \leavevmode + \begingroup + \HyColor@UseColor\atfi@color@tex + #2\strut + \endgroup \else \setbox0=\hbox{#2\strut}% \makebox[\wd0]{}% @@ -662,7 +726,7 @@ and the derived files 2.7319 4.1367 3.9571 13.8867 \atfi@RECTFILL 8.7031 4.1367 3.9571 9.8867 \atfi@RECTFILL 14.7471 4.1367 3.9571 11.8867 \atfi@RECTFILL - \atfi@color@rgb\space \atfi@SETRGBCOLORFILL + \atfi@color@inline{FILL}% 1.689 3.0938 3.9571 13.8867 \atfi@RECTFILL 7.6602 3.0938 3.9571 9.8867 \atfi@RECTFILL 13.7041 3.0938 3.9571 11.8867 \atfi@RECTFILL @@ -711,7 +775,7 @@ and the derived files 6.9692 6.3301 6.9692 7.1572 \atfi@CURVETOV 6.9692 7.9863 6.9692 12.21 \atfi@CURVETOY \atfi@STROKE - \atfi@color@rgb\space \atfi@SETRGBCOLORSTROKE + \atfi@color@inline{STROKE}% 1 \atfi@SETLINEWIDTH 1.2495 12.4404 \atfi@MOVETO 1.2495 3.9883 1.2495 3.1895 \atfi@CURVETOV @@ -754,7 +818,7 @@ and the derived files 11 1 \atfi@LINETO 11 6 \atfi@LINETO \atfi@FILLSTROKE{% - \atfi@color@rgb\space\atfi@SETRGBCOLORFILL + \atfi@color@inline{FILL}% }{% 0 \atfi@SETGRAYSTROKE }% @@ -816,7 +880,7 @@ and the derived files 9.4463 10.1035 8.7344 10.9199 7.856 10.9199 \atfi@CURVETO \atfi@CLOSEPATH \atfi@FILLSTROKE{% - \atfi@color@rgb\space\atfi@SETRGBCOLORFILL + \atfi@color@inline{FILL}% }{% 0 \atfi@SETGRAYSTROKE }% @@ -1042,11 +1106,13 @@ and the derived files \def\atfi@textattachfile@i#1#2#3{% \setkeys{AtFi}{#1}% \atfi@embedfile{#2}% - \def\atfi@textcolor(##1 ##2 ##3)##4{% - \textcolor[rgb]{##1,##2,##3}{##4}}% \atfi@set@appearance{% - \expandafter\atfi@textcolor\expandafter - (\atfi@color@rgb){#3\strut}}% + \leavevmode + \begingroup + \HyColor@UseColor\atfi@color@tex + #3\strut + \endgroup + }% \atfi@flags@to@int \atfi@insert@file@annot{#2}% \endgroup @@ -1093,7 +1159,7 @@ and the derived files %<*pdftex> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{atfipdftex.def}% - [2007/04/11 v2.3 attachfile2 driver for pdfTeX (HO)]% + [2008/07/29 v2.4 attachfile2 driver for pdfTeX (HO)]% % \end{macrocode} % \begin{macrocode} \let\atfi@literal\pdfliteral @@ -1115,6 +1181,8 @@ and the derived files \def\atfi@SETRGBCOLORFILL{rg } \def\atfi@SETGRAYSTROKE{G } \def\atfi@SETGRAYFILL{g } +\def\atfi@SETCMYKCOLORSTROKE{K } +\def\atfi@SETCMYKCOLORFILL{k } \def\atfi@RECTFILL{re f } \def\atfi@RECTSTROKEFILL#1#2#3{#1#2#3re B } \def\atfi@SETMITERLIMIT{M } @@ -1205,7 +1273,7 @@ and the derived files depth \atfi@scale\atfi@appearancedepth {% /Subtype/FileAttachment% \atfi@icon - \atfi@color + \atfi@color@annot \atfi@author \atfi@date \atfi@annotname @@ -1230,7 +1298,7 @@ and the derived files %<*dvips> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{atfipdftex.def}% - [2007/04/11 v2.3 attachfile2 driver for dvips (HO)]% + [2008/07/29 v2.4 attachfile2 driver for dvips (HO)]% % \end{macrocode} % \begin{macrocode} \def\atfi@literal#1{% @@ -1446,6 +1514,8 @@ and the derived files \def\atfi@SETRGBCOLORFILL{setrgbcolor } \def\atfi@SETGRAYSTROKE{setgray } \def\atfi@SETGRAYFILL{setgray } +\def\atfi@SETCMYKCOLORSTROKE{setcmykcolor } +\def\atfi@SETCMYKCOLORFILL{setcmykcolor } \def\atfi@RECTFILL{atfi_rectfill } \def\atfi@RECTSTROKEFILL#1#2#3{% #3% @@ -1701,7 +1771,7 @@ and the derived files [% /Subtype/FileAttachment% \atfi@icon - \atfi@color + \atfi@color@annot \atfi@author \atfi@date \atfi@annotname @@ -1765,8 +1835,8 @@ $^W=1; # turn warning on # my $file = "pdfatfi.pl"; my $program = uc($&) if $file =~ /^\w+/; -my $version = "2.3"; -my $date = "2007/04/11"; +my $version = "2.4"; +my $date = "2008/07/29"; my $author = "Heiko Oberdiek"; my $copyright = "Copyright (c) 2005, 2006 by $author."; # @@ -2191,6 +2261,12 @@ __END__ % \item % Line ends sanitized. % \end{Version} +% \begin{Version}{2008/07/29 v2.4} +% \item +% Improved color support. Option \xoption{color} now understands +% the usual color specifications if package \xpackage{xcolor} is +% loaded. +% \end{Version} % \end{History} % % \PrintIndex |