From c31ae16f33e45aff6135e0fe9f226d55f1ce5e3f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 8 Sep 2010 00:21:54 +0000 Subject: attachfile 1.5 (7sep10) git-svn-id: svn://tug.org/texlive/trunk@19600 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/attachfile/attachfile.bib | 31 ++++++ .../source/latex/attachfile/attachfile.dtx | 123 ++++++++++----------- .../source/latex/attachfile/attachfile.ins | 27 ++--- 3 files changed, 106 insertions(+), 75 deletions(-) create mode 100644 Master/texmf-dist/source/latex/attachfile/attachfile.bib (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/attachfile/attachfile.bib b/Master/texmf-dist/source/latex/attachfile/attachfile.bib new file mode 100644 index 00000000000..6afbbe0be15 --- /dev/null +++ b/Master/texmf-dist/source/latex/attachfile/attachfile.bib @@ -0,0 +1,31 @@ +@Book{PDFRef, + author = {{Adobe Systems Incorporated}}, + title = {{PDF} Reference Version~1.6}, + publisher = {Adobe Press}, + year = 2004, + key = {PDF}, + edition = {Fifth}, + month = dec # {~3,}, + note = {ISBN~\mbox{0321304748}. Available from \url{http://partners.adobe.com/public/developer/en/pdf/PDFReference16.pdf}} +} + +@Unpublished{MediaTypes, + author = {{Internet Assigned Numbers Authority}}, + title = {{MIME} Media Types}, + note = {Available from \url{http://www.iana.org/assignments/media-types/}}, + key = {IANA} +} + +@TechReport{Freed1996, + author = {N. Freed and N. Borenstein}, + title = {{M}ultipurpose {I}nternet {M}ail {E}xtensions {(MIME)} + Part Two: Media Types}, + institution = {Internet Engineering Task Force (IETF), + Network Working Group}, + year = 1996, + type = {Request for Comments (RFC)}, + number = 2046, + month = nov, + note = {Available from + \url{http://www.rfc-editor.org/rfc/rfc2046.txt}} +} diff --git a/Master/texmf-dist/source/latex/attachfile/attachfile.dtx b/Master/texmf-dist/source/latex/attachfile/attachfile.dtx index 6a12f8fd749..fae747cc855 100644 --- a/Master/texmf-dist/source/latex/attachfile/attachfile.dtx +++ b/Master/texmf-dist/source/latex/attachfile/attachfile.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2008 by Scott Pakin +% Copyright (C) 2010 by Scott Pakin % ------------------------------------------------------- % % This file may be distributed and/or modified under the conditions of @@ -22,7 +22,7 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{attachfile} %<*package> - [2008/08/15 v1.3a PDF 1.3+ file attachment] + [2010/08/14 v1.4 PDF 1.3+ file attachment] % % %<*driver> @@ -41,7 +41,7 @@ % % \fi % -% \CheckSum{474} +% \CheckSum{485} % % \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 @@ -884,11 +884,6 @@ % those who need more precise documentation and those who want to extend % the \pkgname{attachfile} package. % -% \begin{macrocode} -%<*package> -% \end{macrocode} -% -% % \subsection{Sanity checking} % % \pkgname{attachfile} \fileversion\ requires \pdflatex\ (and at least @@ -1087,14 +1082,25 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\theatfi@embedfileobj} +% \begin{macro}{\c@atfi@tmp} +% Because \tex\ provides only a limited number of counters, we recycle a +% single counter, |atfi@tmp|, throughout the entire package whenever the +% need to perform arithmetic arises. +% \changes{v1.4}{2010/08/14}{Incorporated Martin M\"unch's reduction of +% the number of counters that \protect\pkgname{attachfile} uses from +% five to one} +% \begin{macrocode} +\newcounter{atfi@tmp} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\atfi@embedfile} +% \begin{macro}{\atfi@embedfileobj} % Embed a file as a \acronym{PDF} \pdfname{EmbeddedFile} object and store its -% object number in |atfi@embedfileobj|. +% object number in |\atfi@embedfileobj|. % \changes{v1.3}{2007/01/15}{Included a \protect\pdfname{Params} % dictionary describing the file's date, modification date, and size} % \begin{macrocode} -\newcounter{atfi@embedfileobj} \DeclareRobustCommand{\atfi@embedfile}[1]{% \immediate\pdfobj stream attr { /Type /EmbeddedFile @@ -1106,7 +1112,7 @@ \atfi@size\space >> } file {#1}% - \setcounter{atfi@embedfileobj}{\pdflastobj}% + \edef\atfi@embedfileobj{\the\pdflastobj}% } % \end{macrocode} % \end{macro} @@ -1115,39 +1121,38 @@ % \begin{macro}{\atfi@appearancewidth} % \begin{macro}{\atfi@appearanceheight} % \begin{macro}{\atfi@appearancedepth} -% \begin{macro}{\theatfi@appearanceobj} % \begin{macro}{\atfi@appearancebox} -% Each \acronym{PDF} annotation can an associated ``appearance''. In the -% \pkgname{attachfile} package, we store the appearance with the +% Each \acronym{PDF} annotation can an associated ``appearance''. In +% the \pkgname{attachfile} package, we store the appearance with the % |\atfi@set@appearance| macro (below). As a side effect, % |\atfi@set@appearance| stores the dimensions of its argument in % |\atfi@appearancewidth|, |\atfi@appearanceheight|, and -% |\atfi@appearanceddepth| so that, later, we can allocate an appropriate -% amount of space for the file attachment icon to fit within. -% |atfi@appearanceobj| is the object number of the appearance -% \pdfname{XObject}, and |\atfi@appearancebox| is a temporary storage -% location for the \tex\ box that will get converted to an \pdfname{XObject}. +% |\atfi@appearanceddepth| so that, later, we can allocate an +% appropriate amount of space for the file attachment icon to fit +% within. |\atfi@appearancebox| is a temporary storage location for the +% \tex\ box that will get converted to an \pdfname{XObject}. % \begin{macrocode} \newlength{\atfi@appearancewidth} \newlength{\atfi@appearanceheight} \newlength{\atfi@appearancedepth} -\newcounter{atfi@appearanceobj} \newsavebox{\atfi@appearancebox} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} -% \end{macro} % % \begin{macro}{\atfi@set@appearance} -% Store the argument as a \acronym{PDF} \pdfname{XObject}, for later referral by the -% file annotation's appearance dictionary. This serves two purposes: +% \begin{macro}{\atfi@appearance@obj} +% |\atfi@set@appearance| stores its argument as a \acronym{PDF} +% \pdfname{XObject} for later referral by the file annotation's +% appearance dictionary. This serves two purposes: +% % \begin{enumerate} -% \item It enables a \tex\ box with arbitrary contents to serve as the file -% attachment icon. -% \item It enables (generally, older) \acronym{PDF} viewers which don't recognize the -% icon name to still display something meaningful. +% \item It enables a \tex\ box with arbitrary contents to serve as the +% file attachment icon. +% \item It enables (generally older) \acronym{PDF} viewers that don't +% recognize the icon name to still display something meaningful. % \end{enumerate} % \begin{macrocode} \DeclareRobustCommand{\atfi@set@appearance}[1]{% @@ -1158,26 +1163,27 @@ \immediate\pdfxform attr { /Subtype /Form } \atfi@appearancebox - \setcounter{atfi@appearanceobj}{\pdflastxform}% + \edef\atfi@appearanceobj{\the\pdflastxform}% } % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\atfi@flags@to@int} -% \begin{macro}{\theatfi@flags} +% \begin{macro}{\atfi@flags} % Convert all our flag options from booleans into a single integer -% (|atfi@flags|). +% (|\atfi@flags|). % \begin{macrocode} -\newcounter{atfi@flags} \DeclareRobustCommand{\atfi@flags@to@int}{% - \setcounter{atfi@flags}{0}% + \setcounter{atfi@tmp}{0}% \ifatfi@print - \addtocounter{atfi@flags}{4}% - \fi% + \addtocounter{atfi@tmp}{4}% + \fi \ifatfi@zoom \else - \addtocounter{atfi@flags}{8}% - \fi% + \addtocounter{atfi@tmp}{8}% + \fi + \edef\atfi@flags{\theatfi@tmp}% } % \end{macrocode} % \end{macro} @@ -1219,9 +1225,9 @@ % \begin{macrocode} \def\atfi@appearance@dict{% /AP << - /N \theatfi@appearanceobj\space 0 R - /R \theatfi@appearanceobj\space 0 R - /D \theatfi@appearanceobj\space 0 R + /N \atfi@appearanceobj\space 0 R + /R \atfi@appearanceobj\space 0 R + /D \atfi@appearanceobj\space 0 R >>% }% \fi% @@ -1237,12 +1243,12 @@ \atfi@icon\space \atfi@moddate\space \atfi@subject\space - /F \theatfi@flags\space + /F \atfi@flags\space /FS << /Type /Filespec /F (\atfi@file) /EF << - /F \theatfi@embedfileobj\space 0 R + /F \atfi@embedfileobj\space 0 R >> >> }% @@ -1433,10 +1439,10 @@ % \begin{macrocode} \def\atfi@pad@ii#1{% \ifnum#1>9 - \the#1% + #1% \else - 0\the#1% - \fi% + 0#1% + \fi } % \end{macrocode} % \end{macro} @@ -1452,9 +1458,8 @@ % \end{macro} % % \begin{macro}{\atfi@time} -% \begin{macro}{\c@atfi@hours} -% \begin{macro}{\theatfi@hours} -% \begin{macro}{\c@atfi@minutes} +% \begin{macro}{\atfi@hours} +% \begin{macro}{\atfi@minutes} % \begin{macro}{\atfi@date} % The date the annotation was last modified. It's unlikely you'd % want to specify this explicitly in your \latex\ document, but @@ -1470,16 +1475,16 @@ % \protect\texttt{\protect\string\protect\Hy@unicodetrue}} % \begin{macrocode} \edef\atfi@time{\time} -\newcounter{atfi@hours} -\setcounter{atfi@hours}{\atfi@time/60} -\newcounter{atfi@minutes} -\setcounter{atfi@minutes}{\atfi@time-\theatfi@hours*60} +\setcounter{atfi@tmp}{\atfi@time/60} +\edef\atfi@hours{\theatfi@tmp} +\setcounter{atfi@tmp}{\atfi@time-\atfi@hours*60} +\edef\atfi@minutes{\theatfi@tmp} \def\atfi@date{% /M (D:\the\year% - \atfi@pad@ii\month% - \atfi@pad@ii\day% - \atfi@pad@ii\c@atfi@hours% - \atfi@pad@ii\c@atfi@minutes + \expandafter\atfi@pad@ii\the\month + \expandafter\atfi@pad@ii\the\day + \atfi@pad@ii\atfi@hours + \atfi@pad@ii\atfi@minutes 00% \atfi@timezone)% } @@ -1495,7 +1500,6 @@ % \end{macro} % \end{macro} % \end{macro} -% \end{macro} % % \begin{macro}{\atfi@description} % Store the annotation's description. \adobeacrobat shows this when you @@ -1804,10 +1808,5 @@ \fi % \end{macrocode} % -% -% \begin{macrocode} -% -% \end{macrocode} -% % \Finale \endinput diff --git a/Master/texmf-dist/source/latex/attachfile/attachfile.ins b/Master/texmf-dist/source/latex/attachfile/attachfile.ins index 61b6bef9e98..66575decc8a 100644 --- a/Master/texmf-dist/source/latex/attachfile/attachfile.ins +++ b/Master/texmf-dist/source/latex/attachfile/attachfile.ins @@ -3,9 +3,9 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright (C) 2008 Scott Pakin +%% Copyright (C) 2010 Scott Pakin %% ------------------------------------------------------- -%% +%% %% This package may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either %% version 1.3c of this license or (at your option) any later @@ -28,7 +28,7 @@ This is a generated file. -Copyright (C) 2008 Scott Pakin +Copyright (C) 2010 Scott Pakin ------------------------------------------------------- This package may be distributed and/or modified under the @@ -45,15 +45,16 @@ LaTeX version 2006/05/20 or later. \generate{\file{attachfile.sty}{\from{attachfile.dtx}{package}}} -\Msg{***********************************************************} -\Msg{*} -\Msg{* To finish the installation, you have to move} -\Msg{* attachfile.sty into a directory searched by TeX.} -\Msg{*} -\Msg{* To produce the documentation, run attachfile.dtx} -\Msg{* through pdfLaTeX.} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{***********************************************************} +\obeyspaces +\Msg{******************************************************} +\Msg{* *} +\Msg{* To finish the installation, you have to move *} +\Msg{* attachfile.sty into a directory searched by TeX. *} +\Msg{* *} +\Msg{* To produce the documentation, run attachfile.dtx *} +\Msg{* through pdfLaTeX. *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{******************************************************} \endbatchfile -- cgit v1.2.3