Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permalinks are broken in recent versions of the manual #796

Closed
astoff opened this issue Dec 1, 2019 · 8 comments

Comments

@astoff
Copy link

@astoff astoff commented Dec 1, 2019

Until at least version 3.0.1a, the PGF manual used to have "permalinks", that is, named destinations like pgf./tikz/dash:pattern or pgf.<CS>draw that wouldn't change across versions.

In version 3.1.4b, those permalinks are gone, and are replace by things like pgfmanual-pos-84, which don't seem to be durable. See for instance this link, and compare with this link, which used to work.

With this change, it's impossible to reliably point to a specific spot of the manual on an online forum, among other interesting use cases.

@astoff astoff added the manual label Dec 1, 2019
@hmenke

This comment has been minimized.

Copy link
Member

@hmenke hmenke commented Dec 1, 2019

That is likely a problem in hyperref.

@davidcarlisle

This comment has been minimized.

Copy link
Member

@davidcarlisle davidcarlisle commented Dec 1, 2019

I don't think we have intentionally changed anything in hyperref there in recent years, however anything's possible. If an example that's a bit smaller than the tikz manual could be posted to
https://github.com/latex3/hyperref/issues
we'd certainly look....

@hmenke

This comment has been minimized.

Copy link
Member

@hmenke hmenke commented Dec 1, 2019

I quickly browsed through the macros and it seems that the manual is overriding hyperref there to make the manual compatible with dvisvgm which does not support “permalinks”, although I don't even think that this is supported by PDF and rather just a viewer feature that there is some kind of link name translation.

@hmenke

This comment has been minimized.

Copy link
Member

@hmenke hmenke commented Dec 1, 2019

For reference:

\newcount\pgfmanualtargetcount
\def\cleanuplink#1{%
\expandafter\ifx\csname pgfmanual@hlink@#1\endcsname\relax%
\global\advance\pgfmanualtargetcount by1\relax%
\expandafter\xdef\csname pgfmanual@hlink@#1\endcsname{pgfmanual-pos-\the\pgfmanualtargetcount}%
\fi%
}
\def\cleanedhypertarget#1#2{% necessary for dvisvgm
\cleanuplink{#1}%
\hypertarget{\csname pgfmanual@hlink@#1\endcsname}{#2}%
}
\def\cleanedhyperlink#1#2{%
\cleanuplink{#1}%
\hyperlink{\csname pgfmanual@hlink@#1\endcsname}{#2}%
}

@hmenke

This comment has been minimized.

Copy link
Member

@hmenke hmenke commented Dec 1, 2019

@davidcarlisle Would it be possible to have hyperref percent-encode links when using dvisvgm? Then I could get rid of all the extra code.

@davidcarlisle

This comment has been minimized.

Copy link
Member

@davidcarlisle davidcarlisle commented Dec 1, 2019

@hmenke the answer must be yes, I'll have to have a look what it's currently doing. A dvisvgm test case in a hyperref repo issue would be appreciated (otherwise I might simply forget:-)

hmenke added a commit that referenced this issue Dec 1, 2019
@hmenke

This comment has been minimized.

Copy link
Member

@hmenke hmenke commented Dec 2, 2019

It seems as if dvisvgm has changed and does not use the label directly anyway. I have removed all the \cleanuplink bullshit and now the links in the SVG look like this

<a xmlns="http://www.w3.org/2000/svg" xlink:href="pgfmanual-0227.svg#loc1449" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="pgf.back/coordinate">...</a>

Note how the label is actually in xlink:title and not in xlink:href.

@astoff The PDF manual should have human readable link labels again. You can check here: https://pgf-tikz.github.io/pgf/pgfmanual.pdf
However, I don't want to make any guarantees about the long-term stability of these links, because there are way too many factors that influence them. I can promise you though that I won't break them deliberately.

@hmenke hmenke added the closed-fixed label Dec 2, 2019
@hmenke hmenke closed this Dec 2, 2019
@astoff

This comment has been minimized.

Copy link
Author

@astoff astoff commented Dec 2, 2019

Great! The command hyperlinks changed from, say, pgf.<CS>draw to pgf.back/draw. This is a minor issue, but it would be nice to try to stabilize around one convention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.