⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aeb_pro.dtx

📁 It uses latex to give question papers
💻 DTX
📖 第 1 页 / 共 5 页
字号:
/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<l; i++ ) {
        if (ocgs[0].name.substring(0,3) == "xb." )
            xBlds.push(ocgs.shift());
        else ocgs.push(ocgs.shift());
    }
}
var assocxLayers = new Array();
if ( xBlds != null ) {
    for ( var i=0; i<xBlds.length; i++)
        assocxLayers[xBlds[i].name]=i;
}
function getxBld (name) {
    var i = assocxLayers["xb."+name];
    return ( i == undefined ) ? null : xBlds[i];
}
function toggleHelp (name)
{
    var o = getxBld(name);
    if ( o != null ) o.state = (event.name.indexOf("Enter") != -1);
}
function toggleSetThisLayer(name, bState) {
    var oLayer = getxBld(name);
    if ( oLayer != null )
        oLayer.state = (arguments.length > 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}\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+1)).state=false;}", timeinterval);
    aebAnimeTimeOutC.start = nFrames;
    aebAnimeTimeOutC.count=0;
}
function hideAllFrames(n, baseName)
{
    for ( var i=0; i < n ; i++ )
        getxBld(baseName+"\#"+i).state=false;
}
\end{insDLJS}
%    \end{macrocode}
%    \begin{macrocode}
%</aeblayers>
%<*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}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -