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

📄 aebpro_ex5.tex

📁 It uses latex to give question papers
💻 TEX
📖 第 1 页 / 共 2 页
字号:
%
% Instructions for compiling this file
%   1. Compile this file once, but do not make into a PDF yet.
%   2. Open the two files children/target1/tex and children/target2.tex
%      and compile these two files several times to resolve the cross-
%      references. Now, make into PDFs.
%   3. Return to this file and compile again to input cross-reference info
%      and make into a PDF via distiller.
%
\documentclass{article}
\usepackage{xr-hyper}
\usepackage[%
    driver=dvips,
    gopro,
    web={designiv,usesf,nodirectory,tight},
    attachsource={tex,dvi},
    attachments={%
        children/target1.pdf,%      % AeB Attachment #1
        children/target2.pdf,%      % AeB Attachment #2
        ../extras/aest.xls          % AeB Attachment #3
    },
    linktoattachments,
    eforms
]{aeb_pro}

\externaldocument[target1-]{children/target1}

\DeclareDocInfo
{
    title=The AeB Pro Package\texorpdfstring{\\[1ex]}{: }Linking to Attachments,
    author=D. P. Story,
    university=Acro\negthinspace\TeX.Net,
    email=dpstory@acrotex.net,
    subject=Test file for the AeB Pro package,
    keywords={Adobe Acrobat, JavaScript},
    talksite=http://www.acrotex.net,
    talkdate={January 12, 2007},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) \the\year, D. P. Story},
    copyrightInfoURL=http://www.acrotex.net
}
\talkdateLabel{Published:}

\newcommand{\cs}[1]{\texttt{\char`\\#1}}
\newcommand\newtopic{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
\par\vskip6pt\noindent}
\def\aftersverbskip{\noindent}
\newenvironment{sverbatim}
{\par\small\verbatim}
{\endverbatim\par\aftergroup\aftersverbskip}
\newenvironment{ssverbatim}
{\par\footnotesize\verbatim}
{\endverbatim\par\aftergroup\aftersverbskip}
\def\AcroTeX{Acro\negthinspace\TeX}

%\autolabelNum{AeST}{3}
%\autolabelNum{cooltarget}{3}
%\autolabelNum{attach1}{1}
%\autolabelNum{attach2}{2}
%
% \autolabelNum[mytarget]{1}
% \autolabelNum*[mytarget]{1}{New Title}
% \autolabelNum*[AeST]{3}{\u0022$|e^\u007B\u005Cln(17)\u007D|$\u0022 beep}
% \labelName{cooltarget}{\u0022$|e^\u007B\u005Cln(17)\u007D|$\u0022}
\begin{attachmentNames}
\autolabelNum{1}
\autolabelNum*{2}{target2.pdf Attachment File}
\autolabelNum*[AeST]{3}{AeBST Components}
\labelName{cooltarget}{My (cool) $|x^3|$ ~ % '<attachment>'}
\end{attachmentNames}
% The use of \importDataObject should occur after the \texttt{attachmentNames} environment.
%\def\u{\string\\u}%
\begin{docassembly}
\importDataObject({cName: "\aref(cooltarget)",cDIPath: "aebpro_ex2.pdf"});
\end{docassembly}

\def\preseti{bordercolor={0 0 1},highlight=outline,border=visible,linestyle=dashed,open=new}

\begin{document}

\maketitle

\tableofcontents

\section{Introduction}

As we saw briefly in \texttt{aebpro\_ex3.tex}, it is possible to
attach a document using the \texttt{docassembly} environment, as
illustrated below,
\begin{sverbatim}
    \begin{docassembly}
    \importDataObject({
        cName: "\aref(cooltarget)",
        cDIPath: "aebpro_ex2.pdf"
    });
    \end{docassembly}
\end{sverbatim}
In the above, we use \cs{importDataObject}, set the path to be
\texttt{cDIPath: "aebpro\_ex2.pdf"} (this can be absolute or
relative), and give the attachment a name with \texttt{cName:}
\texttt{"\cs{aref(cooltarget)}"}. The special command \cs{aref}, is
used to reference the assigned name has as its argument the label
name, \emph{delimited by parentheses}.

The parameter \texttt{cName} in the above \texttt{docassembly} code
is of particular importance. The value of \texttt{cName} is used in
the names tree for embedded files. It is used to reference the
attachment in the link code.  After the file is imported, the value
of \texttt{cName} is converted by Acrobat to Unicode. When
referencing it, you must know the unicode of the value of the
\texttt{cName} key.

First, we insert into the preamble, the \texttt{linktoattachments} option.
This brings in all the code and commands to be discussed in this document.
(See the preamble of this file.)

\section{Naming Attachments}

For documents attached by the \texttt{attachments} option, AeB Pro
assigns them ``names,'' which appear in the attachments tab of
Acrobat/Reader as the Description.\footnote{The Description is
important as it is the way embedded files are referenced
internally.} The names assigned are \texttt{AeB Attachment 1},
\texttt{AeB Attachment 2}, \texttt{AeB Attachment 3}, and so on.
If you embedded the file using the \texttt{docassem\-bly} environment
and the \cs{importDataObject} method, then you are free to assign a
name of your preference. However it is done, the names must be
converted to unicode on the {\TeX} side of things to set up the
links, and there must be a \LaTeX-like way of referencing this
unicode name, hence the development of the \texttt{attachmentNames}
environment and the two commands \cs{autolabelNum} and
\cs{labelName}.\footnote{It is important to note that
these are not needed unless you are linking to the embedded
files.}

We describe these by example. In the preamble you will find
\begin{sverbatim}
    \begin{attachmentNames}
    \autolabelNum{1}
    \autolabelNum*{2}{target2.pdf Attachment File}
    \autolabelNum*[AeST]{3}{AeBST Components}
    \labelName{cooltarget}{My (cool) $|x^3|$ ~ % '<attachment>'}
    \end{attachmentNames}
\end{sverbatim}
\textbf{\color{red}Note:} The \texttt{attachmentNames} environment
and the commands \cs{autolabel\-Num} and \cs{labelName} should be
used only in the parent document; for child documents they are not
necessary.

\begin{description}

\item[\cs{autolabelNum}:] For PDFs (or other files) embedded using the
\texttt{attachments} option, use the \cs{autolabelNum} command. The
syntax is
\begin{verbatim}
    \autolabelNum[<label>]{<num>}
\end{verbatim}
The first optional argument is the label to be used to refer to this
embedded file; the default is \texttt{attach<num>}. The second
argument is the second is a number, 1, 2, 3.., which
corresponds to the order the file is listed in the value of the
\texttt{attachments} key.\footnote{To minimize the number of changes
to the document, if you later add an attachment, add it to the end
of the list so the earlier declarations are still valid.}

\item[\cs{autolabelNum*}:] There is a star form of \cs{autolabelNum}, which
allows to to change the description of the attachment.
\begin{verbatim}
    \autolabelNum*[<label>]{<num>}{<description>}
\end{verbatim}
By default, the first attachment has label name \texttt{attach<num>}
and has a description of \texttt{AeB Attachment <num>}, This command
allows you not only to change the label, but to change the description
of the attachment as well.

\item[\cs{labelName}:] For files that are embedded in using
\cs{importDataObject}, use the command \cs{labelName} for assigning
the name, and setting up the correspondence between the name and the
label.
\begin{verbatim}
    \labelName{<label>}{<description>}
\end{verbatim}
The first argument is the label to be used to reference this
embedded file.  The second parameter you can assign an arbitrary
name.
\end{description}

\newtopic The \texttt{<description>} parameter used in
\cs{autolabelNum*} and \cs{labelName} can be an arbitrary string
assigned to the description of this embedded file, the characters
can be most anything in the Basic Latin unicode set, 0021--007E,
with the exception of left and right braces \verb!{}!, backslash
\verb!\! and double quotes \texttt{"}. If you take the
\texttt{latin1} option, the unicodes for 00A1--00FF are also
included.

You can also enter the unicode character codes directly by typing
\cs{uXXXX} in the \texttt{<description>}, where \texttt{XXXX} are four hex digits. (Did I say not
to use `\verb!\!'?) This is very useful when using the trouble making
characters such as backslash, left and right braces, and double
quotes, or using unicode above 00FF (Basic Latin + Latin-1). To illustrate, suppose we wish
the description of \texttt{cooltarget} to be
\begin{sverbatim}
    "$|e^{\ln(17)}|$"
\end{sverbatim}
All the bad characters!
\begin{sverbatim}
\labelName{cooltarget}{\u0022$|e^\u007B\u005Cln(17)\u007D|$\u0022}
\end{sverbatim}
From the unicode character tables we see that
\begin{itemize}
\item  left brace \cs{u007B}
\item right brace \cs{u007D}
\item backslash \cs{u005C}
\item double quotes \cs{u0022}
\end{itemize}
See the example file \texttt{aebpro\_ex6.tex} for additional examples of the use
of \cs{uXXXX} character codes.

There are several ``helper'' commands as well: \cs{EURO}, \cs{DQUOTE}, \cs{BSLASH},
\cs{LBRACE} and \cs{RBRACE}. When the \cs{u} is detected, an \cs{expandafter} is executed.
This allows a command to appear immediately after the \cs{u}, things work out well if the
command expands to four hex numbers, as it should. Thus, instead of typing
\cs{u0022} you can type \verb!\u\DQUOTE!.

\section{Linking to Embedded Files}\label{embed}

This package defines two commands, \cs{ahyperref} and
\cs{ahyperlink}, to create links between parent and child and child
and child. The default behavior of \cs{ahyperref} (and
\cs{ahyperlink}) is to set up a link from parent to child.
\cs{ahyperlink} and \cs{ahyperref} are identical in all respects

⌨️ 快捷键说明

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