summaryrefslogtreecommitdiffstats
path: root/Doc/texinputs/python.sty
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-08-27 19:50:42 (GMT)
committerFred Drake <fdrake@acm.org>2002-08-27 19:50:42 (GMT)
commit4fa82fa410bd2adcac01d302734f05cb26fa2210 (patch)
tree469fddf4f774edc9b7d61e084d3a9c7994b97db3 /Doc/texinputs/python.sty
parent8bb9fe89b8dbfe7ad1f1867d0340525be6a4ab2c (diff)
downloadcpython-4fa82fa410bd2adcac01d302734f05cb26fa2210.zip
cpython-4fa82fa410bd2adcac01d302734f05cb26fa2210.tar.gz
cpython-4fa82fa410bd2adcac01d302734f05cb26fa2210.tar.bz2
Back-port the \ulink macro to the documentation package for Python 2.1.x
since a documentation patch included \ulink. Adding this here makes back-porting further documentation patches easier than having to remove \ulink from the patches. Closes SF bug #598996.
Diffstat (limited to 'Doc/texinputs/python.sty')
-rw-r--r--Doc/texinputs/python.sty15
1 files changed, 15 insertions, 0 deletions
diff --git a/Doc/texinputs/python.sty b/Doc/texinputs/python.sty
index e4c60b8..3e173f0 100644
--- a/Doc/texinputs/python.sty
+++ b/Doc/texinputs/python.sty
@@ -856,6 +856,21 @@
% Note that \longprogramopt provides the '--'!
\newcommand{\longprogramopt}[1]{\strong{-{}-#1}}
+% \ulink{link text}{URL}
+\@ifundefined{pdfannotlink}{
+ \newcommand{\ulink}[2]{#1}
+}{
+ % The \noindent here is a hack -- we're forcing pdfTeX into
+ % horizontal mode since \pdfstartlink requires that.
+ \newcommand{\ulink}[2]{\noindent{%
+ \pdfstartlink attr{/Border [0 0 0]} user{/S /URI /URI (#2)}%
+ \py@LinkColor% color of the link text
+ #1%
+ \py@NormalColor% Turn it back off; these are declarative
+ \pdfendlink}% and don't appear bound to the current
+ }% formatting "box".
+}
+
% cited titles: \citetitle{Title of Work}
% online: \citetitle[url-to-resource]{Title of Work}
\newcommand{\citetitle}[2][URL]{\emph{#2}}