diff options
author | Karl Berry <karl@freefriends.org> | 2015-10-02 22:14:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-10-02 22:14:20 +0000 |
commit | 02c2f6728f93ebf72e1a66357cb7ff82e6a75a9b (patch) | |
tree | d77c9dc7867f2871cc88194b6411d3cd14aee227 /Master/texmf-dist/source/latex | |
parent | 6113d079281880a8e577e7d3b916e51b36ce602c (diff) |
attachfile (2oct15)
git-svn-id: svn://tug.org/texlive/trunk@38528 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/attachfile/attachfile.dtx | 173 |
1 files changed, 94 insertions, 79 deletions
diff --git a/Master/texmf-dist/source/latex/attachfile/attachfile.dtx b/Master/texmf-dist/source/latex/attachfile/attachfile.dtx index 96734f2fee0..09c4f559820 100644 --- a/Master/texmf-dist/source/latex/attachfile/attachfile.dtx +++ b/Master/texmf-dist/source/latex/attachfile/attachfile.dtx @@ -22,20 +22,24 @@ %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{attachfile} %<*package> - [2015/04/04 v1.6 PDF 1.3+ file attachment] + [2015/09/30 v1.7 PDF 1.3+ file attachment] %</package> % %<*driver> \documentclass{ltxdoc} \usepackage{color} \usepackage{xspace} -\usepackage[hyperindex=false,bookmarksopen=true]{attachfile} +\usepackage{needspace} +\usepackage{tocbibind} +\usepackage[hyperindex=false,bookmarksopen]{attachfile} \usepackage{hyperxmp} \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} \DocInput{attachfile.dtx} + \Needspace{10\baselineskip} + \phantomsection\addcontentsline{toc}{section}{Change History} \PrintChanges \PrintIndex \end{document} @@ -85,7 +89,7 @@ %<*package> % \fi % -% \CheckSum{502} +% \CheckSum{507} % % \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 @@ -110,8 +114,7 @@ % contain special characters, e.g., underscores} % \changes{v1.3}{2007/01/15}{Incorporated Ross Moore's patches for % making \protect\pkgname{attachfile} robust to running -% \protect\pkgname{hyperref} with -% \protect\texttt{\protect\string\protect\Hy@unicodetrue} and for +% \protect\pkgname{hyperref} with \cs{Hy@unicodetrue} and for % supporting the \protect\pdfname{Created}, % \protect\pdfname{Modified}, and \protect\pdfname{Size} keys in the % \protect\pdfname{EmbeddedFile}'s \protect\pdfname{Params} @@ -119,14 +122,15 @@ % % \GetFileInfo{attachfile.dtx} % -% \DoNotIndex{\addtocounter,\begingroup,\bgroup,\catcode,\csname} -% \DoNotIndex{\DeclareRobustCommand,\def,\do,\dospecials,\edef,\egroup,\else} -% \DoNotIndex{\endcsname,\endgroup,\expandafter,\fi,\gdef,\hbox,\ifnum,\ifx} -% \DoNotIndex{\ifpdf,\immediate,\let,\makebox,\MessageBreak,\newcommand} -% \DoNotIndex{\newcounter,\newif,\newlength,\newsavebox,\parbox,\protect} -% \DoNotIndex{\raisebox,\relax,\rule,\savebox,\setbox,\setcounter} -% \DoNotIndex{\setkeys,\settodepth,\settoheight,\settowidth,\space,\strut} -% \DoNotIndex{\the,\undefined,\usebox,\wd,\xdef,\{,\}} +% \DoNotIndex{\#,\@,\DeclareRobustCommand,\MessageBreak,\\,\addtocounter} +% \DoNotIndex{\begingroup,\bgroup,\catcode,\csname,\def,\do,\dospecials} +% \DoNotIndex{\edef,\egroup,\else,\endcsname,\endgroup,\expandafter,\fi} +% \DoNotIndex{\gdef,\hbox,\ifnum,\ifpdf,\ifx,\immediate,\let,\makebox} +% \DoNotIndex{\newcommand,\newcounter,\newif,\newlength,\newsavebox,\parbox} +% \DoNotIndex{\protect,\raisebox,\relax,\renewcommand,\rule,\savebox} +% \DoNotIndex{\setbox,\setcounter,\setkeys,\settodepth,\settoheight} +% \DoNotIndex{\settowidth,\space,\strut,\the,\undefined,\usebox,\wd,\xdef} +% \DoNotIndex{\{,\}} % % \hypersetup{^^A % pdftitle={The attachfile package}, @@ -151,7 +155,9 @@ % ^^A Define some logical styles. % \newcommand{\menuname}[1]{\textit{#1}} % \newcommand{\pkgname}[1]{^^A -% \textsf{#1}\SortIndex{#1}{#1 (package)\encapchar usage}} +% \textsf{#1}^^A +% \SortIndex{#1}{\textsf{#1} (package)\encapchar usage}^^A +% \index{packages>\textsf{#1}\encapchar usage}} % \newcommand{\pdfname}[1]{^^A % \textsf{#1}\SortIndex{#1}{\textsf{#1}\encapchar usage}} % \newcommand{\acronym}[1]{^^A @@ -164,6 +170,8 @@ % \BibTeX\SortIndex{BibTeX}{\BibTeX\encapchar usage}} % \newcommand{\pdflatex}{^^A % pdf\LaTeX\SortIndex{pdfLaTeX}{pdf\LaTeX\encapchar usage}} +% \newcommand{\lualatex}{^^A +% Lua\LaTeX\SortIndex{LuaLaTeX}{Lua\LaTeX\encapchar usage}} % \newcommand{\latex}{^^A % \LaTeX\SortIndex{LaTeX}{\LaTeX\encapchar usage}} % \newcommand{\tex}{^^A @@ -823,51 +831,52 @@ % Note that there are a few caveats you should be aware of: % % \begin{enumerate} -% \item \pkgname{attachfile} requires \pdflatex{} version~0.14 or -% later. (Version~0.14 was released circa~1999 so it's unlikely that -% you're running an older version than that.) While there are many -% other ways to produce \acronym{PDF} files from \latex{} source, -% \pkgname{attachfile}~\fileversion{} supports only \pdflatex, and -% only versions~0.14+. -% -% \item \pkgname{attachfile} will not run unless the following \latex\ -% packages are installed: \pkgname{calc}, \pkgname{keyval}, -% \pkgname{color}, \pkgname{hyperref}, and \pkgname{ifpdf}. (Most -% \tex\ distributions include all of these.) -% +% \item \pkgname{attachfile} requires either \pdflatex\ version~0.14 +% or later or \lualatex. (Version~0.14 of \pdflatex\ was released +% circa~1999 so it's unlikely that you're running an older version +% than that.) While there are many other ways to produce +% \acronym{PDF} files from \latex\ source, +% \pkgname{attachfile}~\fileversion\ supports only \pdflatex\ and +% \lualatex. +% +% \item \pkgname{attachfile} will not run unless the following +% \latex\ packages are installed: \pkgname{calc}, \pkgname{keyval}, +% \pkgname{color}, \pkgname{hyperref}, and \pkgname{ifpdf}. (Most +% \tex\ distributions include all of these.) +% % \item File attachments are a \acronym{PDF}~1.3 feature. They will -% not be visible in \acronym{PDF} viewers that don't support -% \acronym{PDF}~1.3. (Version~4.0 of \adobeacrobat is the first -% version of that program which does.) -% +% not be visible in \acronym{PDF} viewers that don't support +% \acronym{PDF}~1.3. (Version~4.0 of \adobeacrobat is the first +% version of that program which does.) +% % \item Even some viewers that purportedly support \acronym{PDF}~1.3 -% don't support file attachments. As far as I can tell, very old -% versions of \adobeacrobatreader (the free, view-only version of -% \adobeacrobat) doesn't seem to support \emph{any} annotations except -% text annotations. -% +% don't support file attachments. As far as I can tell, very old +% versions of \adobeacrobatreader (the free, view-only version of +% \adobeacrobat) doesn't seem to support \emph{any} annotations +% except text annotations. +% % \item Even some viewers that do support \acronym{PDF}~1.3 and file -% attachments don't support them under all circumstances. For -% instance, some Windows\smallreg\ versions of \adobeacrobat, when -% functioning as a Web-browser plug-in, give an error -% message\footnote{``Launching embedded files from within a browser -% environment is not allowed''.} when a file attachment icon is -% activated. -% +% attachments don't support them under all circumstances. For +% instance, some Windows\smallreg\ versions of \adobeacrobat, when +% functioning as a Web-browser plug-in, give an error +% message\footnote{``Launching embedded files from within a browser +% environment is not allowed''.} when a file attachment icon is +% activated. +% % \item Even in circumstances where file attachments are supported, -% the support may be flawed. For example, some Windows\smallreg\ -% versions of \adobeacrobat change a custom icon to the default icon -% when it's selected. -% -% Also, while file-attachment icons with custom appearances printed -% fine in older versions of \adobeacrobat, \adobe introduced a bug -% circa \adobeacrobat~6.0 that prevents \pkgname{attachfile}'s icons -% from printing. Unfortunately, because \adobeacrobat lacks -% \pkgname{attachfile}'s ability to create custom appearances for -% file-attachment icons it's unlikely that this bug will ever get -% fixed. Nevertheless, please consider sending a bug report to \adobe -% to let them know that you'd like to be able to print file-attachment -% icons with custom appearances. +% the support may be flawed. For example, some +% Windows\smallreg\ versions of \adobeacrobat change a custom icon +% to the default icon when it's selected. +% +% Also, while file-attachment icons with custom appearances printed +% fine in older versions of \adobeacrobat, \adobe introduced a bug +% circa \adobeacrobat~6.0 that prevents \pkgname{attachfile}'s icons +% from printing. Unfortunately, because \adobeacrobat lacks +% \pkgname{attachfile}'s ability to create custom appearances for +% file-attachment icons it's unlikely that this bug will ever get +% fixed. Nevertheless, please consider sending a bug report to +% \adobe to let them know that you'd like to be able to print +% file-attachment icons with custom appearances. % \end{enumerate} % % Even given all of those caveats, file attachments can be a useful way @@ -881,8 +890,9 @@ % % The following are some avenues for future work on % \pkgname{attachfile}. First, \pkgname{attachfile} supports only -% \pdflatex\ for generating \acronym{PDF} files. It would be nice if it -% supported all the backends that \pkgname{hyperref} supports: +% \pdflatex\ and \lualatex\ for generating \acronym{PDF} files. It +% would be nice if it supported all the backends that +% \pkgname{hyperref} supports: % dvipdfm\SortIndex{dvipdfm}{dvipdfm\encapchar usage}, % dvips\SortIndex{dvips}{dvips\encapchar usage} with % pdfmarks\SortIndex{pdfmarks}{pdfmarks\encapchar usage}, @@ -906,7 +916,6 @@ % time to enhance it. % % \begin{thebibliography}{1} -% \addcontentsline{toc}{section}{References} % \bibitem{PDFRef} % {Adobe Systems Incorporated}. % \newblock {\em {PDF} Reference Version~1.6}. @@ -939,19 +948,20 @@ % % \subsection{Sanity checking} % -% \pkgname{attachfile} \fileversion\ requires \pdflatex\ (and at least -% version~0.14, although \pkgname{attachfile} no longer checks for -% that). (Future versions of \pkgname{attachfile} may support +% \pkgname{attachfile} \fileversion\ requires either \lualatex\ or +% \pdflatex\ (and at least version~0.14 of \pdflatex, although +% \pkgname{attachfile} no longer checks for that). (Future versions of +% \pkgname{attachfile} may support % dvipdfm\SortIndex{dvipdfm}{dvipdfm\encapchar usage}, % dvips\SortIndex{dvips}{dvips\encapchar usage} with % pdfmarks\SortIndex{pdfmarks}{pdfmarks\encapchar usage}, -% V\TeX\SortIndex{VTeX}{V\TeX\encapchar usage}, etc.) Also, \pdflatex\ -% must be in \acronym{PDF}-generating mode, not \acronym{DVI}-generating -% mode. So, to save the user some aggravation, we check for the correct -% backend right up front and give a warning if all is not well. Later, -% in Section~\ref{sec:dummy-commands}, we replace all of the core -% \pkgname{attachfile} macros with dummy versions so \latex\ can at -% least run to completion. +% V\TeX\SortIndex{VTeX}{V\TeX\encapchar usage}, etc.) Also, +% \pdflatex\slash\lualatex must be in \acronym{PDF}-generating mode, not +% \acronym{DVI}-generating mode. So, to save the user some aggravation, +% we check for the correct backend right up front and give a warning if +% all is not well. Later, in Section~\ref{sec:dummy-commands}, we +% replace all of the core \pkgname{attachfile} macros with dummy +% versions so \latex\ can at least run to completion. % \changes{v1.3a}{2008/08/15}{Corrected the formatting of the ``not % \string\pdflatex'' warning message} % \begin{macrocode} @@ -959,9 +969,10 @@ \ifpdf \else \PackageWarningNoLine{attachfile}{% - attachfile works _only_ with pdfLaTeX and _only_ in\MessageBreak - PDF-generating mode. For this run, placeholders will\MessageBreak - be substituted for all attachfile commands.% + attachfile works _only_ with pdfLaTeX and LuaLaTeX\MessageBreak + and _only_ in PDF-generating mode. For this run,\MessageBreak + placeholders will be substituted for all\MessageBreak + attachfile commands% } \fi % \end{macrocode} @@ -1142,10 +1153,16 @@ % \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{macro}{\theatfi@tmp} +% \changes{v1.7}{2015/09/30}{Made the package robust to redefinitions +% of \cs{@arabic}, such as those made by the \protect\pkgname{babel} +% package (reported by Jonas Olson and fixed by Heiko Oberdiek)} % \begin{macrocode} \newcounter{atfi@tmp} +\renewcommand*{\theatfi@tmp}{\the\value{atfi@tmp}} % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\atfi@embedfile} % If the given file has not yet been embedded, embed it as a @@ -1254,8 +1271,7 @@ % to attach. This should be the same value that was passed to % |\atfi@embedfile|. % \changes{v1.3}{2007/01/15}{Made robust to running -% \protect\pkgname{hyperref} with -% \protect\texttt{\protect\string\protect\Hy@unicodetrue}} +% \protect\pkgname{hyperref} with \cs{Hy@unicodetrue}} % \begin{macrocode} \DeclareRobustCommand{\atfi@insert@file@annot}[1]{% \rule{0pt}{0pt}% @@ -1720,9 +1736,8 @@ % |\atfi@attachfile|. |\attachfile| merely sets up the category codes % in such a way as to allow filenames to contain special characters such % as underscores. -% \changes{v1.5}{2010/08/27}{Reset ``\texttt{\char`\\}'' -% to category code~0 to enable the use of -% \texttt{\string\string\string\jobname} in the name of the file +% \changes{v1.5}{2010/08/27}{Reset ``\texttt{\char`\\}'' to category +% code~0 to enable the use of \cs{jobname} in the name of the file % attachment (suggested by Felix Mueller-Sarnowski)} % \begin{macrocode} \DeclareRobustCommand{\attachfile}[1][]{% @@ -1820,14 +1835,14 @@ % \subsection{Dummy commands} % \label{sec:dummy-commands} % -% If the author is not use \pdflatex\ or not using it in +% If the author is not using \pdflatex\ or \lualatex\ or not using it in % \acronym{PDF}-generating mode, we replace the core % \pkgname{attachfile} commands with dummy versions so \latex\ can at % least run to completion. % ^^A % \changes{v1.1}{2005/01/04}{Wrote dummy versions of all the core macros -% to use in the absence of \protect\pdflatex\ running in -% \protect\acronym{PDF}-generating mode.} +% to use in the absence of \protect\pdflatex\slash\protect\lualatex\ +% running in \protect\acronym{PDF}-generating mode.} % % \begin{macrocode} \ifpdf |