%\iffalse %<*copyright> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% aeb_pro.sty package, 2006-9-08 %% %% Copyright (C) 2006 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 of the %% %% License, or (at your option) any later version. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %\NeedsTeXFormat{LaTeX2e}[1997/12/01] %\ProvidesPackage{aeb_pro} % [2007/04/25 v0.8a aeb_pro: A support package (dps)] %<*driver> \documentclass{ltxdoc} \usepackage[dviwindo,colorlinks,hyperindex]{hyperref} %\pdfstringdefDisableCommands{\let\\\textbackslash} %\EnableCrossrefs \CodelineIndex \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 \let\Email\texttt \DocInput{aeb_pro.dtx} \PrintIndex \end{document} % % \fi % \MakeShortVerb{|} % \StopEventually{} % % \DoNotIndex{\def,\edef,\gdef,\xdef,\global,\long,\let} % \DoNotIndex{\expandafter,\string,\the,\ifx,\else,\fi} % \DoNotIndex{\csname,\endcsname,\relax,\begingroup,\endgroup} % \DoNotIndex{\DeclareTextCommand,\DeclareTextCompositeCommand} % \DoNotIndex{\space,\@empty,\special} % % \begin{macrocode} %<*package> % \end{macrocode} % \section{Introduction} % % The \texttt{aeb\_pro} package uses JavaScript methods and techniques % that require Acrobat~7.0 Professional for document assembly, and % assumes the PDF document is created using the Acrobat~7.0 distiller % application. It is also, what I call, the AeB Control Central. You can use % \texttt{aeb\_pro} to load all your Acro\negthinspace\TeX packages in the correct order. If you don't use % Acrobat Pro and distiller, then there is a \texttt{nopro} option, so you can still use the % AeB Control Central feature, if you wish. % % \section{Declare Options} % \begin{macrocode} % \end{macrocode} % \begin{macrocode} \RequirePackage{xkeyval} % \end{macrocode} % \subsection{AeB Control Central} % \begin{macro}{web} % \begin{macro}{exerquiz} % \begin{macro}{dljslib} % \begin{macro}{eforms} % \begin{macro}{insdljs} % \begin{macro}{eq2db} % \begin{macro}{aebxmp} % \begin{macro}{hyperref} % AeB control central are 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 teach of these option keys are the options of the packages they reference. % \begin{macrocode} \@tfor\aeb@pcks:={web}{exerquiz}{dljslib}% {eforms}{insdljs}{eq2db}{aebxmp}{hyperref}\do {% \edef\aeb@pack@def{% \noexpand\define@key{aeb_pro.sty}{\aeb@pcks}[]% {% \expandafter\def\csname aeb@\aeb@pcks @opts\endcsname{##1}% \noexpand\PassOptionsToPackage{##1}{\aeb@pcks}% }% }\aeb@pack@def } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \begin{macro}{driver} % We provide a convenient way to pass the driver used, dvips or dvipsone. % If the user chooses the 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} \define@choicekey+{aeb_pro.sty}{driver}% {dvipsone,dvips,pdftex,dvipdfm,textures}{% \def\aeb@driver{#1}\ifx\aeb@driver\@empty\else \PassOptionsToPackage{#1}{web} \PassOptionsToPackage{#1}{exerquiz} \PassOptionsToPackage{#1}{hyperref} \PassOptionsToPackage{#1}{insdljs} \PassOptionsToPackage{#1}{eforms} \fi }{\PackageWarning{aeb}{Bad choice for the driver, permissible values are dvipsone and dvips. Try again}} \let\aeb@driver\@empty % \end{macrocode} % \end{macro} % \subsection{\texttt{uselayers} option} % \begin{macro}{uselayers} % The document author wishes to use Optional Content Groups, a.k.a., layers. % \begin{macrocode} \DeclareOptionX{uselayers}{\AtEndOfPackage{\aeb@InputAeBLayers}} \def\aeb@InputAeBLayers{\InputIfFileExists{aeblayers.def}% {\typeout{aeb_pro: Inputting code for uselayers option}}% {\typeout{aeb_pro: Cannot find aeblayers.def. Reinstall or refresh your file name database.}}} % \end{macrocode} % \end{macro} % \subsection{\texttt{nopro} option} % \begin{macro}{nopro} % The \texttt{pro} option for \textsf{aeb\_pro} will bring in all the code that would require the use of % the Distiller and Acrobat Pro, this is the default. The \texttt{nopro} cancels out the pro option. If the % author wants to use AeB Control Central feature only. % \begin{macrocode} % \DeclareOptionX{pro}{\AtEndOfPackage{\@inputAeBPro}} \def\aeb@InputAeBPro{\InputIfFileExists{aebpro.def}% {\typeout{aeb_pro: Inputting code for the pro option}}% {\typeout{aeb_pro: Cannot find aebpro.def. Reinstall or refresh your file name database, as needed.}}} \AtEndOfPackage{\aeb@InputAeBPro} \DeclareOptionX{nopro}{% \let\aeb@InputAeBPro\@empty \PackageWarningNoLine{aeb_pro}{% The nopro option was taken.\MessageBreak Page and document events, fullscreen\MessageBreak and attachments are not available.\MessageBreak If you wish some of these features,\MessageBreak remove the nopro option}% } % \end{macrocode} % \end{macro} % \subsection{\texttt{gopro} option} % \begin{macro}{gopro} % Some of the components of AeB have the pro option. Use \texttt{gopro} to % pass the \texttt{pro} option to all components that take it. % \begin{macrocode} \DeclareOptionX{gopro}{\PassOptionsToPackage{pro}{web}} % \end{macrocode} % \end{macro} % \subsection{\texttt{attachsource} option} % \begin{macro}{attachsource} % A simple interface to attaching the source file(s) of \cs{jobname}. % \begin{macrocode} \DeclareOptionX{attachsource}{\def\aeb@attachsource{#1}} \let\aeb@attachsource\@empty % \end{macrocode} % \end{macro} % \subsection{\texttt{attachments} option} % \begin{macro}{attachments} % 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} % \end{macro} % \subsection{\texttt{linktoattachments} and \texttt{latin1} option} % \begin{macro}{linktoattachments} % \begin{macro}{latin1} % A general routine for linking to attached PDF files. The latin1 option % is only available if you take the \texttt{linktoattachments} options. % \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 \def\aeb@InputUnicodesi{\InputIfFileExists{unicodes1.def}% {\typeout{aeb_pro: Inputting code for the latin1 option}}% {\typeout{aeb_pro: Cannot find unicodes1.def. Reinstall or refresh your file name database, as needed.}}} \DeclareOptionX{linktoattachments}{% \let\aeb@InputUnicodes\@aeb@InputUnicodes \AtEndOfPackage{\aeb@InputUnicodes}% } \DeclareOptionX{latin1}{% \AtEndOfPackage{% \ifx\aeb@InputUnicodes\@empy\else \aeb@InputUnicodesi\fi }} \DeclareOptionX{childof}{% \def\aeb@childof{#1}% \AtEndOfPackage{\InputIfFileExists{\aeb@childof_xref.cut}{}{}}% } \let\aeb@childof\@empty % \end{macrocode} % \end{macro} % \end{macro} % \begin{macrocode} \ProcessOptionsX % \end{macrocode} % Check for correct driver if the pro option is still in effect. % \begin{macrocode} \let\aeb@continue\relax \ifx\aeb@InputAeBPro\@empty \else \ifx\aeb@driver\@empty % no driver specified \else \def\aeb@testdriver{dvips}% \ifx\aeb@testdriver\aeb@driver % ok to continue \else \def\aeb@testdriver{dvipsone}% \ifx\aeb@testdriver\aeb@driver % ok to continue \else \PackageError{aeb_pro}{% You have not specified the dvips or dvipsone driver.% \MessageBreak The pro option requires one of these two drivers }{% Specify dvips or dvipsone as the value of the driver key\MessageBreak or specify the nopro option }% \let\aeb@continue\endinput \fi \fi \fi \fi \aeb@continue % \end{macrocode} % \section{Package requirements} % AeB builds on the \textsf{web} package to a certain extent, hence requires \textsf{insdljs}. % \begin{macrocode} \@ifpackageloaded{web}{} {% \def\getargs#1#2{\def\aeb@argi{#1}\def\aeb@argii{#2}} \@ifundefined{aeb@web@opts}{} {\RequirePackage{web}}% } \@ifpackageloaded{exerquiz}{} {% \@ifundefined{aeb@exerquiz@opts}{} {\RequirePackage{exerquiz}}% } \@ifpackageloaded{hyperref}{} {% \@ifundefined{aeb@hyperref@opts}{} {\usepackage{hyperref}}% } \@ifpackageloaded{eq2db}{} {% \@ifundefined{aeb@eq2db@opts}{} {\RequirePackage{eq2db}}% } \@ifpackageloaded{dljslib}{} {% \@ifundefined{aeb@dljslib@opts}{} {\RequirePackage{dljslib}}% } \@ifpackageloaded{insdljs}{\let\execjs=y} {% \RequirePackage[execJS]{insdljs}% } \@ifpackageloaded{eforms}{\let\execjs=y} {% \@ifundefined{aeb@eforms@opts}{} {\RequirePackage[execJS]{eforms}}% } \@ifpackageloaded{aebxmp}{} {% \@ifundefined{aeb@aebxmp@opts}{} {\RequirePackage{aebxmp}}% } \let\execjs=y \RequirePackage{comment} \RequirePackage{calc} \RequirePackage{eso-pic} % \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} % \begin{macrocode} % %<*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.getOCGOrder(); 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. % \begin{macrocode} \newsavebox{\aebsavehelp} \newcommand{\texHelpIndicator}[1]{#1\thinspace${}^{\mbox {\footnotesize\negthinspace\ding{109}}\raisebox{.225ex} {\llap{\color{webblue}\tiny?\hspace{1.3ex}}}}$} \newcommand{\texHelp}[2]{% \sbox{\aebsavehelp}{\texHelpIndicator{#2}}% \makebox[0pt][l]{\pushButton[\S{S}\BG{}\BC{}\H{N} \AA{\AAMouseEnter{\JS{toggleHelp("#1")}}% \AAMouseExit{\JS{toggleHelp("#1");}}}]{#1}{\wd\aebsavehelp}{11bp}}% \usebox{\aebsavehelp}% } \newcommand{\pdfHelpIndicator}[1]{#1\thinspace${}^{\mbox {\footnotesize\negthinspace\ding{109}}% \raisebox{.225ex}{\llap{\color{webblue}\tiny?\hspace{1.3ex}}}}$} \newcommand{\pdfHelp}[3]{% \sbox{\aebsavehelp}{\pdfHelpIndicator{#3}}% \makebox[0pt][l]{\makespecialJS\pushButton[\S{S}\BG{}\BC{}\H{N} \TU{#2}]{#1}{\wd\aebsavehelp}{11bp}}\usebox{\aebsavehelp}% } \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} \newcommand{\xBld}[2][false]{\b@OC[#1]{xb.#2}} \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} % \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. % \begin{macrocode} \long\def\defineRC#1#2{\expandafter\def\csname RC#1\endcsname{#2}} \def\insertRC#1{\csname RC#1\endcsname} % \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}{} \ifeqforpaper \ifeq@proofing \includecomment{rollover} \includecomment{printRollover} \let\definePR\defineRC \long\def\definePR#1#2{% \expandafter\def\csname PR#1\endcsname{#2}} \def\insertPR#1{\csname PR#1\endcsname \expandafter\let\csname PR#1\endcsname\relax} \else \includecomment{printRollover} \excludecomment{rollover} \let\definePR\defineRC \long\def\definePR#1#2{% \expandafter\def\csname PR#1\endcsname{#2}} \def\insertPR#1{\csname PR#1\endcsname \expandafter\let\csname PR#1\endcsname\relax} \fi \else \ifeq@proofing \includecomment{rollover} \includecomment{printRollover} \let\definePR\defineRC \long\def\definePR#1#2{% \expandafter\def\csname PR#1\endcsname{#2}} \def\insertPR#1{\csname PR#1\endcsname \expandafter\let\csname PR#1\endcsname\relax} \else \excludecomment{printRollover} \includecomment{rollover} \let\definePR\relax \let\insertPR\@gobble \fi \fi % \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} \def\texPrintHelp#1#2{% \ifeqforpaper \ifeq@proofing \texHelp{#1}{#2}\marginpar{#1}% \else #2% \fi \else \texHelp{#1}{#2}\ifeq@proofing\marginpar{#1}\fi \fi } % \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][false]{\stepcounter{ocSeq}% \xBld[#1]{\animBldName}} \newcounter{ocSeq} \newcommand{\DeclareAnime}[3] {% \setcounter{ocSeq}{0}% \gdef\animBaseName{#1}% \gdef\animSpeed{#2}% \gdef\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}\CA{Å}\TU{Reverse}#1\A{\JS{% aebAnimeLayersBackward(\animSpeed,\nFrames,"\animBaseName"); }}]{\animBaseName BtnBack}{#2}{#3}% } \newcommand{\clearAnimeBtn}[3][] {% \pushButton[\textFont{Wingdings}\CA{n}\TU{Clear}#1\A{\JS{% aebAnimeLayersClear(\animSpeed,\nFrames,"\animBaseName"); }}]{\animBaseName BtnClear}{#2}{#3}% } \newcommand{\forwardAnimeBtn}[3][] {% \pushButton[\textFont{Wingdings3}\CA{Æ}\TU{Graph It!}#1\A{\JS{% 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(); var aebAnimeTimeOutB = new Object(); var aebAnimeTimeOutC = new Object(); function aebAnimeLayersForward(animSpeed,nFrames,baseName) { var timeinterval = animSpeed; aebAnimeTimeOutF = app.setInterval("aebAnimeTimeOutF.count++;" + "if (aebAnimeTimeOutF.count > " + nFrames +" ) 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.start = 1; aebAnimeTimeOutF.count=0; } function aebAnimeLayersBackward(animSpeed,nFrames,baseName) { var timeinterval = animSpeed; aebAnimeTimeOutB = app.setInterval("aebAnimeTimeOutB.count++;\r" + "if (aebAnimeTimeOutB.count > "+nFrames+") 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.start = nFrames; aebAnimeTimeOutB.count=0; } function aebAnimeLayersClear(animSpeed,nFrames,baseName) { var timeinterval = animSpeed; aebAnimeTimeOutC = app.setInterval("aebAnimeTimeOutC.count++;\r" + "if (aebAnimeTimeOutC.count > "+nFrames+") app.clearInterval(aebAnimeTimeOutC);\r" + "else { getxBld('"+baseName+"\#'+(aebAnimeTimeOutC.start-aebAnimeTimeOutC.count+1)).state=false;}", timeinterval); aebAnimeTimeOutC.start = nFrames; aebAnimeTimeOutC.count=0; } \end{insDLJS} % \end{macrocode} % \begin{macrocode} % %<*aebpro> % \end{macrocode} % \section{Initial View} % Supported preferences are \texttt{HideToolbar}, \texttt{HideMenubar}, \texttt{FitWindow}, % \texttt{CenterWindow}, \texttt{DisplayDocTitle}, % \texttt{NonFullScreenPageMode} (\texttt{UseNone}, \texttt{UseOutlines}, \texttt{UseThumbs}, % \texttt{UseOC}, \texttt{UseAttachments}) % % \subsection{Window Options} % % \begin{macrocode} \@tfor\aeb@windowopts:={{fit}{FitWindow}}{{center}{CenterWindow}}% {{fullscreen}{FullScreen}}{{showtitle}{DisplayDocTitle}}\do {% \expandafter\getargs\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 \expandafter\let\csname aeb@windowopts\aeb@argii\endcsname\@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]{\setkeys{aebWindowOpts}{#1}} % \end{macrocode} % \end{macro} % \subsection{User Interface Options} % \begin{macrocode} \@tfor\aeb@uiopts:={{hidetoolbar}{HideToolbar}}{{hidemenubar}{HideMenubar}}% {{hidewindowui}{HideWindowUI}}\do {% \expandafter\getargs\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 \expandafter\let\csname aeb@uiopts\aeb@argii\endcsname\@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]{\setkeys{aebUIOpts}{#1}} % \end{macrocode} % \end{macro} % % \subsection{Layout and Magnification} % % \subsubsection{Navigation Tab (Page Mode)} % Supported keys %\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 keys 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} %\begin{verbatim} % Actual Size <> % Fit Page <> % Fit Width <> % Fit Height <> % Fit Visible <> % 25% <> %\end{verbatim} % \begin{macrocode} \define@choicekey+{aebLayoutMag}{mag}[\val\nr]% {ActualSize,FitPage,FitWidth,FitHeight,FitVisible}[FitPage]% {% \ifcase\nr\relax \def\aeb@layoutMagMag{/XYZ -32768 -32768 1.0}% \or \def\aeb@layoutMagMag{/Fit}% \or \def\aeb@layoutMagMag{/FitH -32768}% \or \def\aeb@layoutMagMag{/FitV -32768}% \or \def\aeb@layoutMagMag{/FitBH -32768}% \fi }{\edef\aeb@layoutMagMag{/XYZ -32768 -32768 \val\space 100 div}} \let\aeb@layoutMagMag\@empty % \end{macrocode} % \subsubsection{Open to page} % \begin{macrocode} \define@key{aebLayoutMag}{openatpage}[1]{\def\aeb@openatpageChoice{#1}% \def\aeb@layoutMagPage{Page#1}} \let\aeb@openatpageChoice\@empty \let\aeb@layoutMagPage\@empty % \end{macrocode} % \begin{macro}{\setInitLayout} % Set the User Interface options on the Initial View tab of the Document Properties dialog box. % \begin{macrocode} \newcommand{\setLayoutMag}[1]{\edef\temp@expand@sets{% \noexpand\setkeys{aebLayoutMag}{\ifx\aeb@openatpageChoice\@empty openatpage=1\else openatpage=\aeb@openatpageChoice\fi}}% \temp@expand@sets\setkeys{aebLayoutMag}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\DeclareInitView} % This command is the ultimate holder of the Initial View data. It has three keys % layoutmag, windowoptions and 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} % Additional Open action % \begin{macro}{\addtionalOpenAction} % \begin{macro}{\requiresVersion} % \begin{macro}{\alternateDocumentURL} % \begin{macro}{\requiredVersionMsg} % \begin{macro}{\requiredVersionMsgRedirect} % \begin{macro}{\afterRequirementPassedJS} % \cs{additionalOpenAction} can be used to add in additional action that is performed with the % document is opened. This is different from the actions that may be performed when the first page % is opened. In fact, this action is independent of what what page is initially opened. % % \cs{requiresVersion} can be used to put a version condition on viewing the document. \cs{requiresVersion} % uses \cs{additionalOpenAction}. If you want to combine several actions, including a version requirement % you''l have to use \cs{additionalOpenAction}. Usage: %\begin{verbatim} %\requiresVersion{7} %\end{verbatim} % \cs{requireVersionMsg} is the message that is displayed when the version condition is not met. % \begin{macrocode} \let\aeb@additionalOpenAction\@empty \newcommand{\addtionalOpenAction}[1]{% \def\aeb@additionalOpenAction{/Next {aebAdditionalOpenAction}}% \setLayoutMag{}% \literalps@out{[/_objdef {aebAdditionalOpenAction} /type/dict /OBJ pdfmark [ {aebAdditionalOpenAction} << #1 >> /PUT pdfmark}% } \newcommand{\requiresVersion}[1]{% \def\requiredVersionNumber{#1}\addtionalOpenAction{\JS{% if(app.viewerVersion < #1 ) { try { if (this.external) { app.alert("\aeb@requiredVersionMsgRedirect"); if (app.viewerVersion >= 7.0) app.launchURL("\aebAlternateDocumentURL"); else this.getURL("\aebAlternateDocumentURL",false); } else { app.alert("\aeb@requiredVersionMsg"); % waitToLoad=app.setTimeOut("app.clearInterval(waitToLoad);" % + "this.closeDoc(true);",250); this.closeDoc(true); } } catch(e) {}; } else { \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. The document is now closing.} \newcommand{\requiredVersionMsgRedirect}[1]{% \def\aeb@requiredVersionMsgRedirect{#1}} \requiredVersionMsgRedirect{% This document requires Adobe Reader or Acrobat, version \requiredVersionNumber\space or later. Redirecting browser to an alternate page.} \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} % Now let's put it all together. % \begin{macrocode} \def\aeb@SetCatalog{\literalps@out{% [ {Catalog} <>% \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 \ifx\aeb@layoutMagPage\@empty \ifx\aeb@layoutMagMag\@empty \else /OpenAction<>% \fi \else \ifx\aeb@layoutMagMag\@empty /OpenAction<>% \else /OpenAction<>% \fi \fi >> /PUT pdfmark}} \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} {Cannot find fsdef.js, please run aeb.ins again}} \makeatother } \@onlypreamble\setDefaultFS % \end{macrocode} % \end{macro} % % Definitions of key-values for supported transitions; these are set using the command % \cs{setDefaultFS}. % % \begin{macrocode} %\define@key{aebDefFS}{Trans}[]{% % \def\aeb@arg{#1}\ifx\aeb@arg\@empty % \let\aeb@fsTran=\@empty\else % \def\aeb@fsTran{app.fs.defaultTransition = "#1";^^J}\fi} %\let\aeb@fsTran=\@empty \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}} \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 \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 \define@boolkey{aebDefFS}{loop}[true]{% \def\aeb@fsLoop{app.fs.loop = #1;^^J}} \let\aeb@fsLoop=\@empty \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 \define@boolkey{aebDefFS}{escape}[true]{% \def\aeb@fsEscape{app.fs.escapeExits = #1;^^J}} \let\aeb@fsEscape=\@empty \define@boolkey{aebDefFS}{clickAdv}[true]{% \def\aeb@fsclickAdv{app.fs.clickAdvances = #1;^^J}} \let\aeb@fsclickAdv=\@empty \define@boolkey{aebDefFS}{fullscreen}[true]{% % \hypersetup{pdfpagemode=FullScreen} \def\aeb@windowoptsFullScreen{true}% % \def\aeb@fsFS{app.fs.isFullScreen = #1;^^J} } \let\aeb@fsFS=\@empty \define@boolkey{aebDefFS}{useTimer}[true]{% \def\aeb@fsuseTimer{app.fs.useTimer = #1;^^J}} \let\aeb@fsuseTimer=\@empty \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. % \begin{macrocode} \newcommand{\setPageTransition}[1]{% \begingroup \setkeys{aebTrans}{TransDur,Speed}% \setkeys{aebTrans}{#1}% \ifx\aeb@TranChoice\@empty\else \literalps@out{ [ {ThisPage} << \aeb@Page@Dur /Trans <<\aeb@Trans@Dur\aeb@TranChoice>> >> /PUT pdfmark}% \fi \endgroup } \newcommand{\setPageTransitionAt}[2]{% \begingroup \setkeys{aebTrans}{#2}% \ifx\aeb@TranChoice\@empty\else \expandafter\aebp@rse\expandafter{#1}% \edef\shakeandbake{% \noexpand\@for\noexpand\@mytoks:=\the\aeb@parsetoks}% \shakeandbake \do {% \literalps@out{ [ {Page\@mytoks} << \aeb@Page@Dur /Trans <<\aeb@Trans@Dur\aeb@TranChoice>> >> /PUT pdfmark}% }% \fi \endgroup } % \end{macrocode} % \end{macro} % 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 of duration of transition effect: Slow, Medium, 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} % \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} % \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} % %<*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 on of the defaults"); } \end{fs@willClose} % \end{macrocode} % \begin{macrocode} % %<*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} \newenvironment{everyPageClose}[1][] {\global\@everyPageClosetrue\@defineJS[#1]{\every@PageClose}} {\end@defineJS} \let\every@PageOpen\@empty \let\every@PageClose\@empty \newenvironment{addJSToPageOpen}[1][] {\@defineJS[#1]{\addJST@PageOpen}} {\end@defineJS \ifnum\value{page}=1\relax \gdef\myAddtoOpenJS{\OpenAction{\JS{\addJST@PageOpen}}}% \expandafter\aftergroup\expandafter\myAddtoOpenJS\fi } \newenvironment{addJSToPageOpenAt}[2][] {\@@defineJS[#1]{addJST@PageOpenAt}{#2}} {\end@@defineJS} \newenvironment{addJSToPageClose}[1][] {\@defineJS[#1]{\addJST@PageClose}} {\end@defineJS \ifnum\value{page}=1\relax \gdef\myAddtoCloseJS{% \gdef\@CloseAction{/C << \JS{\addJST@PageClose} >>}}% \expandafter\aftergroup\expandafter\myAddtoCloseJS\fi } \newenvironment{addJSToPageCloseAt}[2][] {\@@defineJS[#1]{addJST@PageCloseAt}{#2}} {\end@@defineJS} \let\addJST@PageOpen=\@empty \let\addJST@PageClose=\@empty % \end{macrocode} % \end{environment} % \end{environment} % \end{environment} % \end{environment} % \begin{macro}{\aeb@addToPageOpenCloseActions} % This command gets expanded by \cs{AddToShipoutPicture} for each page. Here we % define how our page actions are to be inserted. % \begin{macrocode} \def\aeb@addToPageOpenCloseActions{% \@ifundefined{addJST@PageOpenAt\the\c@page}% {\def\thisOpenPageActionAt{\@empty}}% {\def\thisOpenPageActionAt{% \csname addJST@PageOpenAt\the\c@page\endcsname}}% \@ifundefined{addJST@PageCloseAt\the\c@page}% {\gdef\thisClosePageActionAt{\@empty}}% {\gdef\thisClosePageActionAt{% \csname addJST@PageCloseAt\the\c@page\endcsname}}% \aebPageAction{\thisOpenPageActionAt\addJST@PageOpen}% {\thisClosePageActionAt\addJST@PageClose}% \global\let\addJST@PageOpen\@empty\global\let\addJST@PageClose\@empty } \AddToShipoutPicture{\aeb@addToPageOpenCloseActions} % \end{macrocode} % \end{macro} % \cs{@@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}% \expandafter\xdef\csname\argType\@mytoks\endcsname{\the\JStoks}% \else \edef\letsmakelet{\global\let\expandafter\noexpand\csname\argType\@mytoks\endcsname=\expandafter\noexpand\csname\argType\firsttok\endcsname}% \letsmakelet \fi \advance\aeb@parsecnt1 }% } % \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 use 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 my overwrite actions created by the \texttt{addJSTo...} % environments. See \cs{aeb@addToPageOpenCloseActions} for usage by this package. % \begin{macrocode} \newcommand\aebPageAction[3][ThisPage]{% \let\ispageactions=0\aeb@PageOpenfalse\aeb@PageOpenfalse \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% \literalps@out{[ {#1} << /AA << \ifaeb@PageOpen\@aebOpen\space\fi \ifaeb@PageClose\@aebClose\space\fi >> >> /PUT pdfmark}% \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\aeb@removelastcomma#1,\@nil{\aeb@parsetoks={#1}} \def\aebp@rse#1{\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 \aeb@parsecnt=#1 \edef\edefaeb@parsetoks{\the\aeb@parsetoks\the\aeb@parsecnt,}% \aeb@parsetoks=\expandafter{\edefaeb@parsetoks}% % \par \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 \edef\aeb@lowerlimit{\the\aeb@parsecnt} \aeb@parsecnt=\aeb@upperlimit \ifnum\aeb@parsecnt<\aeb@lowerlimit\relax \aeb@parsecnt=\aeb@lowerlimit \def\aeb@lowerlimit{#2}% \def\aeb@upperlimit{#1}% \fi \fi \advance\aeb@parsecnt1 \edef\aeb@upperlimit{\the\aeb@parsecnt}% \aeb@parsecnt=\aeb@lowerlimit \loop \edef\edefaeb@parsetoks{\the\aeb@parsetoks\the\aeb@parsecnt,}% \aeb@parsetoks=\expandafter{\edefaeb@parsetoks}% \advance\aeb@parsecnt1 \ifnum\aeb@parsecnt < \aeb@upperlimit\repeat % \par \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} \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} % Now put the \texttt{willClose} JS into the document \texttt{Catalog}. % \begin{macrocode} \newcommand\@setDocActions{\literalps@out{% [ {Catalog} << /AA << \ifx\will@Close\@empty\else/WC << /S/JavaScript/JS(\fs@will@Close\will@Close) >>\fi \ifx\will@Save\@empty\else/WS << /S/JavaScript/JS(\will@Save) >>\fi \ifx\did@Save\@empty\else/DS << /S/JavaScript/JS(\did@Save) >>\fi \ifx\will@Print\@empty\else/WP << /S/JavaScript/JS(\will@Print) >>\fi \ifx\did@Print\@empty\else/DP << /S/JavaScript/JS(\did@Print) >>\fi >> >> /PUT pdfmark}% } \AtBeginDocument{\@setDocActions} % \end{macrocode} % \section{In support of attachments} % % \subsection{Processing the \texttt{attachsource} and \texttt{attachments} key} % % If the value of either the attachsource or 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@aName@#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}{attachments}}% \aeb@IWVO{\string\begin{execJS}{\jobname_attach}}% {\lccode`P=`\{\lowercase{\aeb@IWVO{try P}}}% } % \end{macrocode} % If either the two attachments keys were used, 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. % % \begin{macrocode} \ifx\aeb@attachsource\@empty\else \edef\temp@expand{\noexpand\@for\noexpand\@@tmp:=\aeb@attachsource} \temp@expand\do {% \aeb@IWVO{\space\space\space\space\string\importDataObject({cName: "\jobname.\@@tmp", cDIPath: "\jobname.\@@tmp"});}% \expandafter\edef\csname aeb@aName@\@@tmp\endcsname{\jobname.\@@tmp} } \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. % % 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*/, "")} % \end{macrocode} % \begin{macrocode} \ifx\aeb@attachments\@empty\else \aeb@parsecnt=0 \edef\temp@expand{\noexpand\@for\noexpand\@@tmp:=\aeb@attachments} \temp@expand\do {% \advance\aeb@parsecnt1 \aeb@IWVO{\space\space\space\space\string\importDataObject({cName:"\string\aref(attach\the\aeb@parsecnt)", cDIPath: "\@@tmp".\jsstrsps});} \expandafter\xdef\csname aeb@aName@attach\the\aeb@parsecnt\endcsname{AeB Attachment \the\aeb@parsecnt} } \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. % % \begin{macrocode} \define@choicekey+{aebpdfpack}{viewmode}[\val\nr]{details,tile,hidden} {% \ifcase\nr\relax \def\aeb@pdfpack@viewmode{/D}% \or \def\aeb@pdfpack@viewmode{/T}% \or \def\aeb@pdfpack@viewmode{/H}% \fi }{} \define@key{aebpdfpack}{initview}[]{\def\aeb@pdfpack@initview{#1}} \let\aeb@pdfpack@initview\@empty % \end{macrocode} % \begin{macro}{\makePDFPackage} % Use this command to package the attachments to the parent document. % \begin{macrocode} \newcommand{\makePDFPackage}[1]{% \setkeys{aebpdfpack}{viewmode=details}% \setkeys{aebpdfpack}{#1}% \ifx\aeb@pdfpack@initview\@empty \let\aeb@pdfpackage@initview\@empty \else {\obeyspaces\sanitize@attach\gdef\aeb@pdfpackage@initview{/D<\aeb@exiii\stringiiUnicode\aref(\aeb@pdfpack@initview)\relax>}}% \fi \def\aeb@setPDFPackage{% \literalps@out{[ {Catalog} << /PageMode/UseAttachments /Collection<> >>/PUT pdfmark}% }% % \AtBeginDocument{\aeb@setPDFPackage}% } \@onlypreamble\makePDFPackage % \end{macrocode} % \end{macro} % \begin{macrocode} % %<*package> \AtEndOfPackage{\csname aeb@inputAttachments\endcsname} \AtBeginDocument{\csname aeb@setPDFPackage\endcsname} % %<*unicode> % \end{macrocode} % \section{Support for linking to attachments.} % % \subsection{{\protect\LaTeX} Support: \cs{ahyperref}, \cs{ahyperlink}, \cs{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[]{