Hypertext Marks in LATEX Sebastian Rahtz Email: [email protected] Heiko Oberdiek Email: [email protected] Processed February 7, 2007
Total Page:16
File Type:pdf, Size:1020Kb
Hypertext marks in LATEX Sebastian Rahtz Email: [email protected] Heiko Oberdiek Email: [email protected] processed February 7, 2007 1 Documentation overview for hyperref The documentation for package hyperref consists of several files: Manual The user documentation is also available as HTML. README Here information is collected that is not yet in the manual: new features, package compatibility, limitations, known problems, . ChangeLog This file records the version history. Options This file provides a short option summary. Bookmark talk, slides Slides for the talk “PDF information and navigation elements with hyperref, pdfTeX and thumbpdf” at EuroTEX 1999. Bookmark talk, paper The paper version of the talk. Source code documentation: hyperref.dtx This is the source code documentation for hyperref (this file). backref.dtx “Back referencing from bibliographical citations” nameref.dtx “Section name references in LATEX” 1 2 Contents 1 Documentation overview for hyperref 1 2 Contents2 3 File hycheck.tex6 4 Package options and setup9 4.1 Save catcodes................................9 4.2 Compatibility with format dumps...................... 11 4.3 Switches................................... 11 5 Common help macros 13 5.1 Macros for recursions............................ 13 5.2 Babel’s protection of shorthand characters................. 13 5.3 Coordinate transformations......................... 13 6 Dealing with PDF strings 14 6.1 Description of PDF strings......................... 15 6.2 Definition of \pdfstringdef ....................... 15 6.2.1 Preprocessing............................ 16 6.2.2 Expansion.............................. 20 6.2.3 Postprocessing........................... 22 6.3 Encodings.................................. 25 6.3.1 PD1 encoding............................ 25 6.3.2 PU encoding............................ 25 6.4 Additional user commands......................... 26 6.4.1 \texorpdfstring ......................... 26 6.4.2 Hooks for \pdfstringdef .................... 26 6.5 Help macros for expansion......................... 27 6.5.1 Babel languages.......................... 27 6.5.2 CJK bookmarks........................... 29 6.5.3 \@inmathwarn-Patch....................... 30 6.5.4 \add@accent-Patch........................ 31 6.5.5 Unexpandable spaces........................ 32 6.5.6 Marker for commands....................... 32 6.5.7 \hspace fix............................. 32 6.5.8 Fix for AMS classes........................ 33 6.5.9 Reference commands........................ 33 6.5.10 Redefining the defining commands................. 34 6.5.11 \ifnextchar ........................... 35 6.5.12 \@protected@testoptifnextchar ............... 35 6.6 Help macros for postprocessing....................... 36 6.6.1 Generic warning........................... 36 6.6.2 Protecting spaces.......................... 36 6.6.3 Remove grouping braces...................... 36 6.6.4 Catcode check........................... 37 6.6.5 Check for wrong glyphs...................... 40 6.6.6 Replacing tokens.......................... 41 6.6.7 Support for package xspace .................... 42 6.6.8 Converting to Unicode....................... 42 6.6.9 Support for UTF-8 input encoding................. 43 2 7 Support of other packages 47 7.1 Class memoir................................ 47 7.2 Package subfigure.............................. 47 7.3 Package xr and xr-hyper.......................... 47 8 Help macros for links 48 9 Options 49 9.1 Help macros................................. 49 9.2 Defining the options............................. 51 10 Options for different drivers 53 11 Options to add extra features 55 12 Language options 56 13 Options to change appearance of links 60 14 Bookmarking 60 15 PDF-specific options 62 15.1 Patch for babel’s \texttilde ....................... 68 15.1.1 Driver loading........................... 69 15.1.2 Bookmarks............................. 71 16 User hypertext macros 73 17 Underlying basic hypertext macros 75 18 Compatibility with the LATEX2html package 78 19 Forms creation 78 20 Setup 84 21 Low-level utility macros 85 22 Localized nullifying of package 86 23 Package nohyperref 86 24 The Mangling Of Aux and Toc Files 87 25 Title strings 88 26 Page numbers 90 26.1 PDF /PageLabels.............................. 90 26.1.1 pdfTeX and VTeX......................... 93 26.1.2 pdfmarkbase, dvipdfm....................... 94 27 Automated LATEX hypertext cross-references 95 28 Package lastpage support 98 29 Package ifthen support 99 3 30 Package titlesec and titletoc support 99 31 Package varioref support 100 32 Package longtable support 100 33 Equations 101 34 Footnotes 103 35 Float captions 106 36 Bibliographic references 108 36.1 Package harvard............................... 111 36.2 Package chicago............................... 113 37 Page numbers 113 38 Table of contents 115 39 New counters 117 40 AMSLATEX compatibility 117 40.1 \@addtoreset and \numberwithin patches............... 118 41 Included figures 119 42 hyperindex entries 119 43 Compatibility with foiltex 121 44 Compatibility with seminar slide package 121 45 Configuration files 127 45.1 PS/PDF strings............................... 127 45.2 pdftex.................................... 128 45.3 hypertex................................... 137 45.4 dviwindo.................................. 139 45.5 dvipdfm dvi to PDF converter....................... 143 45.6 VTeX typesetting system.......................... 148 45.7 Fix for Adobe bug number 466320..................... 158 45.8 Direct pdfmark support (dvipdf and pdfmark)............... 158 45.9 Rokicki’s dvips............................... 171 45.10VTeX’s vtexpdfmark driver......................... 173 45.11Textures................................... 174 45.12dvipsone................................... 178 45.13TeX4ht................................... 181 46 Driver-specific form support 183 46.1 pdfmarks.................................. 183 46.2 dvipdf.................................... 187 46.3 HyperTeX.................................. 188 46.4 TeX4ht................................... 188 46.5 pdfTeX................................... 191 46.6 dvipdfm................................... 195 4 46.7 Common forms part............................. 201 47 Bookmarks in the PDF file 205 47.1 Bookmarks................................. 206 48 Compatibility with koma-script classes 212 49 Encoding definition files for encodings of PDF strings 213 49.1 PD1 encoding................................ 213 49.2 PU encoding................................. 218 49.2.1 Basic Latin............................. 218 49.2.2 Latin-1 Supplement......................... 219 49.2.3 Latin Extended-A.......................... 222 49.2.4 Latin Extended-B.......................... 224 49.2.5 Greek................................ 224 49.2.6 Cyrillic............................... 226 49.2.7 Symbols.............................. 230 49.3 PU encoding, additions for VnTEX..................... 230 49.4 PU encoding, additions for Arabi...................... 233 50 End of file hycheck.tex 234 51 Index 234 5 3 File hycheck.tex Many commands of LATEX or other packages cannot be overloaded, but have to be rede- fined by hyperref directly. If these commands change in newer versions, these changes are not noticed by hyperref. With this test file this situation can be checked. It defines the command \checkcommand that is more powerful than LATEX’s \CheckCommand, because it takes \DeclareRobustCommand and optional parameters better into account. 1 h∗checki 2 \documentclass{article} 3 \makeatletter \checklatex Optional argument: release date of LATEX. 4 \newcommand*{\checklatex}[1][]{% 5 \typeout{}% 6 \typeout{* Format: `LaTeX2e' #1}% 7 \typeout{\space\space Loaded: `\fmtname' \fmtversion}% 8 }% \checkpackage The argument of \checkpackage is the package name without extension optionally fol- lowed by a release date. 9 \newcommand*{\checkpackage}[1]{% 10 \def\HyC@package{#1}% 11 \let\HyC@date\@empty 12 \@ifnextchar[\HyC@getDate\HyC@checkPackage 13 } \HyC@getDate The release date is scanned. 14 \def\HyC@getDate[#1]{% 15 \def\HyC@date{#1}% 16 \HyC@checkPackage 17 } \HyC@checkPackage 18 \def\HyC@checkPackage{% 19 \typeout{} 20 \begingroup 21 \edef\x{\endgroup 22 \noexpand\RequirePackage{\HyC@package}% 23 \ifx\HyC@date\@empty\relax\else[\HyC@date]\fi% 24 }% 25 \x 26 \typeout{}% 27 \typeout{% 28 * Package `\HyC@package'% 29 \ifx\HyC@date\@empty 30 \else 31 \space\HyC@date 32 \fi 33 }% 34 \@ifundefined{ver@\[email protected]}{% 35 }{% 36 \typeout{% 37 \space\space Loaded: `\HyC@package' % 38 \csname ver@\[email protected]\endcsname 39 }% 40 }% 41 } 6 \checkcommand The macro \checkcommand parses the next tokens as a LATEX definition and compares this definition with the current meaning of that command. 42 \newcommand*{\checkcommand}[1]{% 43 \begingroup 44 \ifx\long#1\relax 45 \expandafter\HyC@checklong 46 \else 47 \def\HyC@defcmd{#1}% 48 \expandafter\let\expandafter\HyC@next 49 \csname HyC@\expandafter\@gobble\string#1\endcsname 50 \expandafter\HyC@checkcommand 51 \fi 52 } \HyC@checklong The definition command \def or \edef is read. 53 \def\HyC@checklong#1{% 54 \def\HyC@defcmd{\long#1}% 55 \expandafter\let\expandafter\HyC@next 56 \csname HyC@\expandafter\@gobble\string#1\endcsname 57 \HyC@checkcommand 58 } \HyC@checkcommand The optional star of LATEX’s definitions is parsed. 59 \def\HyC@checkcommand{% 60 \ifx\HyC@next\relax 61 \PackageError{hycheck}{% 62 Unknown command `\expandafter\strip@prefix\meaning\HyC@cmd'% 63 }\@ehd 64 \expandafter\endinput