From cfe306ba1b7ec40855a300580b7981845d56edeb Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 13 Jul 2017 10:25:48 +0900 Subject: add aeb-mlink aeb-pro aebxmp graphicxsp annot-pro --- texmf-dist/source/latex/aeb-pro/aeb_pro.dtx | 4903 +++++++++++++++++++++++++++ 1 file changed, 4903 insertions(+) create mode 100644 texmf-dist/source/latex/aeb-pro/aeb_pro.dtx (limited to 'texmf-dist/source/latex/aeb-pro/aeb_pro.dtx') diff --git a/texmf-dist/source/latex/aeb-pro/aeb_pro.dtx b/texmf-dist/source/latex/aeb-pro/aeb_pro.dtx new file mode 100644 index 00000000..3cde5508 --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/aeb_pro.dtx @@ -0,0 +1,4903 @@ +%\iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% aeb_pro.sty package, %% +%% Copyright (C) 2006--2017 D. P. Story %% +%% dpstory@acrotex.net %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1.2 of %% +%% the License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%\ProvidesPackage{aeb_pro} +% [2017/03/08 v2.8a aeb_pro: A support package (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex=false]{hyperref} +\pdfstringdefDisableCommands{\let\\\textbackslash} +\def\CMD#1{\textbackslash{#1}}\def\EXCL{!} +\let\opt\texttt \let\app\textsf \let\pkg\textsf \let\env\texttt +\OnlyDescription % comment out for implementation details +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\bgroup\ttfamily +\gdef\brpr#1{\char123\relax#1\char125\relax}\egroup +\let\darg\brpr +\let\env\texttt +\let\opt\texttt +\let\app\textsf +\def\visispace{\symbol{32}} +\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}} +\def\meta#1{\textsl{\texttt{#1}}} +\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}} +\InputIfFileExists{aebdocfmt.def}{\PackageInfo{aeb_pro}{Inputting aebdocfmt.def}} + {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax + \PackageInfo{aeb_pro}{aebdocfmt.def cannot be found}} +\begin{document} + \GetFileInfo{aeb_pro.sty} + \title{aeb\_pro\\as suggested by J\"{u}rgen Gilg} + \author{D. P. Story\\ + Email: \texttt{dpstory@acrotex.net}} + \date{processed \today} + \maketitle + \tableofcontents + \DocInput{aeb_pro.dtx} +\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute + \texttt{makeindex -s gind.ist -o aeb\_pro.ind aeb\_pro.idx} on the command line and recompile + \texttt{aeb\_pro.dtx}.} +\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute + \texttt{makeindex -s gglo.ist -o aeb\_pro.gls aeb\_pro.glo} on the command line and recompile + \texttt{aeb\_pro.dtx}.} +\end{document} +% +% \fi +% \MakeShortVerb{|} +% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{aeb_pro}{Inputting aebdonotindex.def}} +% {\PackageInfo{aeb_pro}{cannot find aebdonotindex.def}} +% +% \begin{macrocode} +% Begin package segment +%<*package> +% \end{macrocode} +% \changes{v1.9}{2016/03/03}{Allow users of pdftex and xetex to access JavaScript related +% methods provided they use \string\textsf{Acrobat} as their PDF reader.} +% \changes{v2.5}{2016/08/31}{Revised \string\texttt{aeb\_pro.js} to include +% \string\texttt{aebDocSaveAs()}.} +% +% \section{Introduction} +% +% The \pkg{aeb\_pro} package that access the `advanced' features of the PDF +% specification. It uses various combinations of driver-dependent code, +% \textbf{pdfmark} code, and JavaScript methods and techniques that require +% \app{Acrobat~7.0 Professional} for document assembly. The package provides +% the \textbf{AeB Control Central}. Use the \textbf{AeB Control Central} to +% load all your Acro\negthinspace\TeX packages in the correct order. See +% additional remarks in the titled paragraph \textbf{\nameref{para:beast}} +% below. +% +% \section{Declare Options} +% +% We declare some options for this package. +%\changes{v2.2}{2016/07/26}{Removed the generation of \string\texttt{fsprodef.js} from the INS file.} +% \begin{macrocode} +\RequirePackage{ifpdf}[2006/02/20] +\RequirePackage{ifxetex}[2006/08/21] +\RequirePackage{xkeyval} +% \end{macrocode} +% Some standard flags used by this package. +% \begin{macrocode} +\let\aebp@One=1 \let\aebp@Zero=0 +\let\aebp@YES=y \let\aebp@NO=n +% \end{macrocode} +% \subsection{AeB Control Central} +% +% \noindent\IndexOpt{web}^^A +% \IndexOpt{exerquiz}^^A +% \IndexOpt{dljslib}^^A +% \IndexOpt{eforms} +% \IndexOpt{insdljs}^^A +% \IndexOpt{eq2db}\par +% \IndexOpt{aebxmp}^^A +% \IndexOpt{hyperref}^^A +% \IndexOpt{graphicxsp}^^A +% \IndexOpt{rmannot}^^A +% \vskip-\baselineskip\noindent AeB control central +% is simply a set of options for including the +% other members of the AeB family. This assures that the package are +% loaded in the correct order. +% The values of each of these option +% keys are the options of the packages they reference. +% \par\medskip\noindent +% (2016/12/09) Incorporate the version argument into package specification, for example, +%\begin{verbatim} +% \usepackage[web={designi,forpaper,req=2016/11/03}]{aeb_pro} +%\end{verbatim} +% The version takes a key of \texttt{req}, as shown above. +% \changes{v0.8f}{2008/06/15}{Added \textsf{graphicxsp} to the list of support packages} +% \changes{v2.7}{2016/12/10}{Incorporate the version argument into package specification} +% \par\medskip\noindent +% \cs{ap@csarg} is a convenience macro for working with command names. +% \begin{macrocode} +\def\ap@csarg#1#2{\expandafter#1\csname#2\endcsname} +% \end{macrocode} +% Define an \pkg{xkeyval} family \texttt{aebpreq} with a single key \IndexKey{req}\texttt{req}. Later, we +% use this key to separate package options from the key-value \texttt{req=\ameta{release date}}. +% \begin{macrocode} +\define@key{aebpreq}{req}[]{\def\eq@pkgReq{#1}} +% \end{macrocode} +% A convenience command to save the value of package for later use. +% \begin{macrocode} +\def\aebp@setCCOptions#1#2{%#1=package #2=options + \ap@csarg\edef{aeb@#1@opts}{#2}} +% \end{macrocode} +% We not define options for \pkg{aeb\_pro} of \texttt{web}, \texttt{exerquiz}, \texttt{eforms}, \texttt{insdljs}, +% \texttt{eq2db}, \texttt{aebxmp}, \texttt{hyperref}, \texttt{graphicxsp}, and \texttt{rmannot}. +% \begin{macrocode} +\@tfor\aeb@pcks:={web}{exerquiz}{dljslib}% +{eforms}{insdljs}{eq2db}{aebxmp}{hyperref}{graphicxsp}{rmannot}\do +{% + \ap@csarg\let{aeb@\aeb@pcks @req}\@empty + \ap@csarg\let{aeb@\aeb@pcks @opts}\relax + \edef\aeb@pack@def{\noexpand + \define@key{aeb_pro.sty}{\aeb@pcks}[]{% + \noexpand\aebp@setCCOptions{\aeb@pcks}{##1}}% + }\aeb@pack@def +} +% \end{macrocode} +% We provide a convenient way to pass the \texttt{driver}\IndexOpt{driver} used, \texttt{dvips} or +% \texttt{dvipsone}. If the user chooses the \opt{web} option, then he/she might +% have a \texttt{web.cfg} file, so using this option may not be +% needed, in this case. +% \begin{macrocode} +\let\aebp@passDriver\aebp@YES +\ifpdf\let\aebp@passDriver\aebp@NO\else +\ifxetex\let\aebp@passDriver\aebp@NO\fi\fi +\define@choicekey+{aeb_pro.sty}{driver}% + {dvipsone,dvips,pdftex,dvipdfm,textures,% + dvipdfmx,xetex}{% + \def\aeb@driver{#1}\ifx\aeb@driver\@empty\else + \PassOptionsToPackage{#1}{web} + \PassOptionsToPackage{#1}{exerquiz} +\def\aebp@PassToHYIns{\PassOptionsToPackage{#1}{hyperref} + \PassOptionsToPackage{#1}{insdljs}} +\ifx\aebp@passDriver\aebp@YES + \expandafter\aebp@PassToHYIns\fi + \PassOptionsToPackage{#1}{eforms} + \PassOptionsToPackage{#1}{graphicxsp} + \fi +}{\PackageError{aeb_pro}{Bad choice for the driver, permissible values + \MessageBreak are dvipsone, dvips, pdftex, dvipdfm, + textures,\MessageBreak dvipdfmx, and xetex} + {Try again with a permissible driver name}} +\let\aeb@driver\@empty +% \end{macrocode} +% +% \paragraph*{On the nature of the beast}\label{para:beast} There are three types of commands +% (and environments) in this package: (1) commands that use driver dependent +% code, available to all workflows; (2) commands that depend on the +% \textbf{pdfmark} operator, available only to the \app{dvips/Distiller} +% workflow; and (3) commands that use `post-PDF creation' methods that rely +% on the document author having the full \app{Acrobat} application. +% +% For the workflow \app{dvips/Distiller}, all three code types are +% available; for whose authors that prefer \app{pdflatex/\penalty0 +% lualatex/\penalty0 xelatex}, but \emph{do not have} the full +% \texttt{Acrobat} product, the commands of type~(1) are available through +% the \opt{nopro} option. Finally, for authors that prefer +% \app{pdflatex/\penalty0 lualatex/\penalty0 xelatex} and \emph{do have} +% \app{Acrobat}, the commands of type~(1) and~(3) are available through +% the \opt{useacrobat} option. + +% \subsection{The \texttt{useacrobat} option} +% +% If the document author has \app{Acrobat}, but wants to use +% \app{pdflatex}, \app{xelatex}, etc, we shall let them but under +% restricted conditions using the \opt{useacrobat}\IndexOpt{useacrobat} option. +% Essentially, all of \pkg{aeb\_pro} is available except for any commands that use +% layers; hence, the \opt{uselayers} and \opt{ocganime} options are not supported. +% \begin{macrocode} +\newif\if@useacrobat \@useacrobatfalse +\DeclareOptionX{useacrobat}{\@useacrobattrue} +% \end{macrocode} +% +% \subsection{\texttt{nopro} option} +% +% The normally \pkg{aeb\_pro} will brings in all the +% code that would require the use of the \app{Distiller} and \app{Acrobat Pro}, +% this is the default. The \opt{nopro}\IndexOpt{nopro} option gives +% access, for non-\app{Distiller} workflows, to the \textbf{AeB Control Center} and to all commands that do +% no involve layers or post-PDF creation methods. +% \begin{macrocode} +\newif\if@gopro \@goprotrue +\DeclareOptionX{nopro}{\@useacrobattrue\@goprofalse + \PassOptionsToPackage{nopro}{insdljs}} +% \end{macrocode} +% \paragraph*{Input \texttt{aebpro.def}} We input \texttt{aebpro.def} at the end of the package. +% \begin{macrocode} +\def\aeb@InputAeBPro{\InputIfFileExists{aebpro.def}% + {\PackageInfo{aeb_pro}{Inputting code for the pro option}}% + {\PackageInfo{aeb_pro}{Cannot find aebpro.def. + Reinstall or refresh your file name database, as needed.}}} +\AtEndOfPackage{\aeb@InputAeBPro} +% \end{macrocode} +% +% \subsection{\texttt{uselayers} option} +% The \texttt{uselayers}\IndexOpt{uselayers} option activates the use of +% Optional Content Groups, a.k.a., layers. +% \begin{macrocode} +\let\aebp@uselayers=0 +\DeclareOptionX{uselayers}{% + \ifx\aebp@uselayers0\AtEndOfPackage{\aeb@InputAeBLayers}% + \global\let\aebp@uselayers=1\fi +} +\def\aeb@InputAeBLayers{\InputIfFileExists{aeblayers.def}% + {\PackageInfo{aeb_pro}{Inputting code for uselayers option}}% + {\PackageInfo{aeb_pro}{Cannot find aeblayers.def. + Reinstall or refresh your file name database.}}} +% \end{macrocode} +% +% \subsection{\texttt{gopro} option} +% Some of the components of AeB have the pro option. Use \texttt{gopro}\IndexOpt{gopro} to +% pass the \texttt{pro} option to all components that take it. +% \begin{macrocode} +\DeclareOptionX{gopro}{\PassOptionsToPackage{pro}{web}} +% \end{macrocode} +% \subsection{\texttt{attachsource} option} +% A simple interface, \texttt{attachsource}\IndexOpt{attachsource} to attaching the source file(s) of \cs{jobname}. +% \begin{macrocode} +\DeclareOptionX{attachsource}{\def\aeb@attachsource{#1}} +\let\aeb@attachsource\@empty +% \end{macrocode} +% \subsection{\texttt{attachments} option} +% The \texttt{attachments}\IndexOpt{attachments} option is a general routine +% for attaching files other than the \cs{jobname}. +% \begin{macrocode} +\DeclareOptionX{attachments}{\def\aeb@attachments{#1}} +\let\aeb@attachments\@empty +% \end{macrocode} +% \changes{v1.4}{2013/02/24}{Support for optional attachments} +% The two options, \texttt{optattachments}\IndexOpt{optattachments} and \texttt{!optattachments}\IndexOpt{!optattachments}, +% set the Booleaqn switch \cs{ifoptattachments} to true or false, respectively. +% the default is false. When the command \cs{prjInput} is used, files are input into +% the source file, but also attached to the PDF when \texttt{optattachments} is used, and not +% attached when \texttt{!optattachments} is used. +% \begin{macrocode} +\newif\ifoptattachments\optattachmentsfalse +\newif\ifoptattachmentsTaken\optattachmentsTakenfalse +\DeclareOptionX{optattachments}{% + \optattachmentsTakentrue + \optattachmentstrue} +\DeclareOptionX{!optattachments}{% + \optattachmentsTakentrue + \optattachmentsfalse} +% \end{macrocode} +% \subsection{The \texttt{linktoattachments} option} +% The option \texttt{linktoattachments}\IndexOpt{linktoattachments} is a +% general routine for linking to attached PDF files. +% \begin{macrocode} +\def\@aeb@InputUnicodes{\InputIfFileExists{unicodes.def}% + {\typeout{aeb_pro: Inputting code for the linktoattachments option}}% + {\typeout{aeb_pro: Cannot find unicodes.def. + Reinstall or refresh your file name database, as needed.}}} +\let\aeb@InputUnicodes\@empty +% \end{macrocode} +% \changes{v1.7k}{2015/08/06}{Added code so that the childof is read after linktoattachments} +% (2015/08/06) Added code so that the childof is read after linktoattachments +% \changes{v2.4}{2016/08/03}{Removed the \string\texttt{latin1} option as unworkable across some workflows} +% \begin{macrocode} +\DeclareOptionX{linktoattachments}{% + \let\aeb@InputUnicodes\@aeb@InputUnicodes} +\let\aeb@childofInput\@empty +\let\aeb@childof\@empty +\DeclareOptionX{childof}{\def\aeb@childof{#1}\def\aeb@childofInput{% + \InputIfFileExists{\aeb@childof_xref.cut}{}{}}} +\def\inputAttachmentRelatedFiles{% + \aeb@InputUnicodes + \aeb@childofInput +} +\AtEndOfPackage{\inputAttachmentRelatedFiles} +% \end{macrocode} +% When the \texttt{ocganime}\IndexOpt{ocganime} option is taken, the code for ocg animation is included. +% \begin{macrocode} +\let\inputCommonAnimeCode\relax +\DeclareOptionX{ocganime}{% + \ifx\aebp@uselayers0\ExecuteOptionsX{uselayers} + \global\let\aebp@uselayers=1\fi + \ifx\inputCommonAnimeCode\relax + \let\inputCommonAnimeCode\aebp@inputCommonAnimeCode + \AtEndOfPackage{\inputCommonAnimeCode}\fi + \AtEndOfPackage{\inputOcgAnimeCode} +} +% \end{macrocode} +% When the \texttt{btnanime}\IndexOpt{btnanime} option is taken, the code for button animation is included. +% \begin{macrocode} +\DeclareOptionX{btnanime}{% + \ifx\inputCommonAnimeCode\relax + \let\inputCommonAnimeCode\aebp@inputCommonAnimeCode + \AtEndOfPackage{\inputCommonAnimeCode}\fi + \AtEndOfPackage{\inputBtnAnimeCode} +} +\def\inputBtnAnimeCode{\InputIfFileExists{btnnanime.def} + {\PackageInfo{aeb_pro}{inputting btnnanime.def}} + {\PackageWarning{aeb_pro}{cannot find btnnanime.def}}}% +\def\inputOcgAnimeCode{\InputIfFileExists{ocganime.def} + {\PackageInfo{aeb_pro}{inputting ocganime.def}} + {\PackageWarning{aeb_pro}{cannot find ocganime.def}}}% +\def\aebp@inputCommonAnimeCode{\InputIfFileExists{anime_support.def} + {\PackageInfo{aeb_pro}{inputting anime_support.def}} + {\PackageWarning{aeb_pro}{cannot find anime_support.def}}}% +% \end{macrocode} +% We allow for a configuration file, usually of the form +%\begin{verbatim} +% \ExecuteOptionsX{driver=} % dvips, dvipsone, pdftex, xetex +%\end{verbatim} +% For the last two, \app{AeB Pro} can only act as a central control of +% the \app{AeB} Family. +% \changes{v1.7}{2015/06/12}{Added a test for \texttt{pdftex} and \texttt{xetex}} +% If the driver being used (automatically detected) is \texttt{pdftex} or \texttt{xetex}, we +% use the \texttt{nopro} option and don't input \texttt{aebpro.cfg}. +% \begin{macrocode} +\let\pathToBtnCtrlIcons\@empty +\let\ExecuteOptionsXSAVE\ExecuteOptionsX +\let\ExecuteOptionsX\@gobble +\InputIfFileExists{aebpro.cfg}{}{} +\let\ExecuteOptionsX\ExecuteOptionsXSAVE +\ifpdf\ExecuteOptionsX{driver=pdftex}\else + \ifxetex\ExecuteOptionsX{driver=xetex}\else + \@ifundefined{l@tex@@@@driver}{\ExecuteOptionsX{driver=dvips}} + {\ExecuteOptionsX{driver=dvipsone}}\fi\fi +% \end{macrocode} +% \paragraph*{Process the options} +% \begin{macrocode} +\ProcessOptionsX +\edef\ap@restoreCats{% + \catcode`\noexpand\"=\the\catcode`\"\relax + \catcode`\noexpand\,=\the\catcode`\,\relax + \catcode`\noexpand\(=\the\catcode`\(\relax + \catcode`\noexpand\!=\the\catcode`\!\relax +} +\@makeother\"\@makeother\,\@makeother\(\@makeother\! +% \end{macrocode} +% \paragraph*{Set up variables} +% We set a switch to indicate we are using the \textbf{pdfmark} operator or not. +% Initially we assume so. +% \changes{v1.9}{2016/03/03}{Set up \string\cs{ifpdfmark} switch earlier} +% \begin{macrocode} +\@ifundefined{ifpdfmarkup}{\newif\ifpdfmarkup}{} +\pdfmarkuptrue +% \end{macrocode} +%\changes{v2.2}{2016/07/26}{Added support for luatex .85} +% Added support for luatex .85. Moved this code to \pkg{insdljs} (2016/07/31); \pkg{aeb\_pro} requires +% \pkg{insdljs} so put it there. +%\begin{verbatim} +% \ifpdf\ifx\pdffeedback\@undefined\else +% \def\pdfpageref{\pdffeedback pageref}\fi\fi +%\end{verbatim} +% Set the variables for the case of \opt{dvips} and \opt{dvipsone}. +% \changes{v1.9}{2016/03/03}{Modified driver check, adding \string\cs{@useacrobattrue}} +% \begin{macrocode} +\def\aeb@testdriver{dvips}% +\ifx\aeb@testdriver\aeb@driver + \@useacrobattrue\else +\def\aeb@testdriver{dvipsone}% +\ifx\aeb@testdriver\aeb@driver + \@useacrobattrue\else +% \end{macrocode} +% If not \texttt{dvips} or \texttt{dvipsone}, the user is +% not to use the \textbf{pdfmark} operator. +% \changes{v1.9}{2016/03/03}{Mark as non-pdfmark} +% \begin{macrocode} + \pdfmarkupfalse +\fi\fi +% \end{macrocode} +% \paragraph*{Summary of switch settings} +% \begin{itemize} +% \item \app{Distiller} workflow: \cs{pdfmarkuptrue}, \cs{@useacrobatrue}, \cs{@goprotrue} +% \item non-\app{Distiller}/non-\app{Acrobat} workflow (the \opt{nopro} option): +% \cs{pdfmarkupfalse}, \cs{@useacrobatrue}, \cs{@goprofalse} +% \item non-\app{Distiller}/\app{Acrobat} workflow (the \opt{useacrobat} option): +% \cs{pdfmarkupfalse}, \cs{@useacrobatrue}, \cs{@goprotrue} +% \end{itemize} +% Some options are not valid when using the \opt{nopro}, such as attachments. +% \begin{macrocode} +\if@gopro\else +\let\aebp@isattach\aebp@NO +\ifx\aeb@attachsource\@empty\else\let\aebp@isattach\aebp@YES\fi +\ifx\aeb@attachments\@empty\else\let\aebp@isattach\aebp@YES\fi + \let\aeb@attachsource\@empty + \let\aeb@attachments\@empty + \optattachmentsfalse\optattachmentsTakenfalse + \let\inputAttachmentRelatedFiles\relax +\ifx\aebp@isattach\aebp@YES + \PackageWarningNoLine{aeb_pro}{The various attachment options + are not\MessageBreak supported with the nopro option, + ignoring them}\fi +\fi +% \end{macrocode} +% \paragraph*{Disallow some options that use the \textsf{pdfmark}} +% We do what we say. +% \begin{macrocode} +\ifpdfmarkup\else +\if\aebp@uselayers1 + \def\aeb@InputAeBLayers{\PackageError{aeb_pro} + {The uselayers and ocganime options are not supported,\MessageBreak + with the useacrobat and nopro options,\MessageBreak + ignoring these options}{Remove dependence on layers, + or obtain\MessageBreak the full Acrobat product}} + \let\texHelpIndicator\@gobble + \let\addJStexHelpEnter\@gobble + \let\addJStexHelpExit\@gobble + \let\texHelp\@gobbletwo + \def\xBld#1\eBld{} + \let\defineRC\@gobbletwo + \let\insertRC\@gobble + \let\definePR\@gobbletwo + \let\insertPR\@gobble + \let\proofRollovers\relax + \let\texPHProof\@gobbletwo + \newcommand\animeBld[1][]{} + \def\DeclareAnime#1#2#3{} + \newcommand\backAnimeBtn[3][]{} + \newcommand\clearAnimeBtn[3][]{} + \newcommand\forwardAnimeBtn[3][]{} +\fi\fi +% \end{macrocode} +% +% \section{Package requirements} +% +% AeB builds on the \textsf{web} package to a certain extent, +% hence requires \textsf{insdljs}. +% \begin{macrocode} +\def\aebp@PkgWarningi#1{\ifpdfmarkup\else\PackageWarningNoLine{aeb_pro} + {The #1\space package requires Adobe Distiller,\MessageBreak + do not load this package}\fi} +\def\aebp@PkgWarningii#1{\PackageWarningNoLine{aeb_pro} + {The #1\space package requires Adobe Distiller,\MessageBreak + ignoring #1\space as an option}} +\def\aebp@PkgWarningiii#1{\PackageWarningNoLine{aeb_pro} + {The #1\space package requires Adobe Distiller or\MessageBreak + the useacrobat option (Acrobat required),\MessageBreak + ignoring #1\space as an option}} +\providecommand\getargsii[2]{\def\aeb@argi{#1}\def\aeb@argii{#2}} +% \end{macrocode} +% \cs{ap@RP} is a command that computes the appropriate +% \cs{PassOptionsToPackage} and \cs{RequiredPackage} commands +%\begin{verbatim} +% #1 aeb_pro required options, #2 = package name +%\end{verbatim} +% \begin{macrocode} +\newcommand\ap@RP[2][]{\def\@rgi{#1}\def\@rgii{#2}% + \ifx\@rgi\@empty\else\edef\@rgi{[\@rgi]}\fi + \@ifnextchar[%] + {\ap@@RP}{\ap@@RP[]}} +% \end{macrocode} +% \cs{ap@@RP} continues \cs{ap@RP} and is the one that formulates +% \cs{PassOptionsToPackage} and \cs{RequiredPackage} commands +%\begin{verbatim} +% #1 = aeb_pro required date +%\end{verbatim} +% \begin{macrocode} +\def\ap@@RP[#1]{\def\@rgiii{#1}% + \let\XKV@rm\@empty\let\eq@pkgReq\@empty + \@ifundefined{aeb@\@rgii @opts} + {\ifx\@rgi\@empty\else + \ap@csarg\edef{aeb@\@rgii @req}{#1}\fi + }{% +% \end{macrocode} +% Calculate \cs{PassOptionsToPackage} and its arguments +% \begin{macrocode} + \edef\x{\noexpand + \setkeys*{aebpreq}{\@nameuse{aeb@\@rgii @opts}}}\x + \edef\eq@theseOpts{\XKV@rm}% + \ap@csarg\edef{aeb@\@rgii @req}{\eq@pkgReq}% + \edef\x{\noexpand + \PassOptionsToPackage{\eq@theseOpts}{\@rgii}}\x + }% +% \end{macrocode} +% Construct \cs{RequirePackage} and its arguments +% \begin{macrocode} + \ifx\@rgiii\@empty + \if!\@nameuse{aeb@\@rgii @req}!\else + \ap@csarg\edef{aeb@\@rgii @req}{[\@nameuse{aeb@\@rgii @req}]}\fi + \else + \@ifl@t@r{#1}{\@nameuse{aeb@\@rgii @req}}% + {\if!\@nameuse{aeb@\@rgii @req}!\else + \ap@csarg\edef{aeb@\@rgii @req}% + {[\@nameuse{aeb@\@rgii @req}]}\fi + }{\ap@csarg\edef{aeb@\@rgii @req}{[#1]}}% + \fi + \edef\x{\noexpand + \RequirePackage{\@rgii}\@nameuse{aeb@\@rgii @req}}\x +} +\@ifpackageloaded{web}{} +{% + \@ifundefined{aeb@web@opts}{}{\ap@RP{web}}% +} +\@ifpackageloaded{exerquiz}{} +{% + \@ifundefined{aeb@exerquiz@opts}{}{\ap@RP{exerquiz}}% +} +\@ifpackageloaded{hyperref}{} +{% + \@ifundefined{aeb@hyperref@opts}{}{\ap@RP{hyperref}}% +} +\@ifpackageloaded{eq2db}{} +{% + \@ifundefined{aeb@eq2db@opts}{}{\ap@RP{eq2db}}% +} +\@ifpackageloaded{dljslib}{} +{% + \@ifundefined{aeb@dljslib@opts}{}{\ap@RP{dljslib}}% +} +\@ifpackageloaded{insdljs}{\let\execjs\aebp@YES} +{% + \ap@RP[execJS]{insdljs}[2016/07/31]% incls conv-xkv +} +\@ifpackageloaded{eforms}{\let\execjs\aebp@YES} +{% + \@ifundefined{aeb@eforms@opts}{} + {\ap@RP[execJS]{eforms}[2017/01/03]}% +} +\@ifpackageloaded{aebxmp}{\aebp@PkgWarningi{aebxmp}} +{% + \@ifundefined{aeb@aebxmp@opts}{} + {\edef\temp@exp{\ifpdfmarkup + \noexpand\ap@RP{aebxmp}\else + \if@useacrobat + \noexpand\ap@RP{aebxmp}[2016/05/12]\else + \noexpand\aebp@PkgWarningiii{aebxmp}\fi\fi}\temp@exp} +} +\@ifpackageloaded{graphicxsp}{\aebp@PkgWarningi{graphicxsp}} +{% + \@ifundefined{aeb@graphicxsp@opts}{} + {\edef\temp@exp{\ifpdfmarkup + \noexpand\ap@RP{graphicxsp}\else + \noexpand\aebp@PkgWarningii{graphicxsp}\fi}\temp@exp} +} +\@ifpackageloaded{rmannot}{\aebp@PkgWarningi{rmannot}} +{% + \@ifundefined{aeb@rmannot@opts}{} + {\edef\temp@exp{\ifpdfmarkup\noexpand\ap@RP{rmannot}\else + \noexpand\aebp@PkgWarningii{rmannot}\fi}\temp@exp} +} +\let\execjs\aebp@YES +\RequirePackage{comment} +\RequirePackage{calc} +\RequirePackage{eso-pic} +\ifpdfmarkup\else\if\aebp@uselayers1 + \excludecomment{printRollover}% + \excludecomment{rollover}% +\fi\fi +% \end{macrocode} +% The following write command is used by both the layers stuff, and the attachments routines. +% \begin{macrocode} +\def\aeb@IWVO{\immediate\write\verbatim@out} +% \end{macrocode} +% \section{Support for PDF help} +% The \DescribeMacro{\pdfHelp}\cs{pdfHelp} macro requires \textsf{eforms}. We define +% the necessary commands for PDF help, as well as some comments needed for \cs{texHelp}, +% which uses layers. +% \changes{v2.1}{2016/05/15}{Moved \string\cs{pdfHelp} from \texttt{aeblayers} to +% \texttt{package} to support non-Distiller workflows.} +% \begin{macrocode} +\newsavebox{\aebsavehelp} +\newcommand{\pdfHelpIndicator}[1]{#1\thinspace${}^{\mbox + {\footnotesize\negthinspace\ding{109}}% + \raisebox{.225ex}{\llap{\color{webblue}\tiny?\hspace{1.3ex}}}}$} +\def\pdfHelpCnt{0} +\newcommand{\pdfHelp}{\@ifstar{{\count0=\pdfHelpCnt\relax +\advance\count0by1\relax\xdef\pdfHelpCnt{\the\count0 }}% + \pdfHelpi{pdfhelp-\pdfHelpCnt}}{\pdfHelpi}} +\newcommand{\pdfHelpi}[3]{% + \let\rollormargstring\texorpdfstring + \sbox{\aebsavehelp}{\pdfHelpIndicator{#3}}% + \makebox[0pt][l]{\makespecialJS\pushButton[\S{S}\BG{}\BC{}\H{N} + \TU{#2}]{#1}{\wd\aebsavehelp}{11bp}}\usebox{\aebsavehelp}% + \let\rollormargstring\@gobbletwo +} +\newcommand\pdfPHProof[3]{\small\raggedright\texttt{#3}: #2} +\newcommand\pdfPrintHelp{\@ifstar{{\count0=\pdfHelpCnt\relax +\advance\count0by1\relax\xdef\pdfHelpCnt{\the\count0}}% + \pdfPrintHelpi{pdfhelp-\pdfHelpCnt}}{\pdfPrintHelpi}} +\newcommand\pdfPrintHelpi[3]{% + \let\rollormargstring\texorpdfstring + \ifeqforpaper + \ifeq@proofing + \pdfHelp{#1}{#2}{#3}\marginpar{\Hy@pdfstringfalse + \pdfPHProof{#1}{#2}{{\Hy@pdfstringtrue#3}}}\else + \pdfHelpIndicator{#3}\fi + \else + \pdfHelp{#1}{#2}{#3}\ifeq@proofing + \marginpar{\Hy@pdfstringfalse + \pdfPHProof{#1}{#2}{{\Hy@pdfstringtrue#3}}}\fi + \fi + \let\rollormargstring\@gobbletwo +} +% \end{macrocode} +% \begin{macrocode} +% End of package segment +% +%<*aeblayers> +% \end{macrocode} +% \begin{macrocode} +% \end{macrocode} +% \section{Support for OCG} +% We place PostScript code in the document that supports OCG. +% \subsection{Initialization} +% \begin{macrocode} +\newif\ifaeb@ocOn \aeb@ocOntrue +\ifaeb@ocOn +\AtBeginDocument{% +\headerps@out{% +{/OCProcSet /ProcSet findresource} stopped not +{/initialize get exec} +{ +/BeginOC /pop load def +/EndOC {} def +/SimpleOC /pop load def +/SetOCGInitState {pop pop} bind def +/OCEndPage {} def +/SetOCGIntent {pop pop} bind def +/SetOCGUsage {pop pop} bind def +/AddASEvent {pop pop pop} bind def +} +ifelse +} +}\fi +\ifaeb@ocOn + \AtEndDocument{\literalps@out{{/OCProcSet /ProcSet findresource + /terminate get exec} stopped pop}} +\fi +% \end{macrocode} +% \subsection{Supporting commands for OCG} +% In this section we install the necessary code creating and +% navigating through PDF layers. +% \subsubsection{Document JavaScript in support of OCG} +% \begin{macrocode} +\begin{insDLJS}[getxBld]{aebocg}{AeB Pro: OCG Support} +var ocgs = this.getOCGs(); +var xBlds = new Array(); +%console.println("Reindexing ocgs and creating xBlds"); +if ( ocgs != null ) { + var l = ocgs.length; + for ( i=0; i 1) ? bState : !oLayer.state; +} +function getLayerState(name) { + var oLayer = getxBld(name); + return ( oLayer != null ) ? oLayer.state : null; +} +\end{insDLJS} +% \end{macrocode} +% \subsubsection{Macros for creating rollovers} +% The following commands were taken from the \textsf{APB} +% package, and slightly modified. +% \changes{v1.3f}{2012/06/01}{Added controls for adding JS code to a +% rollover; used for starting and stopping an anime.} +% \begin{macrocode} +\newcommand{\texHelpIndicator}[1]{#1\thinspace${}^{\mbox + {\footnotesize\negthinspace\ding{109}}\raisebox{.225ex} + {\llap{\color{webblue}\tiny?\hspace{1.3ex}}}}$} +\newcommand{\addJStexHelpEnter}[1]{\def\aebp@addJStexHelpEnter{\r#1}} +\newcommand{\addJStexHelpExit}[1]{\def\aebp@addJStexHelpExit{\r#1}} +\newcommand{\resetaddJStexHelp}{% + \let\aebp@addJStexHelpEnter\@empty + \let\aebp@addJStexHelpExit\@empty +} +\resetaddJStexHelp +\newcommand{\texHelp}[2]{% + \let\rollormargstring\texorpdfstring + \sbox{\aebsavehelp}{\texHelpIndicator{#2}}% + \makebox[0pt][l]{\pushButton[\S{S}\BG{}\BC{}\H{N} + \AA{\AAMouseEnter{\JS{toggleHelp("#1");\aebp@addJStexHelpEnter}}% + \AAMouseExit{\JS{toggleHelp("#1");\aebp@addJStexHelpExit}}}]{#1}% +% \end{macrocode} +%\changes{v1.3h}{2012/11/25}{Changed height calculation in \cs{texHelp}} +% Changed height calculation in \cs{texHelp} to allow a rollover of more +% than text. +% \begin{macrocode} + {\wd\aebsavehelp}{\ht\aebsavehelp+\dp\aebsavehelp}}% + \usebox{\aebsavehelp}\resetaddJStexHelp + \let\rollormargstring\@gobbletwo +} +% \end{macrocode} +% +% \subsubsection{Macros for layers} +% We have some basic commands for creating layers in AeB Pro. +% \begin{macrocode} +\newif\ifaeb@SimpleOCOn \aeb@SimpleOCOnfalse +\newcommand{\@SOC}[2][false]{\global\aeb@SimpleOCOntrue% + \ifaeb@ocOn\literalps@out{(#2) SimpleOC (#2) #1 SetOCGInitState}\fi} +\newcommand{\b@OC}[2][false]{\ifaeb@SimpleOCOn\@aebSimpleNesterror\fi + \ifaeb@ocOn\literalps@out{(#2) BeginOC (#2) #1 SetOCGInitState}\fi} +\newcommand{\e@OC}{\ifaeb@ocOn\literalps@out{EndOC}\fi} +% \end{macrocode} +% \begin{macro}{\xBld} +% We have some basic commands for creating layers in AeB Pro. +% The syntax for \cs{xBld} is as follows: +%\begin{verbatim} +% \xBld[true|false|print=(true|false)] +% {}\eBld +%\end{verbatim} +%The description of the optional parameters follows: +%\begin{itemize} +% \item \texttt{true}\IndexKey{true}: Inserting \texttt{true} as an optional argument causes the layer to be initially visible. +% \item \texttt{false}\IndexKey{false}: Inserting \texttt{false} as an optional argument causes the layer to be initially hidden. +% The default is \texttt{false}, so if no \texttt{true} or \texttt{false} argument is passed as an optional argument, +% the layer will be initially hidden. +% \item \texttt{print}\IndexKey{print}: This key allows you to set the printability of the layer: If \texttt{print=true}, +% the layer \emph{always prints}, no matter if it is visible or not. If \texttt{print=false}, +% the layer \emph{never prints}, no matter if it is visible or not. If the print key is not specified, +% then the layer will print if visible, otherwise, it does not print. Normally, the \texttt{print} +% key is not specified, and the layer is printed if visible. +%\end{itemize} +% \begin{macrocode} +\newcommand{\xBld}[2][]{% + \setkeys{aebpxBld}{false,#1}\b@OC[\aebpxBld@visible]{xb.#2}% + \ifx\aebpxBld@print\@empty\else + \literalps@out{/Print [/Print] [(xb.#2)] AddASEvent}% + \ifAEBP@aebpxBld@print + \literalps@out{(xb.#2) << /Print<< + /PrintState/ON >> >> SetOCGUsage}% + \else + \literalps@out{(xb.#2) << /Print<< + /PrintState/OFF >> >> SetOCGUsage}% + \fi + \global\let\aebpxBld@print\@empty + \fi +} +\let\eBld\e@OC +\def\@aebSimpleNesterror{\PackageWarning{aeb} +{The scope of the last \string\Bld\space command +\MessageBreak includes the scope of the nested Bld. +\MessageBreak Executing \protect\ocOff\space to correct this. +\MessageBreak The problem occurs}\ocOff} +% \end{macrocode} +% \end{macro} +% The \textsf{keyval} definitions of the optional parameters for \cs{xBld}. +%\changes{v1.7m}{2015/08/08}{Made \texttt{print} key into a choice field} +%(2015/08/08) Made \texttt{print} key into a choice field. +% \begin{macrocode} +\newif\ifAEBP@aebpxBld@print \AEBP@aebpxBld@printfalse +\define@choicekey+{aebpxBld}{print}[\val\nr]{true,false,% + visible,always,never}[visible]{% + \ifcase\nr\relax + \def\aebpxBld@print{true}\AEBP@aebpxBld@printtrue\or + \def\aebpxBld@print{false}\AEBP@aebpxBld@printfalse\or + \let\aebpxBld@print\@empty\or + \def\aebpxBld@print{true}\AEBP@aebpxBld@printtrue\or + \def\aebpxBld@print{false}\AEBP@aebpxBld@printfalse\fi +}{\PackageWarning{aeb_pro}{Bad choice for initState, permissible values + are true, false, visible, always, and never. Try again}} +\let\aebpxBld@print\@empty +\define@key{aebpxBld}{true}[true]{\def\aebpxBld@visible{#1}} +\define@key{aebpxBld}{false}[false]{\def\aebpxBld@visible{#1}} +% \end{macrocode} +% The \texttt{initState}\IndexKey{initState} sets the initial state of the OCG, the +% default is \texttt{false}, meaning the layer is initially not shown. +% \begin{macrocode} +\define@choicekey+{aebpxBld}{initState}[\val\nr]{on,off,% + true,false}[false]{% + \ifcase\nr\relax + \def\aebpxBld@visible{true}\or + \def\aebpxBld@visible{false}\or + \def\aebpxBld@visible{true}\or + \def\aebpxBld@visible{false}\fi +}{\PackageWarning{aeb_pro}{Bad choice for initState, permissible values + are on, off, true and false. Try again}} +% \end{macrocode} +% \subsubsection{The behavior of the rollovers} +% \begin{macro}{\defineRC} +% \begin{macro}{\insertRC} +% RC stands for rollover content. \cs{defineRC} is used to define the content of the rollover +% so the content can be used for the \texttt{rollover} and the \texttt{printRollover} environments. +% These two environments are comment environments that are included or excluded depending on various +% conditions. +% +% The command \cs{csarg} is a convenience command defined in the \texttt{comment} package. +% The \texttt{comment} package is required so this command is available. +% \begin{macrocode} +\long\def\defineRC#1#2{\csarg\def{RC#1}{#2}} +\def\insertRC#1{\@nameuse{RC#1}} +\long\def\definePR#1#2{% + \ifeqforpaper\csarg\def{PR#1}{#2}\else + \ifeq@proofing\csarg\def{PR#1}{#2}\else + \csarg\let{PR#1}\relax\fi\fi +} +\def\insertPR#1{% + \ifeq@proofing\@nameuse{PR#1}\else + \csarg\let{insertPR}\@gobble\fi + \csarg\let{PR#1}\relax +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{environment}{rollover} +% \begin{environment}{printRollover} +% \begin{macro}{\definePR} +% \begin{macro}{\insertPR} +% Depending on the switches \cs{ifeqforpaper} and \cs{ifeq@proofing}, the comment environments +% \texttt{rollover} and \texttt{printRollover} are included or excluded. Also defined here are the +% two commands \cs{definePR} and \cs{insertPR} (PR stands for print rollover). These two commands +% are set equal to either \cs{defineRC} and \cs{insertRC}, or \cs{relax}, depending on the switches. +% +% If \textsf{exerquiz} is not loaded, then the switch \cs{ifeq@proofing} is undefined. We must +% define this switch in this case, and set it to \texttt{false}. +% \begin{macrocode} +\@ifundefined{ifeqforpaper}{\newif\ifeqforpaper \eqforpaperfalse}{} +\@ifundefined{ifeq@proofing}{\newif\ifeq@proofing \eq@proofingfalse}{} +\providecommand\turnProofingOn{\eq@proofingtrue} +\providecommand\turnProofingOff{\eq@proofingfalse} +% \end{macrocode} +% \DescribeMacro\proofRollovers turns on the \texttt{printRollover} environment, if there +% any defined in the document. +% \changes{v1.7}{2015/07/21}{Modified \cs{proofRollovers} command and added +% a number of other related commands.} +% \begin{macrocode} +\def\proofRollovers{% + \ifeqforpaper + \ifeq@proofing + \includecomment{rollover}% + \includecomment{printRollover}% + \else + \excludecomment{printRollover}% + \includecomment{rollover}% + \fi + \else + \ifeq@proofing + \includecomment{rollover}% + \includecomment{printRollover}% + \else + \excludecomment{printRollover}% + \includecomment{rollover}% + \fi + \fi +} +% \end{macrocode} +% We expand \cs{proofRollovers} immediately, but may be expanded in preamble with \cs{turnProofingOn}. +% \begin{macrocode} +\proofRollovers +\@onlypreamble\proofRollovers +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{environment} +% \end{environment} +% \begin{macro}{\texPrintHelp} +% The \cs{texPrintHelp} command reduces to \cs{texHelp} or typesets its second argument. +% \begin{macrocode} +\newcommand\texPHProof[2]{\small\raggedright\texttt{#1}: #2} +\let\rollormargstring\@gobbletwo +\def\texPrintHelp#1#2{% + \let\rollormargstring\texorpdfstring + \ifeqforpaper + \ifeq@proofing + \texHelp{#1}{#2}\marginpar{\Hy@pdfstringfalse + \texPHProof{#1}{#2}}\else + \texHelpIndicator{#2}\fi + \else + \texHelp{#1}{#2}\ifeq@proofing\marginpar{\Hy@pdfstringfalse + \texPHProof{#1}{#2}}\fi + \fi + \let\rollormargstring\@gobbletwo +} +% \end{macrocode} +% \end{macro} +% \subsection{In Support of Anime using Layers} +% Using layers, it is possible to create a sort of animation (anime). The following +% are some rudimentary methods for creating anime. An example can be found below, +% as well as in \texttt{aebpro\_ex4.tex}. +% +% \subsubsection{\protect\LaTeX{} Support} +% \begin{macro}{\animeBld} +% \begin{macro}{\DeclareAnime} +% The command \cs{animeBld} increments \texttt{ocSeq}, and names +% the layer so that the JS can run through the layers in an orderly way. +% +% \cs{DeclareAnime} takes three arguments, the anime base name, the speed at which +% you wish the anime to be played, and the number of frames of this animation. It +% saves these three parameters in macros, and creates \cs{animBldName}, which is used +% in the creation of the anime. See example file \texttt{aebpro\_ex4.tex}. +% \begin{macrocode} +\newcommand{\animeBld}[1][]{\stepcounter{ocSeq}% + \xBld[#1]{\animBldName}} +\newcounter{ocSeq} +% \end{macrocode} +% (10/01/01) We give an animation the special `\texttt{anime!!}' prefix, so JavaScript can identify +% animation layers. +% \begin{macrocode} +\newcommand{\animeName}[1]{anime!!#1}%01/01/2010 +\newcommand{\DeclareAnime}[3] +{% + \setcounter{ocSeq}{0}% + \xdef\animBaseName{anime!!#1}%01/01/2010 + \xdef\animSpeed{#2}\xdef\nFrames{#3}% + \gdef\animBldName{\animBaseName\#\theocSeq}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\backAnimeBtn} +% \begin{macro}{\clearAnimeBtn} +% \begin{macro}{\forwardAnimeBtn} +% The command \cs{animeBld} increments \texttt{ocSeq}, and names +% the layer so that the JS can run through the layers in an orderly way. +% +% \cs{DeclareAnime} takes three arguments, the anime base name, the speed at which +% you wish the anime to be played, and the number of frames of this animation. It +% saves these three parameters in macros, and creates \cs{animBldName}, which is used +% in the creation of the anime. See example file \texttt{aebpro\_ex4.tex}. +% \begin{itemize} +% \item \texttt{\#1}: This is an optional parameter for changing the appearance +% of the button, See the \textsf{eforms} package documentation. +% \item \texttt{\#2}: width of the button +% \item \texttt{\#3}: height of the button +% \end{itemize} +% \begin{macrocode} +\newcommand{\backAnimeBtn}[3][] +{% + \pushButton[\textFont{Wingdings3}\uCA{FEFF00C5}\TU{Reverse}#1 + \A{\JS{% + try { aebAnimeTimeOutF.running=false; } catch(e) {}\r + try { aebAnimeTimeOutB.running=false; } catch(e) {}\r + aebAnimeLayersBackward(\animSpeed,\nFrames,"\animBaseName"); + }}]{\animBaseName BtnBack}{#2}{#3}% +} +\newcommand{\clearAnimeBtn}[3][] +{% + \pushButton[\textFont{Wingdings}\CA{n}\TU{Clear}#1 + \A{\JS{% + try { aebAnimeTimeOutF.running=false; } catch(e) {}\r + try { aebAnimeTimeOutB.running=false; } catch(e) {}\r + aebAnimeLayersClear(\animSpeed,\nFrames,"\animBaseName"); + }}]{\animBaseName BtnClear}{#2}{#3}% +} +\newcommand{\forwardAnimeBtn}[3][] +{% + \pushButton[\textFont{Wingdings3}\uCA{FEFF00C6}\TU{Graph It!}#1 + \A{\JS{% + try { aebAnimeTimeOutF.running=false; } catch(e) {}\r + try { aebAnimeTimeOutB.running=false; } catch(e) {}\r + aebAnimeLayersForward(\animSpeed,\nFrames,"\animBaseName"); + }}]{\animBaseName BtnForward}{#2}{#3}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% Here is a simple example if anime, using the above commands. The code +% below uses the \textsf{pstricks-add} and \textsf{fp} packages. +%\begin{verbatim} +%\begin{center} +%\DeclareAnime{sinegraph}{10}{40} +%\def\thisframe{\animeBld\psplot[linecolor=red]{0}{\xi}{sin(x)}\eBld} +%\psset{llx=-12pt,lly=-12pt,urx=12pt,ury=12pt} +%\begin{psgraph*}[arrows=->](0,0)(-.5,-1.5)(6.5,1.5){164pt}{70pt} +% \psset{algebraic=true}% +% \rput(4,1){$y=\sin(x)$} +% \FPdiv{\myDelta}{\psPiTwo}{\nFrames}% +% \def\xi{0}% +% \multido{\i=1+1}{\nFrames}{\FPadd{\xi}{\xi}{\myDelta}\thisframe} +%\end{psgraph*} +% +%\backAnimeBtn{24bp}{12bp}\kern1bp\clearAnimeBtn{24bp}{12bp}\kern1bp +%\forwardAnimeBtn{24bp}{12bp} +%\end{center} +%\end{verbatim} +% \subsubsection{JavaScript Support} +% \begin{macrocode} +\begin{insDLJS}[_animeLayers]{animelayers} + {AeB Pro: JS in Support of Anime} +var _animeLayers = true; +var aebAnimeTimeOutF = new Object(); +aebAnimeTimeOutF.running=false; +var aebAnimeTimeOutB = new Object(); +aebAnimeTimeOutB.running=false; +var aebAnimeTimeOutC = new Object(); +function aebAnimeLayersForward(animSpeed,nFrames,baseName) +{ + var timeinterval = animSpeed; + aebAnimeTimeOutF = app.setInterval("aebAnimeTimeOutF.count++;" + + "if (aebAnimeTimeOutF.count > " + + nFrames + " || !aebAnimeTimeOutF.running )" + +" app.clearInterval(aebAnimeTimeOutF);\r" + + "else { if (aebAnimeTimeOutF.count == 1 )" + +" getxBld('"+baseName+"\#1').state=true;\t" + + "else { getxBld('"+baseName+"\#'" + + "+(aebAnimeTimeOutF.count-1)).state=false;\t" + + "getxBld('"+baseName+"\#'" + + "+aebAnimeTimeOutF.count).state=true;}}", timeinterval); + aebAnimeTimeOutF.running = true; + aebAnimeTimeOutF.start = 1; + aebAnimeTimeOutF.count=0; +} +function aebAnimeLayersBackward(animSpeed,nFrames,baseName) +{ + var timeinterval = animSpeed; + aebAnimeTimeOutB = app.setInterval("aebAnimeTimeOutB.count++;\r" + + "if (aebAnimeTimeOutB.count > "+nFrames + +"|| !aebAnimeTimeOutB.running )" + +" app.clearInterval(aebAnimeTimeOutB);\r" + + "else { if (aebAnimeTimeOutB.count == " + +nFrames+") getxBld('"+baseName+"\#1').state=false;\r" + + "else { getxBld('"+baseName+"\#'" + + "+(aebAnimeTimeOutB.start-% +aebAnimeTimeOutB.count+1)).state=false;\r" + + "getxBld('"+baseName+"\#'" + + "+(aebAnimeTimeOutB.start-% +aebAnimeTimeOutB.count)).state=true;}}", + timeinterval); + aebAnimeTimeOutB.running = true; + aebAnimeTimeOutB.start = nFrames; + aebAnimeTimeOutB.count=0; +} +function aebAnimeLayersClear(animSpeed,nFrames,baseName) +{ + aebAnimeTimeOutF.running = false; + aebAnimeTimeOutB.running = false; + clearFrames = app.setTimeOut( + "hideAllFrames("+nFrames+",\""+baseName+"\")",animSpeed); + var timeinterval = animSpeed; + aebAnimeTimeOutC = app.setInterval("aebAnimeTimeOutC.count++;\r" + + "if (aebAnimeTimeOutC.count >= "+nFrames + +") app.clearInterval(aebAnimeTimeOutC);\r" + + "else { getxBld('"+baseName+"\#'" + +"+(aebAnimeTimeOutC.start-aebAnimeTimeOutC.count)).state=false;}", + timeinterval); + aebAnimeTimeOutC.start = nFrames; + aebAnimeTimeOutC.count=0; +} +function hideAllFrames(n, baseName) +{ + for ( var i=1; i <= n ; i++ ) + getxBld(baseName+"\#"+i).state=false; +} +\end{insDLJS} +% \end{macrocode} +% \begin{macrocode} +% End of the layers segment +% +%<*aebpro> +% \end{macrocode} +% +% \section{Initial View} +% Supported preferences include \texttt{HideToolbar}, \texttt{HideMenubar}, \texttt{FitWindow}, +% \texttt{Center\-Window}, \texttt{DisplayDocTitle}, +% \texttt{NonFullScreenPageMode} (\texttt{UseNone}, \texttt{UseOutlines}, \texttt{UseThumbs}, +% \texttt{UseOC}, \texttt{UseAttachments}) +% +% \subsection{Window Options} +% +% The keys recognized for the windows options are \texttt{fit}\IndexKey{fit}, +% \texttt{center}\IndexKey{center}, \texttt{fullscreen}\IndexKey{fullscreen}, +% and \texttt{showtitle}\IndexKey{showtitle}. +% \begin{macrocode} +\@tfor\aeb@windowopts:={{fit}{FitWindow}}{{center}{CenterWindow}}% + {{fullscreen}{FullScreen}}{{showtitle}{DisplayDocTitle}}\do +{% + \expandafter\getargsii\aeb@windowopts + \edef\temp@expand@def{% + \noexpand\define@key{aebWindowOpts}{\aeb@argi}[true]{% + \noexpand\def\csname aeb@windowopts\aeb@argii\endcsname{% + /\aeb@argii\space##1}% + }% + }\temp@expand@def + \csarg\let{aeb@windowopts\aeb@argii}\@empty +} +% \end{macrocode} +% \begin{macro}{\setWindowOptions} +% Set the User Window options on the Initial View tab of the Document Properties dialog box. +% \begin{macrocode} +\newcommand{\setWindowOptions}[1]{\cxkvsetkeys{aebWindowOpts}{#1}} +% \end{macrocode} +% \end{macro} +% \subsection{User Interface Options} +% Key recognized for the use interface options are \texttt{hidetoolbar}\IndexKey{hidetoolbar}, +% \texttt{hidemenubar}\IndexKey{hidemenubar}, and \texttt{hidewindowui}\IndexKey{hidewindowui}. +% \begin{macrocode} +\@tfor\aeb@uiopts:={{hidetoolbar}{HideToolbar}} + {{hidemenubar}{HideMenubar}}{{hidewindowui}{HideWindowUI}}\do{% + \expandafter\getargsii\aeb@uiopts + \edef\temp@expand@def{% + \noexpand\define@key{aebUIOpts}{\aeb@argi}[true]% + {% + \noexpand\edef\csname aeb@uiopts\aeb@argii\endcsname{% + /\aeb@argii\space##1}% + }% + }\temp@expand@def + \csarg\let{aeb@uiopts\aeb@argii}\@empty +} +% \end{macrocode} +% \begin{macro}{\setUIOptions} +% Set the User Interface options on the Initial View tab of the Document Properties dialog box. +% \begin{macrocode} +\newcommand{\setUIOptions}[1]{\cxkvsetkeys{aebUIOpts}{#1}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Layout and Magnification} +% +% \subsubsection{Navigation Tab (Page Mode)} +% Supported values for the \texttt{navitab}\IndexKey{navitab} key are: +%\begin{itemize} +% \item \texttt{UseNone}: Page Only +% \item \texttt{UseOutlines}: Bookmarks Panel and Page +% \item \texttt{UseThumbs}: Pages Panel and Page +% \item \texttt{FullScreen}: Fullscreen mode +% \item \texttt{UseOC}: Layers Panel and Page +% \item \texttt{UseAttachments}: Attachments Panel and Page +%\end{itemize} +% \begin{macrocode} +\define@choicekey+{aebLayoutMag}{navitab}{UseNone,UseOutlines,% + UseThumbs,FullScreen,UseOC,UseAttachments}[UseNone]{% + \def\aeb@layoutMagNaviTab{#1}% +}{\PackageWarning{aeb}{Bad choice for PageLayout, permissible values + are UseNone, UseOutlines, UseThumbs, FullScreen,% + UseOC, UseAttachments. Try again}} +\let\aeb@layoutMagNaviTab\@empty +% \end{macrocode} +% \subsubsection{Page Layout} +% Supported value for the \texttt{pagelayout}\IndexKey{pagelayout} key are: +%\begin{itemize} +% \item \texttt{SinglePage}: Single page +% \item \texttt{OneColumn}: Single page continuous +% \item \texttt{TwoPageLeft}: Two-Up (Facing) +% \item \texttt{TwoColumnLeft}: Two-Up Continuous (Facing) +% \item \texttt{TwoPageRight}: Two-Up (Cover Page) +% \item \texttt{TwoColumnRight}: Two-Up Continuous (Cover Page) +%\end{itemize} +% \begin{macrocode} +\define@choicekey+{aebLayoutMag}{pagelayout}{SinglePage,OneColumn,% + TwoColumnLeft,TwoColumnRight,TwoPageLeft,TwoPageRight}[SinglePage]{% + \def\aeb@layoutMagPageLayout{#1}% +}{\PackageWarning{aeb}{Bad choice for PageLayout, permissible values + are SinglePage, OneColumn, TwoColumnLeft, TwoColumnRight, + TwoPageLeft,TwoPageRight. Try again}} +\let\aeb@layoutMagPageLayout\@empty +% \end{macrocode} +% \subsubsection{Magnification} +% Supported values for the \texttt{mag}\IndexKey{mag} key are: +%\begin{verbatim} +% Actual Size <> +% Fit Page <> +% Fit Width <> +% Fit Height <> +% Fit Visible <> +%\end{verbatim} +% \begin{macrocode} +\define@choicekey+{aebLayoutMag}{mag}[\val\nr]% + {ActualSize,FitPage,FitWidth,FitHeight,FitVisible}[FitPage]% +{% + \ifcase\nr\relax + \edef\aeb@layoutMagMag{\dl@actualsize}\or + \def\aeb@layoutMagMag{\dl@fitpage}\or + \def\aeb@layoutMagMag{\dl@fitwidth}\or + \def\aeb@layoutMagMag{\dl@fitheight}\or + \def\aeb@layoutMagMag{\dl@fitvisible}\fi +% \end{macrocode} +%\changes{v2.2}{2016/07/26}{Change division from postscript operation to a tex calculation} +% Change division from postscript operation to a tex calculation to support the \texttt{useacrobat} option. +% \begin{macrocode} +}{\setlength\@tempdima{1pt*\ratio{\val pt}{100pt}}% + \edef\aeb@layoutMagMag{\dl@mag{\strip@pt\@tempdima}}} +\let\aeb@layoutMagMag\@empty +% \end{macrocode} +% \subsubsection{Open to page} +% The \texttt{openatpage}\IndexKey{openatpage} key takes a page number as its value. +% \begin{macrocode} +\define@key{aebLayoutMag}{openatpage}[1]{\def\aeb@openatpageChoice{#1}% + \ifpdfmarkup\def\aeb@layoutMagPage{Page#1}\else + \def\aeb@layoutMagPage{#1}\fi} +\let\aeb@openatpageChoice\@empty +\let\aeb@layoutMagPage\@empty +% \end{macrocode} +% \begin{macro}{\setLayoutMag} +% Set the Layout and Magnifications options on the Initial View tab of the Document Properties dialog box. +% \begin{macrocode} +\newcommand{\setLayoutMag}[1]{\setkeys{aebLayoutMag}{openatpage=1}% + \cxkvsetkeys{aebLayoutMag}{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\DeclareInitView} +% This command is the ultimate holder of the Initial View data. It has three keys +% \texttt{layoutmag}\IndexKey{layoutmag}, +% \texttt{windowoptions}\IndexKey{windowoptions} and \texttt{uioptions}\IndexKey{uioptions}. The +% values for each of these three are key values for the commands defined above: +% \cs{setLayoutMag}, \cs{setWindowOptions} and \cs{setUIOptions}. +% \begin{macrocode} +\define@key{aebDeclareInitView}{layoutmag} + {\def\aebDeclareInitView@layoutmag{#1}} +\let\aebDeclareInitView@layoutmag\@empty +\define@key{aebDeclareInitView}{windowoptions} + {\def\aebDeclareInitView@windowoptions{#1}} +\let\aebDeclareInitView@windowoptions\@empty +\define@key{aebDeclareInitView}{uioptions} + {\def\aebDeclareInitView@uioptions{#1}} +\let\aebDeclareInitView@uioptions\@empty +\newcommand{\DeclareInitView}[1]{% + \setkeys{aebDeclareInitView}{#1}% + \edef\temp@expand@sets{% + \noexpand\setLayoutMag{\aebDeclareInitView@layoutmag}% + \noexpand\setWindowOptions{\aebDeclareInitView@windowoptions}% + \noexpand\setUIOptions{\aebDeclareInitView@uioptions}% + }\temp@expand@sets +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\taggedPDF} +% Added 07/08/09 to support tagged pdf, principally tabbing using structure. Strictly +% speaking, the document need not be marked as tagged. +% \begin{macrocode} +\providecommand{\taggedPDF}{\def\aeb@TaggedPDF{true}} +\let\aeb@TaggedPDF\@empty +\@onlypreamble\taggedPDF +% \end{macrocode} +% \end{macro} +% Additional Open action +% \begin{macro}{\additionalOpenAction} +% Document open action, this command is renamed to \cmd{\addToDocOpen} and enhanced. +% \begin{macro}{\addToDocOpen} +% \changes{v1.7}{2015/06/11}{Renamed \cmd{\additionalOpenAction} to +% \cmd{\addToDocOpen}, this version is additive.} +% This command enhances \cmd{\additionalOpenAction}. This version can be used +% several times in the preamble with possibly different action types. +% Use the command \cmd{\addToDocOpen} to include additional action to be performed when the +% document opens. This is different from the actions that may be performed when the first page +% is opened. In fact, \emph{this action is independent of what what page is initially opened}. +% \begin{macro}{\requiresVersion} +%\changes{v0.8h}{2008/07/19} +%{ +% Added an optional argument to \cs{requiresVersion}, to give the option +% of only warning the user that a certain version is required; no exiting +% of the document is forced on the user. +%} +% \cmd{\requiresVersion} can be used to put a version condition on viewing the document. \cs{requiresVersion} +% uses \cmd{\addToDocOpen}. If you want to combine several actions, including a version requirement +% you''ll have to use \cmd{\addToDocOpen}. Usage: +%\begin{verbatim} +% \requiresVersion{7} +%\end{verbatim} +% \begin{macro}{\alternateDocumentURL} +% An URL to direct the user to, it is used by \cmd{requiresVersion} when the version requirement +% is not met. +% \begin{macro}{\requiredVersionMsg} +% \cs{requireVersionMsg} is the message that is displayed when the version condition is not met. +% \begin{macro}{\requiredVersionMsgRedirect} +% An redirect message when the version requirement fails, and the document is in a browser. +% \begin{macro}{\afterRequirementPassedJS} +% A hook into the end of the \cmd{\requiresVersion} command for additional JS to be +% executed. +% \begin{macrocode} +\let\aeb@addOpenAction\@empty +\let\aeb@addActionCode\@empty +\let\aeb@addOpenActionArg\@empty +\def\AEB@psMrk{[\space} +\let\aebpopentoks\@empty +\let\aebpFA\aebp@NO +\def\aebp@rightDelimiters{} +% \end{macrocode} +% \begin{macro}{\addToDocOpen} +% The argument of \cmd{\addToDocOpen} is an action, usually +% JavaScript or named. +%\begin{verbatim} +% \addToDocOpen{/S/GoTo/D[\Page{2}/Fit]} +% \addToDocOpen{\JS{console.println("Public: Open it baby!");}} +%\end{verbatim} +% As of 2015/06/15, the original version of \cs{addToDocOpen} was moved to +% \textsf{insdljs} (v2.1). This redefinition extends that capability slightly +% by incorporating into it the \cs{dev@addToDocOpen} command, see definition +% below. +% \changes{v1.9}{2016/03/03}{Redefine \string\cs{addtoDocOpen} only for pdfmarkup} +% \par\medskip\noindent +% The \cmd{\addToDocOpen} command is the major interface +% between the document author for inserting open actions (not first page actions). +% At least in the case of \textsf{pdflatex}, \textsf{hyperref} has the potential of +% overwriting the user's choices with its own choice. We turn off the open page +% action of \textsf{hyperref} by setting the following two commands to empty. +% \begin{macrocode} +\let\@pdfstartview\@empty +\let\@pdfstartpage\@empty +% \end{macrocode} +% Now for the definition of \cmd\addToDocOpen. +% \changes{v2.1}{2016/05/15}{Finalized changes to \string\cs{addToDocOpen} for +% non-Distiller workflows.} +% \begin{macrocode} +\renewcommand{\addToDocOpen}[1]{% +% \end{macrocode} +% The \cs{aebpFA} flag indicates whether this command has been used. The first it is +% used, we set things up. +% \begin{macrocode} + \ifx\aebpFA\aebp@NO + \gdef\aeb@addOpenActionArg{#1}% + \g@addto@macro\aebpopentoks{#1}% + \def\aeb@addActionCode{\bgroup\makeJSspecials\dl@preProcDefns +\ifpdfmarkup + \literalps@out{\AEB@psMrk/_objdef {pubAddToDocOpen} + /type/dict /OBJ pdfmark^^J% + \AEB@psMrk{pubAddToDocOpen} + << \aebpopentoks + \ifx\dev@addOpenAction\@empty\else + \ifx\aeb@addOpenActionArg\@empty\else^^J% + \dev@addOpenAction\fi\fi\aebp@rightDelimiters + >> /PUT pdfmark}% + \gdef\pubAddToDocOpen{{pubAddToDocOpen}}% + \xdef\aeb@addOpenAction{/Next \pubAddToDocOpen}% +\else\ifpdf + \immediate\pdfobj{<< \aebpopentoks + \ifx\dev@addOpenAction\@empty\else + \ifx\aeb@addOpenActionArg\@empty\else^^J% + \dev@addOpenAction\fi\fi\aebp@rightDelimiters + >>}\xdef\pubAddToDocOpen{\the\pdflastobj\space 0 R}% + \xdef\aeb@addOpenAction{/Next \pubAddToDocOpen}% +\else\ifxetex + \immediate\@pdfm@mark{obj @pubAddToDocOpen << \aebpopentoks + \ifx\dev@addOpenAction\@empty\else + \ifx\aeb@addOpenActionArg\@empty\else^^J% + \dev@addOpenAction\fi\fi\aebp@rightDelimiters >> }% + \gdef\pubAddToDocOpen{@pubAddToDocOpen}% + \xdef\aeb@addOpenAction{/Next \pubAddToDocOpen}% +\fi\fi\fi\egroup}% +% \end{macrocode} +% Set the \cs{aebpFA} flag to \cs{aebp@YES} to indicate this command has been executed +% at least once. +% \begin{macrocode} + \global\let\aebpFA\aebp@YES + \else +% \end{macrocode} +% If the document author uses this command a second time, the code goes to here. +% \begin{macrocode} + \edef\aebp@dljstmp{\aebp@rightDelimiters}% + \xdef\aebp@rightDelimiters{\aebp@dljstmp >> }% + \g@addto@macro\aebpopentoks{/Next << #1 }% + \fi +} +\let\additionalOpenAction\addToDocOpen +% \end{macrocode} +% \end{macro} +% \begin{macro}{\dev@addToDocOpen} +% \changes{v1.7}{2015/06/07}{Added private additional action} +% The \cs{dev@addToDocOpen} is similar to +% \cs{addToDocOpen} but is meant for package developers. These actions are executed +% \emph{after the actions} of \cs{addToDocOpen}. +% \changes{v2.1}{2016/05/15}{Extended \string\cs{dev@addToDocOpen} to include +% non-Distiller workflows.} +% \begin{macrocode} +\let\dev@addOpenAction\@empty +\let\dev@addOpenActionArg\@empty +\let\dev@addActionCode\@empty +\let\aebpFAP\aebp@NO +\let\aebpopentoksP\@empty +\def\aebp@rightDelimitersP{} +\newcommand{\dev@addToDocOpen}[1]{% +% \end{macrocode} +% The \cs{aebpFAP} flag indicates whether this command has been used. The first it is +% used, we set things up. +% \begin{macrocode} + \ifx\aebpFAP\aebp@NO + \gdef\dev@addOpenActionArg{#1}% + \g@addto@macro\aebpopentoksP{#1}% + \def\dev@addActionCode{\bgroup\makeJSspecials\dl@preProcDefns +\ifpdfmarkup + \literalps@out{\AEB@psMrk/_objdef {privAddDocOpen} + /type/dict /OBJ pdfmark^^J% + \AEB@psMrk{privAddDocOpen} << \aebpopentoksP + \aebp@rightDelimitersP\space>> /PUT pdfmark}% + \gdef\privAddDocOpen{{privAddDocOpen}}% + \gdef\dev@addOpenAction{/Next {privAddDocOpen}}% +\else\ifpdf + \immediate\pdfobj{<< \aebpopentoksP + \aebp@rightDelimitersP\space>>}% + \xdef\privAddDocOpen{\the\pdflastobj\space 0 R}% + \xdef\dev@addOpenAction{/Next \privAddDocOpen}% +\else\ifxetex + \immediate\@pdfm@mark{obj @privAddToDocOpen << \aebpopentoksP + \aebp@rightDelimitersP\space>> }% + \gdef\privAddDocOpen{@privAddToDocOpen}% + \gdef\dev@addOpenAction{/Next \privAddDocOpen}% +\fi\fi\fi\egroup}% +% \end{macrocode} +% Set the \cs{aebpFAP} flag to \cs{aebp@YES} to indicate this command has been executed +% at least once. +% \begin{macrocode} + \global\let\aebpFAP\aebp@YES +% \end{macrocode} +% If the package developer uses this command a second time, the code goes to here. +% \begin{macrocode} + \else + \edef\aebp@dljstmpP{\aebp@rightDelimitersP}% + \xdef\aebp@rightDelimitersP{\aebp@dljstmpP >> }% + \g@addto@macro\aebpopentoksP{/Next << #1 }% + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\def\aebp@warnonly{warnonly} +\newcommand{\aebp@app@title}{AcroTeX Message} +% \end{macrocode} +%\begin{verbatim} +% #1 = warnonly or empty +% #2 = version number +%\end{verbatim} +% \begin{macrocode} +\newcommand{\requiresVersion}[2][]{\def\aebp@argi{#1}% + \def\requiredVersionNumber{#2}\dev@addToDocOpen{\JS{% +\ifx\aebp@argi\aebp@warnonly + var warnOnly=true; +\else + var warnOnly=false; +\fi +% \end{macrocode} +% (2015/10/14) Inserted parentheses to prevent dvips from breaking lines within a string. +% \changes{v1.7n}{2015/10/14}{Inserted parentheses to prevent dvips from breaking lines within a string.} +% \begin{macrocode} + var reqVerMsgC=("\aeb@requiredVersionMsg\space") + + ((warnOnly) ? ("\aeb@reqVerMsgW") : ("\aeb@reqVerMsgC")); + var reqVerMsgR=("\aeb@requiredVersionMsgRedirect\space") + + ((warnOnly) ? ("\aeb@reqVerMsgW") : ("\aeb@reqVerMsgR")); + if( app.viewerVersion < #2 ) { + var viewerPassedReq=false; + try { + if (this.external) { + app.alert({cTitle:"\aebp@app@title", cMsg: reqVerMsgR}); + if (!warnOnly) { + if (app.viewerVersion >= 7.0) + app.launchURL("\aebAlternateDocumentURL"); + else + this.getURL("\aebAlternateDocumentURL",false); + } + } else { + app.alert({cTitle:"\aebp@app@title", cMsg: reqVerMsgC}); + if (!warnOnly) this.closeDoc(true); + } + } catch(e) {} + } else { + var viewerPassedReq=true; + \aeb@ViewerPassedRequirementJS + } +}}} +\def\requiredVersionNumber{7} +\newcommand{\alternateDocumentURL}[1]{\def\aebAlternateDocumentURL{#1}} +\alternateDocumentURL{http://www.acrotex.net/} +\newcommand{\requiredVersionMsg}[1]{\def\aeb@requiredVersionMsg{#1}} +\requiredVersionMsg{This document requires Adobe Reader or Acrobat, + version \requiredVersionNumber\space or later.} +\newcommand{\requiredVersionResult}[3]{\def\aeb@reqVerMsgC{#1}% + \def\aeb@reqVerMsgR{#2}\def\aeb@reqVerMsgW{#3}} +\requiredVersionResult{The document is now closing.} + {Redirecting browser to an alternate page.} + {Some features of this document may not work properly.} +\newcommand{\requiredVersionMsgRedirect}[1]{% + \def\aeb@requiredVersionMsgRedirect{#1}} +\requiredVersionMsgRedirect{% + This document requires Adobe Reader or Acrobat, + version \requiredVersionNumber\space or later.} +\newcommand{\afterRequirementPassedJS}[1]{% + \def\aeb@ViewerPassedRequirementJS{#1}} +\let\aeb@ViewerPassedRequirementJS\@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% Now let's put it all together. The two flags, \cs{aebpFA} and \cs{aebpFAP} indicate +% whether the commands \cs{addToDocOpen} and \cs{dev@addToDocOpen} were used. +% \begin{macrocode} +\def\aeb@SetCatalog{% + \ifx\aebpFA\aebp@NO\addToDocOpen{\JS{;}}\fi + \ifx\aebpFAP\aebp@YES\dev@addActionCode\fi + \aeb@addActionCode +% \end{macrocode} +% The viewer preferences. +% \begin{macrocode} +\def\aeb@CatEntry{/ViewerPreferences<<% + \ifx\aeb@windowoptsFitWindow\@empty\else + \aeb@windowoptsFitWindow\fi + \ifx\aeb@windowoptsCenterWindow\@empty\else + \aeb@windowoptsCenterWindow\fi + \ifx\aeb@windowoptsDisplayDocTitle\@empty\else + \aeb@windowoptsDisplayDocTitle\fi + \ifx\aeb@uioptsHideToolbar\@empty\else + \aeb@uioptsHideToolbar\fi + \ifx\aeb@uioptsHideMenubar\@empty\else + \aeb@uioptsHideMenubar\fi + \ifx\aeb@uioptsHideWindowUI\@empty\else + \aeb@uioptsHideWindowUI\fi + \ifx\aeb@layoutMagNaviTab\@empty\else + /NonFullScreenPageMode/\aeb@layoutMagNaviTab\fi +>>% + \ifx\aeb@TaggedPDF\@empty\else + /MarkInfo<>\fi + \ifx\aeb@layoutMagPageLayout\@empty\else + /PageLayout/\aeb@layoutMagPageLayout\fi + \ifx\aeb@windowoptsFullScreen\@empty + \ifx\aeb@layoutMagNaviTab\@empty\else + /PageMode/\aeb@layoutMagNaviTab\fi + \else/PageMode/FullScreen\fi +% \end{macrocode} +% The open action key (\textsf{\textbf{OpenAction}}) is implemented any of three ways, +% depending on the driver. The command \cs{pubAddToDocOpen} is an indirect reference +% to additional open actions; this is defined in \cs{addToDocOpen}. +%\changes{v1.9}{2016/03/03}{Removing pdfmark code for non-Distiller workflow} +% \begin{macrocode} +\ifpdfmarkup + \ifx\aeb@layoutMagPage\@empty + \ifx\aeb@layoutMagMag\@empty + /OpenAction \pubAddToDocOpen + \else/OpenAction<>\fi + \else + \ifx\aeb@layoutMagMag\@empty + /OpenAction<>\else + /OpenAction<>\fi + \fi +\else\ifpdf + \ifx\aeb@layoutMagPage\@empty + \ifx\aeb@layoutMagMag\@empty + /OpenAction \pubAddToDocOpen + \else/OpenAction <<% + /D[\pdfpageref1\space\space 0 R\aeb@layoutMagMag]% + /S/GoTo\aeb@addOpenAction>>\fi + \else + \ifx\aeb@layoutMagMag\@empty + /OpenAction<>\else + /OpenAction<>\fi + \fi +\else\ifxetex + \ifx\aeb@layoutMagPage\@empty + \ifx\aeb@layoutMagMag\@empty + /OpenAction \pubAddToDocOpen + \else/OpenAction<>\fi + \else + \ifx\aeb@layoutMagMag\@empty + /OpenAction<>\else + /OpenAction<<% + /D[@page\aeb@layoutMagPage\space\aeb@layoutMagMag]% + /S/GoTo\aeb@addOpenAction>>\fi + \fi +\fi\fi\fi}% +% \end{macrocode} +% Load \cs{aeb@SetCatalog} only if a Distiller user. +%\changes{v1.9}{2016/03/03}{Removing pdfmark code for non-Distiller workflow} +%\changes{v2.0}{2016/05/08}{Attempt to extend package to include more features +%for pdftex and xetex. Modified \string\cs{aeb@SetCatalog}.} +% \begin{macrocode} + \ifpdfmarkup\literalps@out{\AEB@psMrk{Catalog} + <<\aeb@CatEntry>> /PUT pdfmark}\else + \ifpdf\pdfcatalog{\aeb@CatEntry}\else + \ifxetex\immediate\@pdfm@mark{put @catalog <<\aeb@CatEntry>>}% + \fi\fi\fi +} +\AtBeginDocument{\aeb@SetCatalog} +% \end{macrocode} +% +% \section{Fullscreen and Transitions} +% +% \subsection{\texorpdfstring{\cs{setDefaultFS}}{\textbackslash setDefaultFS}} +% \begin{macro}{\setDefaultFS} +% Use \cs{setDefaultFS} to set the defaults for fullscreen +% mode in the Adobe Reader or Acrobat. +% \begin{macrocode} +\newcommand{\setDefaultFS}[1] +{% + \setkeys{aebDefFS}{Trans=Replace}\setkeys{aebDefFS}{#1}% + \makeatletter + \InputIfFileExists{fsprodef.js}{}{\PackageWarning{aeb_pro} + {Cannot find fsprodef.js, please run aeb_pro.ins again}} + \makeatother +} +\@onlypreamble\setDefaultFS +% \end{macrocode} +% \end{macro} +% Definitions of the values of the \texttt{Trans}\IndexKey{Trans} key for +% supported transitions; these are set using the command +% \cs{setDefaultFS}. +% +% \begin{macrocode} +\def\aeb@NoTransition{NoTransition} +\define@choicekey+{aebDefFS}{Trans} +{NoTransition,UncoverLeft,UncoverRight,UncoverDown,UncoverUp,% +UncoverLeftDown,UncoverLeftUp,UncoverRightDown,UncoverRightUp,% +CoverLeft,CoverRight,CoverDown,CoverUp,CoverLeftDown,CoverLeftUp,% +CoverRightDown,CoverRightUp,PushLeft,PushRight,PushDown,PushUp,% +PushLeftDown,PushLeftUp,PushRightDown,PushRightUp,FlyInRight,% +FlyInLeft,FlyInDown,FlyInUp,FlyOutRight,FlyOutLeft,FlyOutDown,% +FlyOutUp,FlyIn,FlyOut,Blend,Fade,Random,Dissolve,% +GlitterRight,GlitterDown,GlitterRightDown,BoxIn,BoxOut,% +BlindsHorizontal,BlindsVertical,SplitHorizontalIn,% +SplitHorizontalOut,SplitVerticalIn,SplitVerticalOut,WipeLeft,% +WipeRight,WipeDown,WipeUp,WipeLeftDown,WipeLeftUp,% +WipeRightDown,WipeRightUp,Replace,ZoomInDown,ZoomInLeft,% +ZoomInLeftDown,ZoomInLeftUp,ZoomInRight,ZoomInRightDown,% +ZoomInRightUp,ZoomInUp,ZoomOutDown,ZoomOutLeft,ZoomOutLeftDown,% +ZoomOutLeftUp,ZoomOutRight,ZoomOutRightDown,ZoomOutRightUp,% +ZoomOutUp,CombHorizontal,CombVertical}[Replace]{% + \def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@fsTran\@empty\else + \ifx\aeb@arg\aeb@NoTransition + \def\aeb@fsTran{app.fs.defaultTransition = "";^^J} + \else + \def\aeb@fsTran{app.fs.defaultTransition = "#1";^^J}\fi\fi} +{\PackageWarning{aeb}{Bad choice, try again. Meanwhile, + will use the default, Replace}% + \def\aeb@fsTran{app.fs.defaultTransition = "Replace";^^J}} +% \end{macrocode} +% The \texttt{bgColor}\IndexKey{bgColor} key. +% \begin{macrocode} +\define@key{aebDefFS}{bgColor}[]{% + \def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@fsBGColor\@empty\else + \def\aeb@fsBGColor{app.fs.backgroundColor = #1;^^J}\fi} +\let\aeb@fsBGColor\@empty +% \end{macrocode} +% The \texttt{timeDelay}\IndexKey{timeDelay} key. +% \begin{macrocode} +\define@key{aebDefFS}{timeDelay}[]{% + \def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@fstimeDelay\@empty\else + \def\aeb@fstimeDelay{app.fs.timeDelay = #1;^^J}\fi} +\let\aeb@fstimeDelay\@empty +% \end{macrocode} +% The \texttt{loop}\IndexKey{loop} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{loop}[true]{% + \def\aeb@fsLoop{app.fs.loop = #1;^^J}} +\let\aeb@fsLoop\@empty +% \end{macrocode} +% The \texttt{cursor}\IndexKey{cursor} key. +% \begin{macrocode} +\define@choicekey+{aebDefFS}{cursor}{hidden,delay,visible}{% + \def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@fscursor\@empty\else + \def\aeb@fscursor{app.fs.cursor = cursor.#1;^^J}\fi +}{\PackageWarning{aeb}{Bad choice for cursor, permissible values + are hidden, delay and visible. Try again}} +\let\aeb@fscursor\@empty +% \end{macrocode} +% The \texttt{escape}\IndexKey{escape} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{escape}[true]{% + \def\aeb@fsEscape{app.fs.escapeExits = #1;^^J}} +\let\aeb@fsEscape\@empty +% \end{macrocode} +% The \texttt{clickAdv}\IndexKey{clickAdv} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{clickAdv}[true]{% + \def\aeb@fsclickAdv{app.fs.clickAdvances = #1;^^J}} +\let\aeb@fsclickAdv\@empty +% \end{macrocode} +% The \texttt{fullscreen}\IndexKey{fullscreen} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{fullscreen}[true]{% + \def\aeb@windowoptsFullScreen{true}% +} +\let\aeb@fsFS\@empty +% \end{macrocode} +% The \texttt{useTimer}\IndexKey{useTimer} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{useTimer}[true]{% + \def\aeb@fsuseTimer{app.fs.useTimer = #1;^^J}} +\let\aeb@fsuseTimer\@empty +% \end{macrocode} +% The \texttt{usePageTiming}\IndexKey{usePageTiming} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{usePageTiming}[true]{% + \def\aeb@fsusePageTiming{app.fs.usePageTiming = #1;^^J}} +\let\aeb@fsusePageTiming\@empty +% \end{macrocode} +% \subsection{\texorpdfstring{\cs{setPageTransition}}{\textbackslash setPageTransition}} +% +% \begin{macro}{\setPageTransition} +% By setting the \texttt{aebTrans} family of keys, you can change the transition +% effect of the next slide. +% \changes{v2.1}{2016/05/15}{Finalized changes in \string\cs{setPageTransition} for +% non-Distiller workflows.} +% \begin{macrocode} +\def\aebp@PageTransCnt{0} +\def\aebp@Step@PageTransCnt{{\count0=\aebp@PageTransCnt\relax + \advance\count0by1\relax + \xdef\aebp@PageTransCnt{\the\count0 }}} +\newcommand{\setPageTransition}[1]{% + \begingroup + \aebp@Step@PageTransCnt + \setkeys{aebTrans}{TransDur,Speed,#1}% + \edef\aeb@pagetranschoices{\aeb@Page@Dur + /Trans <<\aeb@Trans@Dur\aeb@TranChoice>>}% + \csarg{\xdef}{aeb@pagetransCodeL\aebp@PageTransCnt}{% + \ifpdfmarkup + \noexpand\literalps@out{\AEB@psMrk{ThisPage} << + \aeb@pagetranschoices\space>> /PUT pdfmark}% + \else\ifpdf +% \end{macrocode} +% There may be open / close page actions already defined, so we combine +% previous page actions with current page actions. This seems necessary +% only for \textsf{pdftex}. +% \begin{macrocode} + \noexpand\global\noexpand\pdfpageattr=\noexpand\expandafter + {\noexpand\the\noexpand\pdfpageattr\aeb@pagetranschoices}% + \else\ifxetex + \noexpand\immediate\noexpand\@pdfm@mark{put @thispage << + \aeb@pagetranschoices\space >>} + \fi\fi\fi + } + \ifx\aeb@TranChoice\@empty\else + \csarg\xdef{aebpP@geTr@nsP@ge\arabic{page}}% + {\noexpand\@nameuse{aeb@pagetransCodeL\aebp@PageTransCnt}}% + \fi + \endgroup +} +% \end{macrocode} +% \begin{macro}{\setPageTransitionAt} +% Set the transition for a particular page +% \changes{v2.1}{2016/05/15}{Finalized changes in \string\cs{setPageTransitionAt} for +% non-Distiller workflows.} +% \begin{macrocode} +\newcommand{\setPageTransitionAt}[2]{% + \begingroup + \aebp@Step@PageTransCnt + \setkeys{aebTrans}{#2}% + \edef\aeb@pagetranschoices{\aeb@Page@Dur + /Trans <<\aeb@Trans@Dur\aeb@TranChoice>>}% + \csarg{\xdef}{aeb@pagetransCode\aebp@PageTransCnt}{% + \ifpdfmarkup + \noexpand\literalps@out{\AEB@psMrk{ThisPage} << + \aeb@pagetranschoices\space>> /PUT pdfmark}% + \else\ifpdf +% \end{macrocode} +% There may be open / close page actions already defined, so we combine +% previous page actions with current page actions. This seems necessary +% only for \textsf{pdftex}. +% \begin{macrocode} + \noexpand\global\noexpand\pdfpageattr=\noexpand\expandafter + {\noexpand\the\noexpand\pdfpageattr\aeb@pagetranschoices}% + \else\ifxetex + \noexpand\immediate\noexpand\@pdfm@mark{put @thispage << + \aeb@pagetranschoices\space>>} + \fi\fi\fi + } + \ifx\aeb@TranChoice\@empty\else + \expandafter\aebp@rse\expandafter{#1}% + \edef\shakeandbake{% + \noexpand\@for\noexpand\@mypage:=\the\aeb@parsetoks}% + \shakeandbake \do {% + \csarg\xdef{aebpP@geTr@nsP@ge\@mypage}% + {\noexpand\@nameuse{aeb@pagetransCode\aebp@PageTransCnt}}% + }% + \fi + \endgroup +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% The values of the \texttt{Trans}\IndexKey{Trans} key. There are the 50 transitions effects as listed by +% \texttt{app.fs.transitions} plus one more called +% ``\texttt{NoTransition}''. The \texttt{pdfmark} code accurately +% represents each of this options. +% \begin{macrocode} +\define@choicekey+{aebTrans}{Trans} +{NoTransition,UncoverLeft,UncoverRight,UncoverDown,UncoverUp,% +UncoverLeftDown,UncoverLeftUp,UncoverRightDown,UncoverRightUp,% +CoverLeft,CoverRight,CoverDown,CoverUp,CoverLeftDown,CoverLeftUp,% +CoverRightDown,CoverRightUp,PushLeft,PushRight,PushDown,PushUp,% +PushLeftDown,PushLeftUp,PushRightDown,PushRightUp,FlyInRight,% +FlyInLeft,FlyInDown,FlyInUp,FlyOutRight,FlyOutLeft,FlyOutDown,% +FlyOutUp,FlyIn,FlyOut,Blend,Fade,Random,Dissolve,% +GlitterRight,GlitterDown,GlitterRightDown,BoxIn,BoxOut,% +BlindsHorizontal,BlindsVertical,SplitHorizontalIn,% +SplitHorizontalOut,SplitVerticalIn,SplitVerticalOut,WipeLeft,% +WipeRight,WipeDown,WipeUp,WipeLeftDown,WipeLeftUp,% +WipeRightDown,WipeRightUp,Replace,ZoomInDown,ZoomInLeft,% +ZoomInLeftDown,ZoomInLeftUp,ZoomInRight,ZoomInRightDown,% +ZoomInRightUp,ZoomInUp,ZoomOutDown,ZoomOutLeft,ZoomOutLeftDown,% +ZoomOutLeftUp,ZoomOutRight,ZoomOutRightDown,ZoomOutRightUp,% +ZoomOutUp,CombHorizontal,CombVertical}[Replace]% + {\edef\aeb@TranChoice{\csname aeb@Trans@#1\endcsname}% +}{\PackageWarning{aeb}{Bad choice, try again}} +\let\aeb@TranChoice\@empty +\define@key{aebTrans}{TransDur}[]{\def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@Trans@Dur\@empty\else\def\aeb@Trans@Dur{/D #1}\fi} +\let\aeb@Trans@Dur\@empty +% \end{macrocode} +% Length\IndexKey{Speed} of duration of transition effect: \texttt{Slow}, \texttt{Medium}, \texttt{Fast} +% \begin{macrocode} +\define@choicekey+{aebTrans}{Speed}[\val\nr]% + {Slow,Medium,Fast}[Slow]{%dps/change 02/27/07 + \ifcase\nr\relax + \let\aeb@Trans@Speed\@empty\or + \def\aeb@Trans@Speed{/D 0.666656}\or + \def\aeb@Trans@Speed{/D 0.333328}\fi +}{\PackageWarning{aeb}{Bad choice for Speed, permissible values + are Slow, Medium and Fast. Try again}} +\let\apb@apbTrans@Speed\@empty +% \end{macrocode} +% The page duration\IndexKey{PageDur} key +% \begin{macrocode} +\define@key{aebTrans}{PageDur}[]{\def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@Page@Dur\@empty\else\def\aeb@Page@Dur{/Dur #1}\fi} +% \end{macrocode} +% The code for the values of the \texttt{Trans} key +% \begin{macrocode} +\let\aeb@Page@Dur\@empty +\def\aeb@Trans@NoTransition{} +\def\aeb@Trans@SplitHorizontalIn{/Dm/H/M/I/S/Split} +\def\aeb@Trans@SplitHorizontalOut{/Dm/H/M/O/S/Split} +\def\aeb@Trans@SplitVerticalIn{/Dm/V/M/I/S/Split} +\def\aeb@Trans@SplitVerticalOut{/Dm/V/M/O/S/Split} +\def\aeb@Trans@BlindsHorizontal{/Dm/H/S/Blinds} +\def\aeb@Trans@BlindsVertical{/Dm/V/S/Blinds} +\def\aeb@Trans@BoxIn{/M/I/S/Box} +\def\aeb@Trans@BoxOut{/M/O/S/Box} +\def\aeb@Trans@WipeLeft{/Di 180/S/Wipe} +\def\aeb@Trans@WipeRight{/Di 0/S/Wipe} +\def\aeb@Trans@WipeDown{/Di 270/S/Wipe} +\def\aeb@Trans@WipeUp{/Di 90/S/Wipe} +\def\aeb@Trans@Dissolve{/S/Dissolve} +\def\aeb@Trans@GlitterRight{/Di 0/S/Glitter} +\def\aeb@Trans@GlitterDown{/Di 270/S/Glitter} +\def\aeb@Trans@GlitterRightDown{/Di 315/S/Glitter} +\def\aeb@Trans@Replace{/S/R} +\def\aeb@Trans@FlyInRight{/Di 0/M/I/S/Fly} +\def\aeb@Trans@FlyInLeft{/Di 180/M/I/S/Fly} +\def\aeb@Trans@FlyInDown{/Di 270/M/I/S/Fly} +\def\aeb@Trans@FlyInUp{/Di 90/M/I/S/Fly} +\def\aeb@Trans@FlyOutRight{/Di 0/M/O/S/Fly} +\def\aeb@Trans@FlyOutLeft{/Di 180/M/O/S/Fly} +\def\aeb@Trans@FlyOutDown{/Di 270/M/O/S/Fly} +\def\aeb@Trans@FlyOutUp{/Di 90/M/O/S/Fly} +\def\aeb@Trans@FlyIn{/M/I/S/Fly} +\def\aeb@Trans@FlyOut{/M/O/S/Fly} +\def\aeb@Trans@PushLeft{/Di 180/S/Push} +\def\aeb@Trans@PushRight{/Di 0/S/Push} +\def\aeb@Trans@PushDown{/Di 270/S/Push} +\def\aeb@Trans@PushUp{/Di 90/S/Push} +\def\aeb@Trans@CoverLeft{/Di 180/S/Cover} +\def\aeb@Trans@CoverRight{/Di 0/S/Cover} +\def\aeb@Trans@CoverDown{/Di 270/S/Cover} +\def\aeb@Trans@CoverUp{/Di 90/S/Cover} +\def\aeb@Trans@CoverLeftDown{/Di 225.0/S/Cover} +\def\aeb@Trans@CoverLeftUp{/Di 135.0/S/Cover} +\def\aeb@Trans@CoverRightDown{/Di 315.0/S/Cover} +\def\aeb@Trans@CoverRightUp{/Di 45.0/S/Cover} +\def\aeb@Trans@UncoverLeft{/Di 180/S/Uncover} +\def\aeb@Trans@UncoverRight{/Di 0/S/Uncover} +\def\aeb@Trans@UncoverDown{/Di 270/S/Uncover} +\def\aeb@Trans@UncoverUp{/Di 90/S/Uncover} +\def\aeb@Trans@UncoverLeftDown{/Di 225.0/S/Uncover} +\def\aeb@Trans@UncoverLeftUp{/Di 135.0/S/Uncover} +\def\aeb@Trans@UncoverRightDown{/Di 315.0/S/Uncover} +\def\aeb@Trans@UncoverRightUp{/Di 45.0/S/Uncover} +\def\aeb@Trans@Fade{/S/Fade} +\def\aeb@Trans@Random{/S/Random} +\def\aeb@Trans@Blend{/S/Blend} +% \end{macrocode} +% New Transitions for Acrobat 8.0 +% \begin{macrocode} +\def\aeb@Trans@PushLeftDown{% + /S/Push/Directional/BiDir/Di 225.0/Curve/Easy} +\def\aeb@Trans@PushLeftUp{% + /S/Push/Directional/BiDir/Di 135.0/Curve/Easy} +\def\aeb@Trans@PushRightDown{% + /S/Push/Directional/BiDir/Di 315.0/Curve/Easy} +\def\aeb@Trans@PushRightUp{% + /S/Push/Directional/BiDir/Di 45.0/Curve/Easy} +\def\aeb@Trans@WipeLeftDown{% + /S/Wipe/Directional/BiDir/Di 225/Curve/Easy} +\def\aeb@Trans@WipeLeftUp{% + /S/Wipe/Directional/BiDir/Di 135/Curve/Easy} +\def\aeb@Trans@WipeRightDown% + {/S/Wipe/Directional/BiDir/Di 315/Curve/Easy} +\def\aeb@Trans@WipeRightUp{% + /S/Wipe/Directional/BiDir/Di 45/Curve/Easy} +\def\aeb@Trans@ZoomInDown{% + /S/ZoomIn/Directional/BiDir/Di 270.0/Curve/Easy} +\def\aeb@Trans@ZoomInLeft{% + /S/ZoomIn/Directional/BiDir/Di 180.0/Curve/Easy} +\def\aeb@Trans@ZoomInLeftDown{% + /S/ZoomIn/Directional/BiDir/Di 225.0/Curve/Easy} +\def\aeb@Trans@ZoomInLeftUp{% + /S/ZoomIn/Directional/BiDir/Di 135.0/Curve/Easy} +\def\aeb@Trans@ZoomInRight{% + /S/ZoomIn/Directional/BiDir/Di 0.0/Curve/Easy} +\def\aeb@Trans@ZoomInRightDown{% + /S/ZoomIn/Directional/BiDir/Di 315.0/Curve/Easy} +\def\aeb@Trans@ZoomInRightUp{% + /S/ZoomIn/Directional/BiDir/Di 45.0/Curve/Easy} +\def\aeb@Trans@ZoomInUp{% + /S/ZoomIn/Directional/BiDir/Di 90.0/Curve/Easy} +\def\aeb@Trans@ZoomOutDown{% + /S/ZoomOut/Directional/BiDir/Di 270.0/Curve/Easy} +\def\aeb@Trans@ZoomOutLeft{% + /S/ZoomOut/Directional/BiDir/Di 180.0/Curve/Easy} +\def\aeb@Trans@ZoomOutLeftDown{% + /S/ZoomOut/Directional/BiDir/Di 225.0/Curve/Easy} +\def\aeb@Trans@ZoomOutLeftUp{% + /S/ZoomOut/Directional/BiDir/Di 135.0/Curve/Easy} +\def\aeb@Trans@ZoomOutRight{% + /S/ZoomOut/Directional/BiDir/Di 0.0/Curve/Easy} +\def\aeb@Trans@ZoomOutRightDown{% + /S/ZoomOut/Directional/BiDir/Di 315.0/Curve/Easy} +\def\aeb@Trans@ZoomOutRightUp{% + /S/ZoomOut/Directional/BiDir/Di 45.0/Curve/Easy} +\def\aeb@Trans@ZoomOutUp{% + /S/ZoomOut/Directional/BiDir/Di 90.0/Curve/Easy} +\def\aeb@Trans@CombHorizontal{% + /S/Comb/Directional/BiDir/Dm/H/Curve/Easy} +\def\aeb@Trans@CombVertical{% + /S/Comb/Directional/BiDir/Dm/V/Curve/Easy} +% \end{macrocode} +% \begin{macrocode} +% End of aebpro segment +% +%<*fsdefjs> +% \end{macrocode} +% \subsection{JS for Fullscreen Support} +% The ``Presentation Defaults'' are used in conjunction with the +% \cs{setDefaultFS} for setting the defaults of the application. These +% settings can be viewed under the \texttt{Edit > Preferences > +% General > Full Screen}. This script save the viewers preferences, +% sets them according the needs of the document author, and upon +% closing the document, resets the original preferences. The last task +% is performed by the \texttt{willClose} environment. +% \begin{macrocode} +\begin{insDLJS}[_fsDefaults]{fsdef}{AeB Pro: Presentation Defaults} +var _fsDefaults = true; +%if ( typeof global.fsexec == "undefined" ) +if ( typeof fsexec == "undefined" ) +{ + try { + var fsexec = true; +% global.fsexec = true; + var aebdefaultTransition = app.fs.defaultTransition; + var aebbackgroundColor = app.fs.backgroundColor; + var aebloop = app.fs.loop; + var aebtimeDelay = app.fs.timeDelay; + var aebuseTimer = app.fs.useTimer + var aebusePageTiming = app.fs.usePageTiming; + var aebclickAdvances = app.fs.clickAdvances; + var aebcursor = app.fs.cursor; + var aebescapeExits = app.fs.escapeExits; +\aeb@fsTran% +\aeb@fsBGColor% +\aeb@fsLoop% +\aeb@fsclickAdv% +\aeb@fscursor% +\aeb@fstimeDelay% +\aeb@fsuseTimer% +\aeb@fsusePageTiming% +\aeb@fsEscape% +\aeb@fsFS% + } catch(e) {} +} +\end{insDLJS} +% \end{macrocode} +% This is a series of script lines that will be inserted into the \texttt{willClose} +% section of the document. These will attempt to restore the user's full screen +% defaults. +% \begin{macrocode} +\begin{fs@willClose} +try { + delete global.fsexec; + app.fs.defaultTransition = aebdefaultTransition; + app.fs.backgroundColor = aebbackgroundColor; + app.fs.loop = aebloop; + app.fs.timeDelay = aebtimeDelay; + app.fs.useTimer = aebuseTimer; + app.fs.usePageTiming = aebusePageTiming; + app.fs.clickAdvances = aebclickAdvances; + app.fs.cursor = aebcursor; + app.fs.escapeExits = aebescapeExits; +} catch(e) { console.println("Could not reset one of the defaults"); } +\end{fs@willClose} +% \end{macrocode} +% \begin{macrocode} +% End of fsdefjs segment +% +%<*aebpro> +% \end{macrocode} +% \section{Set Page Actions} +% \begin{environment}{addJSToPageOpen} +% \begin{environment}{addJSToPageOpenAt} +% \begin{environment}{addJSToPageClose} +% \begin{environment}{addJSToPageCloseAt} +% The document author can add to the default page open action through +% this environment. Use this environment between slides, effective +% the next slide. The first slide (possibly generated by +% \cs{maketitle}) is a special case: When setting the open and close +% page actions for the first page, these environments \emph{must go} +% in the preamble. +% \begin{macrocode} +\def\canceleveryPageOpen{\global\@everyPageOpenfalse + \global\let\every@PageOpen\@empty} +\def\canceleveryPageClose{\global\@everyPageClosefalse + \global\let\every@PageClose\@empty} +\newenvironment{everyPageOpen}[1][] +{\global\@everyPageOpentrue\@defineJS[#1]{\every@PageOpen}} +{\end@defineJS + \ifnum\value{page}=1\relax + \gdef\ap@AddtoOpenJS{\thisPageAction{\JS{\every@PageOpen}}{}}% + \expandafter\aftergroup\expandafter\ap@AddtoOpenJS\fi +} +\newenvironment{everyPageClose}[1][] +{\global\@everyPageClosetrue\@defineJS[#1]{\every@PageClose}} +{\end@defineJS + \ifnum\value{page}=1\relax + \gdef\ap@AddtoCloseJS{\thisPageAction{}{\JS{\every@PageClose}}}% + \expandafter\aftergroup\expandafter\ap@AddtoCloseJS\fi +} +\let\every@PageOpen\@empty +\let\every@PageClose\@empty +\newenvironment{addJSToPageOpen}[1][] +{\@defineJS[#1]{\addJST@PageOpen}}{\end@defineJS + \ifnum\value{page}=1\relax + \gdef\ap@AddtoOpenJS{\thisPageAction{\JS{\addJST@PageOpen}}{}}% + \expandafter\aftergroup\expandafter\ap@AddtoOpenJS\fi +} +\newenvironment{addJSToPageOpenAt}[2][] +{\@@defineJS[#1]{addJST@PageOpenAt}{#2}}{\end@@defineJS +% \end{macrocode} +%\changes{v1.7}{2015/06/17}{\texttt{addJSToPageOpenAt} can now be used in preamble} +% The \texttt{addJSToPageOpenAt} and \texttt{addJSToPageCloseAt} can now be used +% in the preamble on the first page. +% \begin{macrocode} + \ifnum\value{page}=1\relax\if\frstPageSpec\aebp@YES + \thisPageAction{\JS{\@nameuse{addJST@PageOpenAt1}}}{}\fi\fi +} +\newenvironment{addJSToPageClose}[1][] +{\@defineJS[#1]{\addJST@PageClose}}{\end@defineJS + \ifnum\value{page}=1\relax + \gdef\ap@AddtoCloseJS{% + \thisPageAction{}{\JS{\addJST@PageClose}}}% + \expandafter\aftergroup\expandafter\ap@AddtoCloseJS\fi +} +\newenvironment{addJSToPageCloseAt}[2][] +{\@@defineJS[#1]{addJST@PageCloseAt}{#2}}{\end@@defineJS + \ifnum\value{page}=1\relax\if\frstPageSpec\aebp@YES + \thisPageAction{}{\JS{\@nameuse{addJST@PageCloseAt1}}}\fi\fi +} +\let\addJST@PageOpen\@empty +\let\addJST@PageClose\@empty +% \end{macrocode} +% \end{environment} +% \end{environment} +% \end{environment} +% \end{environment} +% \begin{macro}{\aebp@PageOpenCloseHandler} +% This command gets expanded by \cs{AddToShipoutPicture} for each page. Here we +% define how our page actions are to be inserted. +% \begin{macrocode} +\def\aebp@PageOpenCloseHandler{% + \@ifundefined{addJST@PageOpenAt\arabic{page}}% + {\global\let\thisOpenPageActionAt\@empty}% + {\gdef\thisOpenPageActionAt{% + \@nameuse{addJST@PageOpenAt\arabic{page}}}}% + \@ifundefined{addJST@PageCloseAt\arabic{page}}% + {\global\let\thisClosePageActionAt\@empty}% + {\gdef\thisClosePageActionAt{% + \@nameuse{addJST@PageCloseAt\arabic{page}}}}% + \aebPageAction{\thisOpenPageActionAt\addJST@PageOpen}% + {\thisClosePageActionAt\addJST@PageClose}% + \global\let\addJST@PageOpen\@empty + \global\let\addJST@PageClose\@empty +} +% \end{macrocode} +% (2016/05/15) Added \cs{aebp@PageTransHandler} to handle the page +% transitions. +% \changes{v2.1}{2016/05/15}{Added the command \string\cs{aebp@PageTransHandler} to handle the page +% transitions} +% \begin{macrocode} +\def\aebp@PageTransHandler{\@ifundefined{aebpP@geTr@nsP@ge\arabic{page}} + {}{\@nameuse{aebpP@geTr@nsP@ge\arabic{page}}}} +% \end{macrocode} +% The two handlers are executed on each page +% \changes{v2.1}{2016/05/15}{Added the command \string\cs{aebp@PageTransHandler} +% to the shipout cmd \string\cs{AddToShipoutPicture}.} +% \begin{macrocode} +\AddToShipoutPicture{\aebp@PageOpenCloseHandler + \aebp@PageTransHandler} +% \end{macrocode} +% \end{macro} +% \DescribeMacro{\@@defineJS} is a variation of \cs{@defineJS}, as defined in the \textsf{insdljs} package. +% This version, at the end of the environment, calls the \cs{aebp@rse} command to parse the +% complex command argument, then makes a series of definitions to be used in the open/close +% page events. +% \begin{macrocode} +\newenvironment{@@defineJS}[3][] +{% + \gdef\argType{#2}\gdef\defineJSArg{#3}\JStoks={}% + \def\verbatim@processline + {% + \xdef\JS@temp{\the\JStoks\the\verbatim@line\defineJSjsR}% + \global\JStoks=\expandafter{\JS@temp}% + }% + \let\do\@makeother\dospecials\catcode`\^^M\active + #1% + \verbatim@start +}{% + \expandafter\aebp@rse\expandafter{\defineJSArg}% + \edef\shakeandbake{% + \noexpand\@for\noexpand\@mytoks:=\the\aeb@parsetoks}% + \aeb@parsecnt=0 \shakeandbake \do {% + \ifnum\aeb@parsecnt=0 + \edef\firsttok{\@mytoks}% + \csarg\xdef{\argType\@mytoks}{\the\JStoks}% + \else + \edef\letsmakelet{\global\let\expandafter\noexpand + \csname\argType\@mytoks\endcsname=\expandafter\noexpand + \csname\argType\firsttok\endcsname}% + \letsmakelet + \fi + \advance\aeb@parsecnt1\relax + }% +} +% \end{macrocode} +% \begin{macrocode} +\newif\ifaeb@PageOpen +\newif\ifaeb@PageClose +\newif\if@everyPageOpen\@everyPageOpenfalse +\newif\if@everyPageClose\@everyPageClosefalse +% \end{macrocode} +% \begin{macro}{\aebPageAction} +% This is used internally, but can be used by the document author. The commands creates the code +% to set an open page and a close page action. The first (optional) argument is a the page number (base 1), +% this optional argument defaults to the current page if no page number is given. The second and third +% arguments are the open and closed JavaScript actions. +% +% If the document author uses this command, he may overwrite actions created by the \texttt{addJSTo...} +% environments. See \cs{aeb@addToPageOpenCloseActions} for usage by this package. +% \changes{v2.1}{2016/05/15}{Final changes to \string\cs{aebPageAction} to include non-Distiller +% workflows.} +% \begin{macrocode} +\newcommand\aebPageAction[3][ThisPage]{% + \let\ispageactions=0\aeb@PageOpenfalse\aeb@PageClosefalse + \def\@aebOpen{#2}% + \if1\@aebOpen1% + \if@everyPageOpen + \aeb@PageOpentrue\let\ispageactions=1% + \def\@aebOpen{/O << \JS{\every@PageOpen#2} >>}% + \fi + \else + \let\ispageactions=1% + \aeb@PageOpentrue + \def\@aebOpen{/O << \JS{\every@PageOpen#2} >>}% + \fi + \def\@aebClose{#3}% + \if1\@aebClose1% + \if@everyPageClose + \aeb@PageClosetrue\let\ispageactions=1% + \def\@aebClose{/C << \JS{\every@PageClose#3} >>}% + \fi + \else + \let\ispageactions=1% + \aeb@PageClosetrue + \def\@aebClose{/C << \JS{\every@PageClose#3} >>}% + \fi + \if@everyPageOpen\aeb@PageOpentrue\let\ispageactions=1\fi + \if@everyPageClose\@everyPageClosetrue\let\ispageactions=1\fi + \if\ispageactions1% + \xdef\aebp@PageActionCode{/AA << + \ifaeb@PageOpen\@aebOpen\space\fi + \ifaeb@PageClose\@aebClose\space\fi >>} +% \end{macrocode} +% For page 1, the open page is handled by \textsf{insdljs} +% \changes{v2.0a}{2016/05/11}{Let \string\textsf{insdljs} handle page open +% for page 1.} +% \begin{macrocode} + \ifnum\value{page}=1\relax\else + \ifpdfmarkup\literalps@out{\AEB@psMrk{#1} << + \aebp@PageActionCode\space >> /PUT pdfmark}\else + \ifpdf\global\pdfpageattr=\expandafter + {\aebp@PageActionCode}\else + \ifxetex\@pdfm@mark{put @thispage << + \aebp@PageActionCode\space>>}\fi\fi\fi + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atPage} +% \cs{atPage} is a modification of \cs{pageref}, so its value will always be an integer. +% returned in the token register \cs{aeb@parsetoks}. Used in the arguments of such environments +% as \texttt{addJSToPageOpenAt} and \texttt{addJSToPageCloseAt}. +% \begin{macrocode} +\def\aeb@exiii{\expandafter\expandafter\expandafter} +\let\ahrefexafter\aeb@exiii +\def\atPage#1{\@ifundefined{r@#1}{1} + {\aeb@exiii\@secondoffive\csname r@#1\endcsname}} +\def\labelRef#1{\@ifundefined{r@#1}{Doc-Start} + {\aeb@exiii\@fourthoffive\csname r@#1\endcsname}} +% \end{macrocode} +% \end{macro} +% The command \cs{aebp@rse} parses such arguments as +%\begin{verbatim} +% {1,3,4-6,8-12,15,\atPage{firstlabel}-\atPage{secondlabel},30-} +%\end{verbatim} +% The expanded list is returned in the token register \cs{aeb@parsetoks}. +% \begin{macrocode} +\newtoks\aeb@parsetoks +\newcount\aeb@parsecnt +\def\ap@gobtonil#1\@nil{} +\def\ap@gettonil#1\@nil{\def\to@nilarg{#1}} +\def\ap@ifspc{\ifx\@let@token\@sptoken + \let\ap@next\ap@xifspc\else + \let\ap@next\ap@gettonil\fi\ap@next} +\begingroup +\def\:{\ap@xifspc} +\expandafter\gdef\: {\futurelet\@let@token\ap@ifspc} +\endgroup +% \end{macrocode} +% \cmd{\ap@strpspcs} strips any spaces, usage: \verb~\expandafter\ap@strpspcs\cmd\@nil~ +% where \cs{cmd} is a command that expands to text; the text is returned in \cs{to@nilarg} +% without any leading spaces. +% \begin{macrocode} +\def\ap@strpspcs{\futurelet\@let@token\ap@ifspc} +\def\ap@pgrngLabelsInPream{\@ifundefined{aebLastPage} + {\PackageWarning{aeb_pro}{The \string\atPage\space + command is not supported\MessageBreak in the preamble}}{}} +\def\aeb@removelastcomma#1,\@nil{\aeb@parsetoks={#1}} +\def\aebp@rse#1{\global\let\frstPageSpec\aebp@NO + \aeb@parsetoks={}\aeb@parse#1,\relax} +\def\aeb@parse{\@ifnextchar\relax + {\expandafter\aeb@removelastcomma\the\aeb@parsetoks\@nil} + {\aeb@@parse}} +\def\aeb@@parse#1,{\aeb@@@parse#1-\@nil} +\def\aeb@@@parse#1-#2\@nil{% + \def\argi{#2}\ifx\argi\@empty\def\aeb@next{\aeb@@@@parse{#1}}\else + \def\aeb@next{\aeb@@@@@parse#1-#2}\fi\aeb@next} +\def\aeb@@@@parse#1{%single page #1 + \@ifnextchar\atPage{\ap@pgrngLabelsInPream\ap@gobtonil} + {\ap@gobtonil}#1\@nil + \aeb@parsecnt=#1\relax + \edef\edefaeb@parsetoks{\the\aeb@parsetoks\the\aeb@parsecnt,}% + \aeb@parsetoks=\expandafter{\edefaeb@parsetoks}% +% \end{macrocode} +%\changes{v1.7}{2015/06/17}{Use \cs{frstPageSpec}} +% The \cs{frstPageSpec} signals that page 1 is specified in the +% page specification argument. +% \begin{macrocode} + \ifnum\aeb@parsecnt=1\relax\global\let\frstPageSpec\aebp@YES\fi + \aeb@parse} +\def\aeb@@@@@parse#1-#2-{\def\aeb@lowerlimit{#1}\def\aeb@upperlimit{#2}% + % range argument from #1 to \csname aebLastPage\endcsname + \ifx\aeb@upperlimit\@empty + \@ifundefined{aebLastPage}{\aeb@parsecnt=#1} + {\expandafter\aeb@parsecnt\expandafter= + \csname aebLastPage\endcsname}% + \else % page range #1 to #2, switch the two if #2 < #1 + \aeb@parsecnt=\aeb@lowerlimit\relax + \edef\aeb@lowerlimit{\the\aeb@parsecnt} + \aeb@parsecnt=\aeb@upperlimit\relax + \ifnum\aeb@parsecnt<\aeb@lowerlimit\relax + \aeb@parsecnt=\aeb@lowerlimit\relax + \def\aeb@lowerlimit{#2}% + \def\aeb@upperlimit{#1}% + \fi + \fi + \@ifnextchar\atPage{\ap@pgrngLabelsInPream\ap@gobtonil} + {\ap@gobtonil}#1\@nil + \@ifnextchar\atPage{\ap@pgrngLabelsInPream\ap@gobtonil} + {\ap@gobtonil}#2\@nil + \advance\aeb@parsecnt1\relax + \edef\aeb@upperlimit{\the\aeb@parsecnt}% + \aeb@parsecnt=\aeb@lowerlimit\relax +% \end{macrocode} +%\changes{v1.7}{2015/06/17}{Use \cs{frstPageSpec}} +% If page 1 is there, is will be as the lower limit. +% The \cs{frstPageSpec} signals that page 1 is specified in the +% page specification argument. +% \begin{macrocode} + \ifnum\aeb@parsecnt=1\relax\global\let\frstPageSpec\aebp@YES\fi + \loop + \edef\edefaeb@parsetoks{\the\aeb@parsetoks\the\aeb@parsecnt,}% + \aeb@parsetoks=\expandafter{\edefaeb@parsetoks}% + \advance\aeb@parsecnt1\relax + \ifnum\aeb@parsecnt < \aeb@upperlimit\relax\repeat + \aeb@parse} +% \end{macrocode} +% \section{Set Document Actions} +% +% \begin{environment}{willClose} +% \begin{environment}{willSave} +% \begin{environment}{didSave} +% \begin{environment}{willPrint} +% \begin{environment}{didPrint} +% We add a \texttt{willClose} environment, not really meant for the document +% author to use. This environment is used with \cs{setDefaultFS} for saving +% setting and restoring the application preferences for full screen. +% \begin{macrocode} +\@ifpackageloaded{insdljs}{% + \newenvironment{fs@willClose} + {\@defineJS{\fs@will@Close}} + {\end@defineJS} + \let\fs@will@Close\@empty +}{% + \newenvironment{willClose} + {\@defineJS{\will@Close}} + {\end@defineJS} + \let\will@Close\@empty + \newenvironment{fs@willClose} + {\@defineJS{\fs@will@Close}} + {\end@defineJS} + \let\fs@will@Close\@empty + \newenvironment{willSave} + {\@defineJS{\will@Save}} + {\end@defineJS} + \let\will@Save\@empty + \newenvironment{didSave} + {\@defineJS{\did@Save}} + {\end@defineJS} + \let\did@Save\@empty + \newenvironment{willPrint} + {\@defineJS{\will@Print}} + {\end@defineJS} + \let\will@Print\@empty + \newenvironment{didPrint} + {\@defineJS{\did@Print}} + {\end@defineJS} + \let\did@Print\@empty +} +% \end{macrocode} +% \end{environment} +% \end{environment} +% \end{environment} +% \end{environment} +% \end{environment} +% In addition to the provided environments, there are developer hooks, the package developer +% can use to insert page actions, in addition to what the package user may do. +% Now put the \texttt{willClose} JS into the document \texttt{Catalog}. The developer's +% actions will possibly overwrite that of the user; under the theory that the developer's +% actions are critical to the functioning of the package. The hooks are +% \begin{macrocode} +\let\developer@will@Close\@empty +\let\developer@will@Save\@empty +\let\developer@did@Save\@empty +\let\developer@will@Print\@empty +\let\developer@did@Print\@empty +% \end{macrocode} +%\changes{v0.8g}{2008/06/30} +%{ +% Added developer hooks to this open page events. +%} +%\changes{v2.1}{2016/05/15}{Changes to \string\cs{@setDocAction} for non-Distiller workflows.} +% (2016/05/15) modify to include non-Distiller workflows. +% \begin{macrocode} +\newcommand\@setDocActions{% + \edef\test@will@Close{% + \fs@will@Close\will@Close\developer@will@Close}% + \edef\test@will@Save{\will@Save\developer@will@Save}% + \edef\test@did@Save{\did@Save\developer@did@Save}% + \edef\test@will@Print{\will@Print\developer@will@Print}% + \edef\test@did@Print{\did@Print\developer@did@Print}% + \def\aebp@DocActionsCode{/AA << % + \ifx\test@will@Close\@empty\else/WC << + \JS{\fs@will@Close\will@Close\developer@will@Close} >>\fi + \ifx\test@will@Save\@empty\else/WS << + \JS{\will@Save\developer@will@Save} >>\fi + \ifx\test@did@Save\@empty\else/DS << + \JS{\did@Save\developer@did@Save} >>\fi + \ifx\test@will@Print\@empty\else/WP << + \JS{\will@Print\developer@will@Print} >>\fi + \ifx\test@did@Print\@empty\else/DP << + \JS{\did@Print\developer@did@Print} >>\fi + >> + } + \ifpdfmarkup\literalps@out{\AEB@psMrk{Catalog} + << \aebp@DocActionsCode\space>> /PUT pdfmark}\else + \ifpdf\pdfcatalog{\aebp@DocActionsCode}\else + \ifxetex\immediate + \@pdfm@mark{put @catalog <<\aebp@DocActionsCode\space>>}\fi + \fi\fi +} +\AtBeginDocument{\@setDocActions} +% \end{macrocode} +% +% \section{In support of attachments} +% +% \subsection{Processing the \texttt{attachsource} and \texttt{attachments} key} +% +% If the value of either the \texttt{\texttt{attachsource}} or +% \texttt{attachments} keys are non empty, the values are contained +% in the macros \cs{aeb@attachsource} and \cs{aeb@attachments}. If +% either of these text macros is different from \cs{empty}, we need +% to write out a cut file that lists the requested attachments, then +% input the cut file back in at the end of the package. +% \begin{macro}{\aref} +% This command, whose argument is \textit{delimited by parentheses}, +% is to be used with \cs{inputDataObject}, defined below, to expand +% the value of the \texttt{cName} key, when the label is defined by +% \cs{labelName}. It is also used by this package to set the +% description of the attachment. +% \begin{macrocode} +\def\aref(#1){\csname aeb@aDescript@#1\endcsname} +% \end{macrocode} +% \end{macro} +% The next command \cs{aeb@initAttachWrite} we prepare to write by opening a stream, and +% starting the \texttt{execJS} environment, but only if we have an attachment request. +% \begin{macrocode} +\def\aeb@initAttachWrite{% + \newwrite \aeb@attachmentswrite + \immediate\openout \aeb@attachmentswrite \jobname_attach.cut + \let\verbatim@out\aeb@attachmentswrite + \aeb@IWVO{\string\begin{execJS}{aebpro_attach}}% + {\lccode`P=`\{\lowercase{\aeb@IWVO{try P}}}% +} +% \end{macrocode} +% \changes{v1.4}{2013/02/24}{Support for optional attachments} +% \paragraph{Optional attachments.} Support for optional attachments. +% \begin{macro}{\prjInputUser} +% \begin{macro}{\prjIncludeUser} +% \begin{macro}{\addtoOptAttachments} +% User interface to project for \cs{input} and \cs{include}. These commands +% may be redefined, but they need to include the appropriate input/include +% command in them. The \cs{addtoOptAttachments} command is a way of optionally +% attaching a file without the input. +% \begin{macrocode} +\newcommand{\prjInputUser}[1]{\input{#1}} +\newcommand{\prjIncludeUser}[1]{\include{#1}} +\newcommand{\addtoOptAttachments}[1]{% + \g@addto@macro\AP@addtoAttachments{,#1}} +\newcommand{\getcNameFromFileName}[1]{\@nameuse{descrip4#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% The main code for optional attachments. +% \begin{macrocode} +\def\AP@addtoAttachments{} +% \end{macrocode} +% The attachments are listing in a comma-delimited list. If there is a space following a comma, it may appear +% as part of the path of the next attachment. So, we'll get JavaScript to strip away any leading spaces to +% avoid the need to instruct the user to insert a \texttt{\%} if the attachment list is on multiple lines. +% \begin{macrocode} +\def\jsstrsps{replace(/^\string\s*/, "")} +\def\jsstrdotsp{replace(/\string\.\string\s*/g, ".")} +\ifoptattachments + \def\AP@writeOptAttach{% + \newwrite\AP@OptAttachlist + \immediate\openout \AP@OptAttachlist \jobname_oa.cut +% \end{macrocode} +% Define the optional attachments list command, |\APOptAttachments|. +% \begin{macrocode} + \immediate\write\AP@OptAttachlist{\string\def\string + \APOptAttachments{\AP@addtoAttachments}} + \immediate\closeout\AP@OptAttachlist} +% \end{macrocode} +% Write the optional attachments list (|\APOptAttachments|) at the end of the document. +% \begin{macrocode} + \AtEndDocument{\AP@writeOptAttach} +% \def\AP@addtoAttachments{} + \def\AP@pathInput#1{% + \addtoOptAttachments{#1}\prjInputUser{#1}} + \def\AP@pathInclude#1{% + \addtoOptAttachments{#1.tex}\prjIncludeUser{#1}} +% \end{macrocode} +% Input the optional attachments list (|\APOptAttachments|) here. +% \begin{macrocode} + \InputIfFileExists{\jobname_oa.cut}{% + \def\AP@next{\edef\aeb@attachments + {\aeb@attachments\APOptAttachments}}% + }{\let\AP@next\relax} + \AP@next +\else +% \end{macrocode} +% When \texttt{!optattachments} is taken, we use the user commands \cs{prjInputUser} and +% \cs{prjIncludeUser} versions. +% \begin{macrocode} + \def\AP@pathInput#1{\prjInputUser{#1}} + \def\AP@pathInclude#1{\prjIncludeUser{#1}} +\fi +% \end{macrocode} +% \DescribeMacro{\prjinput}\DescribeMacro{\prjinclude}These are the main +% commands for inputting project files where the files themselves are optionally +% attached. +% \begin{macrocode} +\ifoptattachmentsTaken + \def\prjinput{\hyper@normalise\AP@pathInput} + \def\prjinclude{\hyper@normalise\AP@pathInclude} +% \end{macrocode} +% The \cs{include} command makes the following comparison. +%\begin{verbatim} +% \@for\reserved@a:=\@partlist\do +% {\ifx\reserved@a\reserved@b\@tempswatrue\fi}% +%\end{verbatim} +% The elements from \cs{@parlist} they come from the \cs{includeonly} command. +% The argument of \cs{include} has been normalized using \cs{hyper@normalise} but +% the filenames listed in \cs{includeonly} have not. So the comparison can fail. +% We normalize the file list as well. +% +% When the \texttt{optattachments} is present in the option list, +% the definition of \cs{optattachmentsTaken} is \cs{relax}, hence, +% the redefinition occurs. +% \begin{macrocode} + \let\AP@includeonly\includeonly + \def\includeonly{\hyper@normalise\AP@includeonly} +\else + \def\prjinput{\prjInputUser} + \def\prjinclude{\prjIncludeUser} +\fi +% \end{macrocode} +% \paragraph*{Attaching files.} +% If either the two attachments keys is used, then we execute \cs{aeb@initAttachWrite}. +% \begin{macrocode} +\ifx\aeb@attachsource\@empty + \ifx\aeb@attachments\@empty + \else\aeb@initAttachWrite\fi +\else + \@ifundefined{aeb@attachmentswrite} + {\aeb@initAttachWrite}{} +\fi +% \end{macrocode} +% If \cs{aeb@attachsource} is non empty, go through the comma delimited list, and write to the +% cut file we just opened. +% +%\changes{v0.8i}{2008/10/08}{% +% Beginning with version 7.05, there is a \texttt{description} property. +% Prior to that, the value of \texttt{cname} was used for the description. +% I've added an additional line that sets the description equal to +% \texttt{cname} for 7.05 or later. +%} +%\changes{v1.4d}{2014/02/24}{% +% Within this and the next \cs{@for} look, added a test for the empty +% argument. +%} +% Some commands for setting \texttt{cName} and description. +% \begin{macrocode} +\def\ap@cName(#1){\csname aeb@aName@attach#1\endcsname} +\def\ap@cNamexdef(#1){\expandafter + \xdef\csname aeb@aName@attach#1\endcsname} +\def\ap@cDescript(#1){\csname aeb@aDescript@attach#1\endcsname} +\def\ap@cDescriptSource(#1){\csname aeb@aDescript@#1\endcsname} +\def\ap@cDescriptxdef(#1){\expandafter + \xdef\csname aeb@aDescript@attach#1\endcsname} +\def\ap@cDescriptSourcexdef(#1){\expandafter + \xdef\csname aeb@aDescript@#1\endcsname} +% \end{macrocode} +% We now process the list from the \texttt{attachsource} key. +% \begin{macrocode} +\ifx\aeb@attachsource\@empty\else + \edef\temp@expand{\noexpand\@for\noexpand\@@tmp:=\aeb@attachsource} + \temp@expand\do{% + \ifx\@@tmp\@empty\else + \expandafter\ap@strpspcs\@@tmp\@nil\edef\@@tmp{\to@nilarg}% + \ap@cDescriptSourcexdef(\@@tmp){\jobname.\@@tmp}% + \aeb@IWVO{\space\space\space\space + var retn=\string\importDataObject({% +% \end{macrocode} +% \changes{v1.7}{2015/07/01}{Changed cName from \cs{jobname.\cs{@@tmp}} to +% just \cs{@@tmp}} +% (2015/07/01) Changed cName from \cs{jobname.}\cs{@@tmp} to +% just \cs{@@tmp}. +% \begin{macrocode} + cName: "\@@tmp", + cDIPath: "\jobname.\@@tmp".\jsstrdotsp});}% + \aeb@IWVO{\space\space\space\space + if ( (app.viewerVersion>7) && retn ) +% \end{macrocode} +% \changes{v1.7}{2015/07/01}{Changed \texttt{"\cs{jobname.\cs{@@tmp}}"} to +% just \texttt{"\cs{@@tmp}"}} +% (2015/07/01) Changed \texttt{"\cs{jobname.\cs{@@tmp}}"} to +% just \texttt{"\cs{@@tmp}"} within argument of \texttt{this.getDataObject}. +% \begin{macrocode} + this.getDataObject("\@@tmp").description=% + "\string\ap@cDescriptSource(\@@tmp)".\jsstrdotsp;}% + \expandafter + \edef\csname aeb@aName@\@@tmp\endcsname{\jobname.\@@tmp}% + \fi + }% +\fi +% \end{macrocode} +% Similarly, if \cs{aeb@attachments} is non empty, go through the comma delimited list, and write to the +% cut file we just opened. +% \begin{macrocode} +\ifx\aeb@attachments\@empty\else +\typeout{\string\aeb@attachments: \aeb@attachments}% + \aeb@parsecnt=0 + \edef\temp@expand{\noexpand\@for\noexpand\@@tmp:=\aeb@attachments} + \temp@expand\do + {% + \ifx\@@tmp\@empty\else + \expandafter\ap@strpspcs\@@tmp\@nil\edef\@@tmp{\to@nilarg}% + \advance\aeb@parsecnt1\relax +% \end{macrocode} +% Set default definitions of the name and description +% \begin{macrocode} + \ap@cNamexdef(\the\aeb@parsecnt){attach\the\aeb@parsecnt}% + \ap@cDescriptxdef(\the\aeb@parsecnt)% + {AeB Attachment \the\aeb@parsecnt}% + \aeb@IWVO{\space\space\space\space + var retn=\string\importDataObject({% +% \end{macrocode} +%\changes{v1.7}{2015/07/01}{Remove \cs{aref} in \texttt{cName}} +% (2015/07/01) Remove \cs{aref} in \texttt{cName} +% \begin{macrocode} + cName:"\string\ap@cName(\the\aeb@parsecnt)",% + cDIPath: "\@@tmp".\jsstrsps});}% + \aeb@IWVO{\space\space\space\space + if ( (app.viewerVersion>7) && retn ) +% \end{macrocode} +%\changes{v1.7}{2015/07/01}{Remove \cs{aref} in first argument} +% (2015/07/01) Remove \cs{aref} in first argument +% \begin{macrocode} + this.getDataObject(% + "\string\ap@cName(\the\aeb@parsecnt)").description=% + "\string\ap@cDescript(\the\aeb@parsecnt)";}% + \expandafter +% \end{macrocode} +% We associate the filename (path) with the label \texttt{cName}. This makes it convenient +% to reference an attachment. We can say |\@usenname{descrip4}|. Also defined +% a convenience command \cs{getcNameFromFileName} for that purpose; for example, +% |\getcNameFromFileName{}|. +% \begin{macrocode} + \expandafter\xdef\csname descrip4\@@tmp\endcsname + {\noexpand\ap@cName(\the\aeb@parsecnt)}% + \fi + } +\fi +% \end{macrocode} +% Now, if \cs{aeb@attachmentswrite} is defined, which means we have attachments and we opened a stream, +% we'll close off the environment, and close the file. +% \begin{macrocode} +\@ifundefined{aeb@attachmentswrite}{} +{% + {\lccode`P=`\}\def\jsMsg{"Attachments error: " + + e.toString()}\lowercase{\aeb@IWVO{P catch(e) + { console.println( \jsMsg\space); }}}}% + \aeb@IWVO{\string\end{execJS}} + \immediate\closeout \aeb@attachmentswrite +} +% \end{macrocode} +% Create a little macro to input the file \cs{jobname\_attach.cut} at the end of the package. +% \begin{macrocode} +\def\aeb@inputAttachments{\@ifundefined{aeb@attachmentswrite}{} + {\InputIfFileExists{\jobname_attach.cut}% + {\typeout{Inputting attachments file}}% + {\typeout{Cannot find attachments file}}}% +} +% \end{macrocode} +% \subsection{Creating a PDF Package} +% Beginning with Version 8, there is a special "Package" interface to access attachments. +% The commands in this section support creating a PDF Package using the specified attachments. +% +% The \texttt{viewmode}\IndexKey{viewmode} has values of \texttt{details}, +% \texttt{tile}, \texttt{layout}, and \texttt{hidden}. +% \begin{macrocode} +\define@choicekey+{aebpdfpack}{viewmode}[\val\nr]% + {details,tile,layout,hidden}{% + \ifcase\nr\relax + \def\aeb@pdfpack@viewmode{/D}\or + \def\aeb@pdfpack@viewmode{/T}\or + \def\aeb@pdfpack@viewmode{/T}\or + \def\aeb@pdfpack@viewmode{/H}\fi +}{} +% \end{macrocode} +% The \texttt{initview}\IndexKey{initview} of the package. The value of \texttt{initview} +% is a label name of one of the attached files. +% \begin{macrocode} +\define@key{aebpdfpack}{initview}[]{\def\aeb@pdfpack@initview{#1}} +\let\aeb@pdfpack@initview\@empty +% \end{macrocode} +% \begin{macro}{\earlyAttachForPkgs} +% Use this command to package the attachments to the parent document. +% \begin{macrocode} +\newcommand{\earlyAttachForPkgs}{% +% \end{macrocode} +%\changes{v1.7}{2015/07/11}{Added \string\texttt{CollectionPreview} menu item to assure the Hidden view +% is displayed.} +% (2015/07/11) Recent versions of \textsf{Acrobat DC} seem not to support the Hidden view. There is no +% difference between Hidden and Tiles, so we use \texttt{'CollectionPreview'} +% menu item to force the viewer into Preview mode, which I'm assuming is the same +% as Hidden mode. +% \begin{macrocode} +if (this.collection!=null&&this.collection.initialView == "Hidden") +var hideto=app.setTimeOut("app.clearTimeOut(hideto);" + +"app.execMenuItem('CollectionPreview');",1); +\if@gopro +if(typeof _aebpro_attach == "undefined") +( app.viewerVersion > 8 ) ? % +aebTrustedFunctions(this,aebImportAnFDF,"aebpro_attach.fdf") : % +this.importAnFDF("aebpro_attach.fdf");\fi +% \end{macrocode} +% For Version XI (or prior), there seems to be a bug. When +% no initial view is specified, the cover sheet should be displayed. It is +% but is disappears after a moment in favor of the first listed attachment +% in the package. To compensate for this, we force the Cover Sheet to appear +% after 2 seconds (trial and error value). +% \begin{macrocode} +\ifisPDFPackage\ifx\aeb@pdfpack@initview\@empty^^J% +if(app.viewerVersion<15)^^J% +var pkto=app.setTimeOut("app.clearTimeOut(pkto);" ++"app.execMenuItem('CollectionShowRoot');",5000);\fi\fi} +% \end{macrocode} +% \changes{v1.7k}{2015/08/05}{Added a \cs{ifisPDFPackage} switch} +% (2015/08/05) Added a \cs{ifisPDFPackage} switch. +% \changes{v2.1}{2016/05/15}{Finalized changes in \string\cs{makePDFPackage} to accommodate +% non-Distiller workflows.} +% \begin{macrocode} +\newif\ifisPDFPackage\isPDFPackagefalse +\newcommand{\makePDFPackage}[1]{\isPDFPackagetrue + \setkeys{aebpdfpack}{viewmode=details,#1}% + \ifx\aeb@pdfpack@initview\@empty + \let\aeb@pdfpackage@initview\@empty + \else +% \end{macrocode} +% \changes{v1.7}{2015/07/01}{Removed \cs{aeb@exiii} and \cs{aref()}, +% replaced with \cs{expandafter} and argument.} +% (2015/07/01) Removed \cs{aeb@exiii} and \cs{aref()}, +% replaced with \cs{expandafter} and argument. +% \changes{v2.0}{2016/05/08}{Extend \string\cs{makePDFPackage} to include +% pdftex and xetex.} +% \begin{macrocode} + {\obeyspaces\sanitize@attach\gdef\aeb@pdfpackage@initview% +{/D<\expandafter\stringiiUnicode\aeb@pdfpack@initview\relax>}}% + \fi + \def\aeb@PDFPackageCode{/PageMode/UseAttachments% + /Collection<>}% + \ifpdfmarkup + \def\aeb@setPDFPackage{\literalps@out{\AEB@psMrk{Catalog} + <<\aeb@PDFPackageCode>>/PUT pdfmark}}% + \else\ifpdf\def\aeb@setPDFPackage{% + \pdfcatalog{\aeb@PDFPackageCode}}\else + \ifxetex\def\aeb@setPDFPackage{\immediate + \@pdfm@mark{put @catalog <<\aeb@PDFPackageCode>>}}\else + \let\aeb@setPDFPackage\relax\PackageWarning{aeb_pro} + {The \string\makePDFPackage/string\makePDFPortfolio\space + is supported for\MessageBreak + dvips, pdftex, and xetex only}\fi\fi\fi +} +% \end{macrocode} +% \DescribeMacro{\makePDFPortfolio} is an alias for \cs{makePDFPackage}. The accepted +% name for a PDF Package is now a PDF Portfolio. +% \begin{macrocode} +\let\makePDFPortfolio\makePDFPackage +\@onlypreamble\makePDFPackage +% \end{macrocode} +% We check to see if there are any attachments, if there are, we'll +% import them early; useful for \cs{makePDFPackage} and for open events +% that cause the view to display a page other than the first one on opening. +% \begin{macrocode} +\let\aebp@attachments\aebp@Zero +\ifx\aeb@attachsource\@empty\else\let\aebp@attachments\aebp@One\fi +\ifx\aeb@attachments\@empty\else\let\aebp@attachments\aebp@One\fi +\ifx\aebp@attachments\aebp@One + \dev@addToDocOpen{\JS{\earlyAttachForPkgs}}% +\fi +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +% End of aebpro segment +% +%<*package> +\AtEndOfPackage{\@nameuse{aeb@inputAttachments}} +\AtBeginDocument{\@nameuse{aeb@setPDFPackage}} +\@ifpackageloaded{web}{} + {\def\aebwritelastpage{% + \immediate\write\@auxout{\string\expandafter\string\gdef + \string\csname\space aebLastPage\string\endcsname{\arabic{page}}}} + \AtEndDocument{\clearpage\addtocounter{page}{-1}\aebwritelastpage + \addtocounter{page}{1}}% +} +% End of package segment +% +%<*unicode> +% \end{macrocode} +% \section{Support for linking to attachments.} +% +% \subsection{\texorpdfstring{\cs{ahyperref}, \cs{ahyperlink}, \cs{ahyperextract}} +% {\CMD{ahyperref}, \CMD{ahyperlink}, \CMD{ahyperextract}}} +% +% The \cs{ahyperref} command is for linking between parent and child, or +% between child and child. \cs{ahyperref} takes three arguments, the first optional +% and the second two required. +%\begin{verbatim} +% \ahyperref[]{ +% \end{macrocode} +% \Finale +\endinput -- cgit v1.2.3