\documentclass{article}

\usepackage{amsmath}

\usepackage[designi,tight,nodirectory]{web}
\usepackage{eforms}
\usepackage{aeb_mlink}
\usepackage{multicol}

\title{Demonstrating the \textsf{aeb\_mlink} Package\texorpdfstring{\\}{: }A member of AeB Pro}
\author{D. P. Story}
\subject{Multi-line links using the AcroTeX eDucation Bundle}
\keywords{AeB, multi-line links}

\university{OKALOOSA-WALTON COLLEGE\\
   Department of Mathematics}
\email{storyd@owc.edu}
\version{1.0}
\revisionLabel{}

\newcommand{\cs}[1]{\texttt{\char`\\#1}}

\begin{document}

\maketitle

\section{Introduction}


This file tests and demonstrates new macros for creating hypertext
links that wrap around a line. Most of the text is nonsense, and was
created to fill the page, no offence taken I hope

This paragraph contains two links that go beyond the
\mlhypertext[\S{U}\W{1}\Color{0 0.6 0}\A{\JS{app.alert("First
Link\\n\\nLet's try another!  J\\374rgen and with unicode J\\u00FCrgen")}}
]{margins of this text width} so it wraps around to the
next line. Now, I'll \mlhypertext[\A{\JS{app.alert("Second
Link")}}]{insert a multi-line link.}\footnote{Techniques by D. P.
Story} Can we continue with this? Yes, so says D. P. Story.


This paragraph contains two links that go beyond the
\mlhypertext[\A{\JS{app.alert("Third Link")}}]{margins of this text width},
so it wraps around to the next line. Let's try a numbered equation:
\begin{equation}
                \boxed{x + y = 1}
\end{equation}
Now, with your permission, I'll insert another one of these
\mlhypertext[\A{\JS{app.alert("Fourth Link")}}]{links of the
multiline type.}\footnote{D.P. Story is very nice fellow, but he has a rather
\mlhypertext[\A{\JS{app.alert("Footnote!")}}]{grand head; we must watch the
compliments} so we don't inflate his ego more.} Can we continue with
this? Yes, so says D. P. Story.


On the next page, we try multiple column format.

\mlhypertext[\S{U}\W{1}\Color{0 0.6 0}\A{\JS{app.alert("Success! Multi-line links with hyphenation!\\n\\nCongrats,
J\\u00FCrgen")}}]{Welcome my friends to my residence, humble as it is. The encyclopedia is a wonderful book.}
We shall study it closely during your visit.

Try this great link: \mlhypertext[\A{\JS{app.alert("Success!");}}
]{J\"{u}rgen, \LaTeX{} and math $\displaystyle\int_0^1 f(x) dx$ work admirably.}

\parskip0pt

\begin{multicols}{2}
\noindent Being able to create multi-line links becomes important when the
\texttt{\string\linewidth} is narrow. On this page we create some
mindless text that will fill up all or part of the page, then create
some multi-line links.

Without a doubt, \textsl{this method will fail if the paragraph contains
multi-line links that crosses a \emph{page boundary} or a \emph{\mlhypertext[\A{\JS{app.alert("Wrong again! However, there are problems
with page boundaries.");}}]{column boundary}}}.

This paragraph contains two links that extend beyond the
\mlhypertext[\A{\JS{app.alert("Fifth Link")}}]{margins of this text
width} which causes it to wrap around to the next line. Note the
hyphenation of the link, this is due to the \textsf{soul} package.
As a further test, I'll \mlhypertext[\A{\JS{app.alert("Sixth
Link")}}]{insert a multi-line link} again. Can we continue with
this? Yes, so says D. P. Story.

\end{multicols}


\section{Second of Three Sections}\label{second}

Let us begin by having page filling mindless text,
then we'll force a page break, but before we break, a friend of
mine, asked if multi-line links work with math formulas. A very strange request,
\mlhypertext[\A{\JS{app.alert("I said, \\"No, they won't work.\\"...I'm wrong again.")}}]{$ x= f(t)$, $ x= g(t)$, $h(x) = e^x$} very strange
let's try.

Use \LaTeX/hyperref system of cross-referencing
\mlnameref{three}. The last link is a modification of
the \texttt{\string\nameref} command from hyperref.The
\texttt{\string\Nameref} command can be duplicated
\mlNameref{three} as well.

\newpage

\section{Third of Three Sections}\label{three}

The second section, oops, I've lost count. I have nothing to say in
this section. I take that back, below are problem areas multi-line
linking:

\begin{enumerate}
    \item This method cannot work across page boundaries
    \item See the \textsf{soul} package documentation for limitations on the arguments
          of the \cs{mlxx} commands.
    \item Works for footnotes
    \item Can use verbatim text in a paragraph, \verb!$#}^!,
          but cannot include verbatim in a multi-line link. Is
          there any real need to do so?
\end{enumerate}

\section{URLs}

Let us try a URL across lines: \mlhref[\S{U}\W{1}\Color{0.6 0 0}]{%
http://www.math.uakron.edu/~dpstory/acrotex.html#educational}
{See the educational offerings of the {Acro\negthinspace{\TeX}} Web
Site at the University of Akron}. This link plays off the
\texttt{\string\href} \hypertarget{command}{command}.

We can also call a local file, let's try:  \mlhref{shameless_ad.pdf}{Here is a
shameless advertisement for Acro\!\TeX}.

Try launching  a file now, let's try a \LaTeX{} file:
\mlhref[\S{U}\W{1}\Color{.6 0 0}]{run:\jobname.tex}{This is the
source file of this document}.\footnote{Source document needs to be in the folder
containing this PDF file.}

Finally, let's try my own email address at Acro\!\TeX.Net,
\mlhref{mailto:dpstory@acrotex.net}{dpstory at acrotex dot net}.

\mlhref{run:np_test.txt}{Launch Notepad}\footnote{Windows system required.}


\end{document}
