[OS X TeX] "Mailto" link in document

Bruno Voisin bvoisin at mac.com
Wed Jun 20 12:24:37 EDT 2007


Le 20 juin 07 à 17:34, Jonathon Swiderski a écrit :

> On 6/20/07, Alan Munn <amunn at msu.edu> wrote:
>
>> At 12:22 AM +1000 6/21/07, George LGhio wrote:
>>
>>> I would like to include a "mailto" link within a document.
>>>
>>> Document class - book
>>> Using plain Tex.
>>>
>>> Nothing I have tried seems to work. I have run out of ideas.
>>
>> I wonder what you tried:
>>
>> \documentclass{article}
>> \usepackage[colorlinks=true]{hyperref}
>> \begin{document}
>> This is my e-mail address \href{mailto:amunn at msu.edu}{Alan Munn}
>> \end{document}
>>
>> works fine for me.
>
> This requires LaTeX---he says he wants plain TeX.

Try using eplain:

\input eplain
\input eplain
\input ifxetex.sty
\ifxetex
   \beginpackages
     \usepackage[xetex]{color}
   \endpackages
   \enablehyperlinks[dvipdfm]
\else
\ifpdf
   \beginpackages
     \usepackage[pdftex]{color}
   \endpackages
   \enablehyperlinks[pdftex]
\else
   \beginpackages
     \usepackage[dvips]{color}
   \endpackages
   \enablehyperlinks[hypertex]
\fi
\fi
\ifxetex
   \hlopts{bwidth=0,colormodel=,color=magenta}
\else
\ifpdf
   \hlopts{bwidth=0,colormodel=,color=magenta}
\else
   \hlopts{colormodel=,color=magenta}
\fi
\fi
This is my e-mail address \href{mailto:amunn at msu.edu}{Alan Munn}
\bye

See /Library/TeX/Documentation/texmf-dist-doc/eplain/doc/eplain.pdf,  
especially section 5. The above includes provision for three cases:

- pdfTeX as the PDF-producing engine, pdftex hyperlink driver: a  
hyperlink is created.

- XeTeX as the PDF-producing engine, dvipdfm hyperlink driver: a  
hyperlink is created.

- standard TeX with dvips + ps2pdf as the PDF-producing engine,  
hypertex hyperlink driver: no hyperlink is created (apparently owing  
to limitations of this driver).

It's certainly possible to use standard TeX with dvipdfm(x) instead  
of dvips + ps2pdf, in which case \enablehyperlnks[dvipdfm] should  
work and produce working hyperlinks. I just haven't tried, as there's  
no immediate way to do this from within TeXShop.

Bruno Voisin
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list