Skip to content

Commit

Permalink
working on disable link code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrike Fischer committed Jan 28, 2021
1 parent 438f6d4 commit ccae453
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 8 deletions.
23 changes: 15 additions & 8 deletions hyperref-generic.dtx
Expand Up @@ -1077,6 +1077,7 @@
\seq_map_inline:Nn \c_pdfannot_link_types_seq
{
\bool_new:c {l_@@_annot_#1_bool}
\bool_set_true:c {l_@@_annot_#1_bool}
}
% \end{macrocode}
% \end{variable}
Expand Down Expand Up @@ -1464,22 +1465,28 @@
\__hyp_link_goto_end:
\group_end:
\Hy@VerboseLinkStop
}{#3}
}{#3}
}

\cs_new_protected:Npn \hyper@linkstart #1 #2 %#1 context, #2=destination name
{
\Hy@VerboseLinkStart{#1}{#2}% only for debug
\group_begin:
\hook_use:n {hyp/link/#1}
\@@_link_goto_begin:nw {#2}
\bool_if:NT \l_@@_annot_GoTo_bool
{
\Hy@VerboseLinkStart{#1}{#2}% only for debug
\group_begin:
\hook_use:n {hyp/link/#1}
\@@_link_goto_begin:nw {#2}
}
}

\cs_new_protected:Npn \hyper@linkend
{
\@@_link_goto_end:
\group_end:
\Hy@VerboseLinkStop
\bool_if:NT \l_@@_annot_GoTo_bool
{
\@@_link_goto_end:
\group_end:
\Hy@VerboseLinkStop
}
}
% \end{macrocode}
%
Expand Down
28 changes: 28 additions & 0 deletions testfiles/disable-links.pvt
@@ -0,0 +1,28 @@
\documentclass{article}
\usepackage[colorlinks]{hyperref}
%\hypersetup{draft}
\begin{document}
\ExplSyntaxOn
\bool_set_false:N \l__hyp_annot_GoTo_bool
\ExplSyntaxOff

\tableofcontents

\newpage
\ExplSyntaxOn
\bool_set_true:N \l__hyp_annot_GoTo_bool
\ExplSyntaxOff

\section{abc}\label{x}

\ref{x},

\ExplSyntaxOn
\bool_set_false:N \l__hyp_annot_GoTo_bool
\ExplSyntaxOff

\ref{x}

%\url{https://github.com/latex3/luaotfload/issues/154}

\end{document}

0 comments on commit ccae453

Please sign in to comment.