Mercurial > cpython-lru_cache-weakref
comparison Doc/texinputs/python.sty @ 38286:043e29a1e398 2.4
fix broken links in PDF
(SF patch #1281291, contributed by Rory Yorke)
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Thu, 25 May 2006 02:45:39 +0000 |
| parents | 0349257e1ed5 |
| children |
comparison
equal
deleted
inserted
replaced
| 38225:f9612177d08d | 38286:043e29a1e398 |
|---|---|
| 867 | 867 |
| 868 % Use this def/redef approach for \url{} since hyperref defined this already, | 868 % Use this def/redef approach for \url{} since hyperref defined this already, |
| 869 % but only if we actually used hyperref: | 869 % but only if we actually used hyperref: |
| 870 \ifpdf | 870 \ifpdf |
| 871 \newcommand{\url}[1]{{% | 871 \newcommand{\url}[1]{{% |
| 872 \py@pdfstartlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}% | 872 \py@pdfstartlink% |
| 873 \py@LinkColor% color of the link text | 873 attr{ /Border [0 0 0] }% |
| 874 user{% | |
| 875 /Subtype/Link% | |
| 876 /A<<% | |
| 877 /Type/Action% | |
| 878 /S/URI% | |
| 879 /URI(#1)% | |
| 880 >>% | |
| 881 }% | |
| 882 \py@LinkColor% color of the link text | |
| 874 \py@smallsize\sf #1% | 883 \py@smallsize\sf #1% |
| 875 \py@NormalColor% Turn it back off; these are declarative | 884 \py@NormalColor% Turn it back off; these are declarative |
| 876 \pdfendlink}% and don't appear bound to the current | 885 \pdfendlink}% and don't appear bound to the current |
| 877 }% formatting "box". | 886 }% formatting "box". |
| 878 \else | 887 \else |
| 944 | 953 |
| 945 % \ulink{link text}{URL} | 954 % \ulink{link text}{URL} |
| 946 \ifpdf | 955 \ifpdf |
| 947 \newcommand{\ulink}[2]{{% | 956 \newcommand{\ulink}[2]{{% |
| 948 % For PDF, we *should* only generate a link when the URL is absolute. | 957 % For PDF, we *should* only generate a link when the URL is absolute. |
| 949 \py@pdfstartlink attr{/Border [0 0 0]} user{/S /URI /URI (#2)}% | 958 \py@pdfstartlink% |
| 959 attr{ /Border [0 0 0] }% | |
| 960 user{% | |
| 961 /Subtype/Link% | |
| 962 /A<<% | |
| 963 /Type/Action% | |
| 964 /S/URI% | |
| 965 /URI(#2)% | |
| 966 >>% | |
| 967 }% | |
| 950 \py@LinkColor% color of the link text | 968 \py@LinkColor% color of the link text |
| 951 #1% | 969 #1% |
| 952 \py@NormalColor% Turn it back off; these are declarative | 970 \py@NormalColor% Turn it back off; these are declarative |
| 953 \pdfendlink}% and don't appear bound to the current | 971 \pdfendlink}% and don't appear bound to the current |
| 954 }% formatting "box". | 972 }% formatting "box". |
