[latex3-commits] [git/LaTeX3-latex3-latex3] main: Force hypertargets to exist in many places to remove pdfTeX warnings (2a3a61279)
Bruno Le Floch
blflatex at gmail.com
Sat May 1 01:57:15 CEST 2021
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/2a3a6127909c00f2ba7a48b4ceacbc7a82460027
>---------------------------------------------------------------
commit 2a3a6127909c00f2ba7a48b4ceacbc7a82460027
Author: Bruno Le Floch <blflatex at gmail.com>
Date: Sat May 1 01:57:15 2021 +0200
Force hypertargets to exist in many places to remove pdfTeX warnings
These warnings, of the form
'pdfTeX warning (dest): name{HD.xx} has been referenced but does
not exist, replaced by a fixed one'
were produced on the first run after makeindex because hypdoc tries
to avoid using too many destinations. The problem is that this gave
a very long terminal output, too long for Travis to handle.
>---------------------------------------------------------------
2a3a6127909c00f2ba7a48b4ceacbc7a82460027
l3kernel/l3doc.dtx | 37 +++++++++++++++++++++++++++++--------
1 file changed, 29 insertions(+), 8 deletions(-)
diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index dad842120..df9df3501 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -1989,8 +1989,7 @@ and all files in that bundle must be distributed together.
% \begin{macrocode}
\mode_if_math:T { \mbox }
{
- \bool_if:NT \l_@@_allow_indexing_bool
- { \mode_leave_vertical: \HD at target }
+ \bool_if:NT \l_@@_allow_indexing_bool { \@@_target: }
\verbatim at font
\@@_if_almost_str:VT \l_@@_cmd_tl
{
@@ -2692,8 +2691,7 @@ and all files in that bundle must be distributed together.
\cs_new_protected:Npn \@@_typeset_functions:
{
\small\ttfamily
- \HD at savedestfalse
- \HD at target
+ \@@_target:
\Hy at MakeCurrentHref { HD. \int_use:N \c at HD@hypercount }
\begin{tabular} [t] { @{} l @{} >{\hspace{\tabcolsep}} r @{} }
\toprule
@@ -2986,8 +2984,7 @@ and all files in that bundle must be distributed together.
\hbox:n
{
\strut
- \int_compare:nNnT \l_@@_macro_int = 0
- { \HD at target }
+ \int_compare:nNnT \l_@@_macro_int = 0 { \@@_target: }
}
\vskip \int_eval:n { \l_@@_macro_int - 1 } \baselineskip
}
@@ -3445,7 +3442,7 @@ and all files in that bundle must be distributed together.
{
\@bsphack
\begingroup
- \HD at target
+ \@@_target:
\index
{
#1\actualchar{\protect\ttfamily#1}~(option)
@@ -4044,6 +4041,30 @@ and all files in that bundle must be distributed together.
%
% \subsubsection{Necessary patching}
%
+% The following is useful to set up \pkg{hyperref} targets, for instance
+% for the purpose of indexing. Contrarily to \pkg{hypdoc} we do not try
+% to save pdf destinations, as this leads to too many \pdfTeX{} warnings
+% on early runs.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_target:
+ {
+ \mode_leave_vertical:
+ \group_begin:
+ \HD at savedestfalse \HD at target
+ \group_end:
+ }
+% \end{macrocode}
+% Force targets on every code line.
+% \begin{macrocode}
+\cs_set_nopar:Npx \theCodelineNo
+ {
+ \group_begin:
+ \exp_not:N \HD at savedestfalse
+ \exp_not:o \theCodelineNo
+ \group_end:
+ }
+% \end{macrocode}
+%
% Inside the table of contents (and other similar lists introduced by
% \cs{@starttoc}), we suppress indexing. This is because \cs{cmd},
% \cs{cs}, or \cs{tn} appearing in titles only gets typeset in the
@@ -4235,7 +4256,7 @@ and all files in that bundle must be distributed together.
{ main } { \codeline at wrindex }
{ usage } { \index }
}
- { \HD at target \index }
+ { \@@_target: \index }
}
{
\tl_if_empty:nF { #3 #4 #5 }
More information about the latex3-commits
mailing list.