Skip to content

Commit

Permalink
working on destinations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrike Fischer committed Mar 19, 2020
1 parent 1e2f284 commit 64efae0
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 19 deletions.
24 changes: 15 additions & 9 deletions hgeneric-experimental.def
Expand Up @@ -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}
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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}
{
Expand Down Expand Up @@ -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.
Expand All @@ -482,20 +486,22 @@
\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
\fi
}
\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}
Expand Down
65 changes: 55 additions & 10 deletions 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

#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.

0 comments on commit 64efae0

Please sign in to comment.