Mercurial > cpython-lru_cache-weakref
comparison Doc/texinputs/python.sty @ 8306:4674cd2f6f07 legacy-trunk
Set the right page size in the PDF output.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Mon, 11 May 1998 20:42:54 +0000 |
| parents | df752c08b462 |
| children | ebfde06fdb8d |
comparison
equal
deleted
inserted
replaced
| 8305:0d2d61f52b9c | 8306:4674cd2f6f07 |
|---|---|
| 22 \else | 22 \else |
| 23 \input{pdfcolor} | 23 \input{pdfcolor} |
| 24 \let\py@LinkColor=\NavyBlue | 24 \let\py@LinkColor=\NavyBlue |
| 25 \let\py@NormalColor=\Black | 25 \let\py@NormalColor=\Black |
| 26 \pdfcompresslevel=9 | 26 \pdfcompresslevel=9 |
| 27 \pdfpagewidth=\paperwidth % page width of PDF output | |
| 28 \pdfpageheight=\paperheight % page height of PDF output | |
| 27 % | 29 % |
| 28 % Pad the number with '0' to 3 digits wide so no page name is a prefix | 30 % Pad the number with '0' to 3 digits wide so no page name is a prefix |
| 29 % of any other. | 31 % of any other. |
| 30 % | 32 % |
| 31 \def\py@targetno#1{\ifnum#1<100 0\fi\ifnum#1<10 0\fi#1} | 33 \def\py@targetno#1{\ifnum#1<100 0\fi\ifnum#1<10 0\fi#1} |
| 43 \pdfannotlink attr{/Border [0 0 0]} goto name{page\my@pageno}% | 45 \pdfannotlink attr{/Border [0 0 0]} goto name{page\my@pageno}% |
| 44 \py@LinkColor#2\py@NormalColor% | 46 \py@LinkColor#2\py@NormalColor% |
| 45 \pdfendlink% | 47 \pdfendlink% |
| 46 }{#3}% | 48 }{#3}% |
| 47 } | 49 } |
| 48 % | |
| 49 % This is supposed to build the "outline" view of the document; it seems | |
| 50 % quite fragile. The breakages are the same as in the ToC. | |
| 51 % | |
| 52 \AtEndDocument{ | 50 \AtEndDocument{ |
| 53 \InputIfFileExists{\jobname.bkm}{\pdfcatalog{/PageMode /UseOutlines}}{} | 51 \InputIfFileExists{\jobname.bkm}{\pdfcatalog{/PageMode /UseOutlines}}{} |
| 54 } | 52 } |
| 55 \newcommand{\py@target}[1]{% | 53 \newcommand{\py@target}[1]{% |
| 56 \ifpy@doing@page@targets% | 54 \ifpy@doing@page@targets% |
| 60 \let\py@OldLabel=\label | 58 \let\py@OldLabel=\label |
| 61 \renewcommand{\label}[1]{% | 59 \renewcommand{\label}[1]{% |
| 62 \py@OldLabel{#1}% | 60 \py@OldLabel{#1}% |
| 63 \py@target{label-#1}% | 61 \py@target{label-#1}% |
| 64 } | 62 } |
| 65 % This stuff adds a page# destination to every PDF page, where # has | 63 % This stuff adds a page# destination to every PDF page, where # is three |
| 66 % the same formatting as the displayed page number. This doesn't really | 64 % digits wide, padded with leading zeros. This doesn't really help with |
| 67 % help with the frontmatter, but does fine with the body. | 65 % the frontmatter, but does fine with the body. |
| 68 % | 66 % |
| 69 % This is *heavily* based on the hyperref package. | 67 % This is *heavily* based on the hyperref package. |
| 70 % | 68 % |
| 71 \def\@begindvi{% | 69 \def\@begindvi{% |
| 72 \unvbox \@begindvibox | 70 \unvbox \@begindvibox |
