From 64efae0fa4fd96910ae58a220c101df9543e0922 Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Thu, 19 Mar 2020 19:42:58 +0100 Subject: [PATCH] working on destinations --- hgeneric-experimental.def | 24 +++++++++------ hyperreflinktypes.tex | 65 +++++++++++++++++++++++++++++++++------ 2 files changed, 70 insertions(+), 19 deletions(-) diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def index c7809f78..bb0e7abf 100644 --- a/hgeneric-experimental.def +++ b/hgeneric-experimental.def @@ -63,6 +63,9 @@ \Hy@unicodetrue \let\HyPsd@pdfencoding\HyPsd@pdfencoding@unicode +\providecommand*\@pdfview{XYZ} + +%%%%%%%%%% % variants \cs_generate_variant:Nn \pdf_object_write:nn {nx} \cs_generate_variant:Nn \pdf_catalog_gput:nn {nx} @@ -312,6 +315,9 @@ \ExplSyntaxOn +%these patterns are used in hyperref checks. +%it is unclear if they are really useful and if a backend support is +%needed. \str_case:VnF \c_sys_backend_str { { pdfmode } @@ -357,7 +363,7 @@ \Hy@DisableOption{pdfversion}% -%ocg colorlinks should be done as in ocgx. This here +% ocg colorlinks should be done as in ocgx. This here % are boxes ... \legacy_if:nTF {Hy@ocgcolorlinks} { @@ -468,11 +474,9 @@ % default: \pdf_link_margin:n { 1pt } - \ExplSyntaxOff -\providecommand*\@pdfview{XYZ} - +\ExplSyntaxOn \newcommand\Hy@pstringDest{} \Hy@WrapperDef\new@pdflink#1{% #1 is a destination name. @@ -482,7 +486,8 @@ \Hy@SaveLastskip \Hy@VerboseAnchor{#1}% \Hy@pstringdef\Hy@pstringDest{\HyperDestNameFilter{#1}}% - \Hy@DestName\Hy@pstringDest\@pdfview + %\Hy@DestName\Hy@pstringDest\@pdfview + \pdf_destination:nf { \Hy@pstringDest } { \@pdfview } %types?? \Hy@RestoreLastskip \ifhmode \spacefactor\@savsf @@ -490,12 +495,13 @@ } \let\pdf@endanchor\@empty +\ExplSyntaxOff \ExplSyntaxOn -\cs_new_protected:Npn \Hy@DestName #1 #2 % #1= name #2= fit options - { - \pdf_destination:nf {#1}{#2} - } +%\cs_new_protected:Npn \Hy@DestName #1 #2 % #1= name #2= fit options +% { +% \pdf_destination:nf {#1}{#2} +% } \ExplSyntaxOff \def\Hy@undefinedname{UNDEFINED} diff --git a/hyperreflinktypes.tex b/hyperreflinktypes.tex index b7db35a2..e31ed914 100644 --- a/hyperreflinktypes.tex +++ b/hyperreflinktypes.tex @@ -1,22 +1,67 @@ -\hyper@linkstart : - in hyperref.sty! +%%%%%%%%%%%%%%%%%% +Internal links +%%%%%%%%%%%%%%%%% + +\hyper@linkstart : + defined in driver, + used in hyperref.sty! two arguments! first : color (will ignore it ...) second: destination name \hyper@linkstart{link}{\Hy@footnote@currentHref} - \hyper@linkstart{cite}{cite.#1}% + \hyper@linkstart{cite}{cite.#1}% \hyper@linkstart{link}{\Hy@tocdestname} (toc) - internal command + internal command \find@pdflink{#1}{#2} + defined in driver, + used only in driver -> \pdf_link_begin_goto:nnw { link } { #2 } \expandafter\Hy@colorlink\csname @#1color\endcsname - + \hyper@link - three arguments, basically \hyper@linkstart/\hyperlinkend with - content as third argument. - Used in \hyper@link@ - > + three arguments, basically \hyper@linkstart/\hyper@linkend with + content as third argument. + Used in \hyper@link@ - > \hyper@@link[cite] \hyper@@link[link] - #1 either link or cite - \ No newline at end of file + #1 either link or cite + +%%%%%%%%%%%%%%%%%%%%% + +\hyper@anchor, \hyper@anchorstart, \hyper@anchorend : + defined in driver, + used in hyperref.sty + one argument: destination name + + Uses + \hyper@anchorstart{Doc-Start}\hyper@anchorend + \hyper@anchorstart{\@currentHref}\hyper@anchorend in \hyper@refstepcounter and various environments + inside the definition of \hyper@@anchor: \hyper@@anchor is used in various environments where text is involved and + typically in combination with nesting. (Very) old version of hyperref.dtx suggest that anchorcolor which does nothing + now was involved here. + \def\hypertarget#1#2{% + \ifHy@nesting + \hyper@@anchor{#1}{#2}% + \else + \hyper@@anchor{#1}{\relax}#2% + \fi +} + + Internalcommand + \new@pdflink #1 + defined in driver + used only in driver + argument is destination name, "Fit" argument is got through \@pdfview + + +%%%% +nesting + +The documentation writes about "nesting": +Allows links to be nested; no drivers currently support this. + +All places in the code where \ifHy@nesting is used are about anchors, not links. +\ifHy@nesting is false in all drivers, so actually nowhere the true code is used. + +It is unclear if nesting can be used, and what use it would have. \ No newline at end of file