Mercurial > cpython-lru_cache-weakref
comparison Doc/texinputs/python.sty @ 38285:66322fca91b4 legacy-trunk
fix broken links in PDF
(SF patch #1281291, contributed by Rory Yorke)
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Thu, 25 May 2006 02:42:25 +0000 |
| parents | 2380f9d1ebab |
| children | 06145fbc7ab9 |
comparison
equal
deleted
inserted
replaced
| 38284:bcea74b35d1f | 38285:66322fca91b4 |
|---|---|
| 846 | 846 |
| 847 % Use this def/redef approach for \url{} since hyperref defined this already, | 847 % Use this def/redef approach for \url{} since hyperref defined this already, |
| 848 % but only if we actually used hyperref: | 848 % but only if we actually used hyperref: |
| 849 \ifpdf | 849 \ifpdf |
| 850 \newcommand{\url}[1]{{% | 850 \newcommand{\url}[1]{{% |
| 851 \py@pdfstartlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}% | 851 \py@pdfstartlink% |
| 852 \py@LinkColor% color of the link text | 852 attr{ /Border [0 0 0] }% |
| 853 user{% | |
| 854 /Subtype/Link% | |
| 855 /A<<% | |
| 856 /Type/Action% | |
| 857 /S/URI% | |
| 858 /URI(#1)% | |
| 859 >>% | |
| 860 }% | |
| 861 \py@LinkColor% color of the link text | |
| 853 \py@smallsize\sf #1% | 862 \py@smallsize\sf #1% |
| 854 \py@NormalColor% Turn it back off; these are declarative | 863 \py@NormalColor% Turn it back off; these are declarative |
| 855 \pdfendlink}% and don't appear bound to the current | 864 \pdfendlink}% and don't appear bound to the current |
| 856 }% formatting "box". | 865 }% formatting "box". |
| 857 \else | 866 \else |
| 923 | 932 |
| 924 % \ulink{link text}{URL} | 933 % \ulink{link text}{URL} |
| 925 \ifpdf | 934 \ifpdf |
| 926 \newcommand{\ulink}[2]{{% | 935 \newcommand{\ulink}[2]{{% |
| 927 % For PDF, we *should* only generate a link when the URL is absolute. | 936 % For PDF, we *should* only generate a link when the URL is absolute. |
| 928 \py@pdfstartlink attr{/Border [0 0 0]} user{/S /URI /URI (#2)}% | 937 \py@pdfstartlink% |
| 938 attr{ /Border [0 0 0] }% | |
| 939 user{% | |
| 940 /Subtype/Link% | |
| 941 /A<<% | |
| 942 /Type/Action% | |
| 943 /S/URI% | |
| 944 /URI(#2)% | |
| 945 >>% | |
| 946 }% | |
| 929 \py@LinkColor% color of the link text | 947 \py@LinkColor% color of the link text |
| 930 #1% | 948 #1% |
| 931 \py@NormalColor% Turn it back off; these are declarative | 949 \py@NormalColor% Turn it back off; these are declarative |
| 932 \pdfendlink}% and don't appear bound to the current | 950 \pdfendlink}% and don't appear bound to the current |
| 933 }% formatting "box". | 951 }% formatting "box". |
