[latex3-commits] [latex3/latex3] dvips-breaklinks: Enable link breaking for dvips (f74b5eef9)

github at latex-project.org github at latex-project.org
Sun Jul 16 09:28:50 CEST 2023


Repository : https://github.com/latex3/latex3
On branch  : dvips-breaklinks
Link       : https://github.com/latex3/latex3/commit/f74b5eef9420e9f8390f5f00fbc613fe38f5b60c

>---------------------------------------------------------------

commit f74b5eef9420e9f8390f5f00fbc613fe38f5b60c
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Jul 16 08:44:16 2023 +0200

    Enable link breaking for dvips


>---------------------------------------------------------------

f74b5eef9420e9f8390f5f00fbc613fe38f5b60c
 l3backend/CHANGELOG.md                 |  3 +++
 l3backend/l3backend-pdf.dtx            | 41 ++++++++++++++++------------------
 l3kernel/testfiles/m3expl001.ptex.tlg  |  6 +++++
 l3kernel/testfiles/m3expl001.uptex.tlg |  6 +++++
 l3kernel/testfiles/m3expl003.ptex.tlg  |  6 +++++
 l3kernel/testfiles/m3expl003.uptex.tlg |  6 +++++
 6 files changed, 46 insertions(+), 22 deletions(-)

diff --git a/l3backend/CHANGELOG.md b/l3backend/CHANGELOG.md
index 5877ce53d..cfd05b969 100644
--- a/l3backend/CHANGELOG.md
+++ b/l3backend/CHANGELOG.md
@@ -6,6 +6,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Changed
+- Enable link breaking in `dvips`
+
 ## [2023-04-19]
 
 ### Changed
diff --git a/l3backend/l3backend-pdf.dtx b/l3backend/l3backend-pdf.dtx
index d99b100b8..eccac5be7 100644
--- a/l3backend/l3backend-pdf.dtx
+++ b/l3backend/l3backend-pdf.dtx
@@ -571,38 +571,35 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\@makecol at hook}
-%   Hooks to allow link breaking: something will be needed in format mode
-%   at some stage. At present this code is disabled as there is an open
-%   question about the name of the hook: to be resolved at the \LaTeXe{}
-%   end.
+% \begin{macro}{\@makecol}
+%   Install the necessary code to break links.
 %    \begin{macrocode}
-\use_none:n
+\bool_lazy_and:nnT
+  { \cs_if_exist_p:N \hook_gput_code:nnn }
+  { \cs_if_exist_p:N \@makecol }
   {
-    \cs_if_exist:NT \@makecol at hook
+    \hook_gput_code:nnn { cmd / @makecol / before }
+      { backend }
       {
-        \tl_put_right:Nn \@makecol at hook
+        \box_if_empty:NF \l_shipout_box
           {
-            \box_if_empty:NF \l_shipout_box
+            \vbox_set:Nn \l_shipout_box
               {
-                \vbox_set:Nn \l_shipout_box
+                \__kernel_backend_postscript:n
                   {
-                    \__kernel_backend_postscript:n
-                      {
-                        pdf.globaldict /pdf.brokenlink.rect ~ known
-                          { pdf.bordertracking.continue }
-                        if
-                      }
-                    \vbox_unpack_drop:N \l_shipout_box
-                    \__kernel_backend_postscript:n
-                      { pdf.bordertracking.endpage }
+                    pdf.globaldict /pdf.brokenlink.rect ~ known
+                      { pdf.bordertracking.continue }
+                    if
                   }
+                \vbox_unpack_drop:N \l_shipout_box
+                \__kernel_backend_postscript:n
+                  { pdf.bordertracking.endpage }
               }
           }
-        \tl_set:Nn \l_@@_breaklink_pdfmark_tl { pdf.pdfmark }
-        \cs_set_eq:NN \@@_breaklink_postscript:n \__kernel_backend_postscript:n
-        \cs_set_eq:NN \@@_breaklink_usebox:N \hbox_unpack:N
       }
+    \tl_set:Nn \l_@@_breaklink_pdfmark_tl { pdf.pdfmark }
+    \cs_set_eq:NN \@@_breaklink_postscript:n \__kernel_backend_postscript:n
+    \cs_set_eq:NN \@@_breaklink_usebox:N \hbox_unpack:N
   }
 %    \end{macrocode}
 % \end{macro}
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index ef4f01570..3eaeaab93 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -170,6 +170,12 @@ Defining \__pdf_backend_link_minima: on line ...
 Defining \__pdf_backend_link_outerbox:n on line ...
 Defining \__pdf_backend_link_sf_save: on line ...
 Defining \__pdf_backend_link_sf_restore: on line ...
+Defining \__hook cmd/@makecol/before on line ...
+Defining \g__hook_cmd/@makecol/before_code_prop on line ...
+Defining \__hook_toplevel cmd/@makecol/before on line ...
+Defining \__hook_next cmd/@makecol/before on line ...
+Defining \g__hook_cmd/@makecol/before_labels_clist on line ...
+Defining \g__hook_cmd/@makecol/before_reversed_tl on line ...
 Defining \__pdf_backend_link_last: on line ...
 Defining \__pdf_backend_link_margin:n on line ...
 Defining \__pdf_backend_destination:nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index ef4f01570..3eaeaab93 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -170,6 +170,12 @@ Defining \__pdf_backend_link_minima: on line ...
 Defining \__pdf_backend_link_outerbox:n on line ...
 Defining \__pdf_backend_link_sf_save: on line ...
 Defining \__pdf_backend_link_sf_restore: on line ...
+Defining \__hook cmd/@makecol/before on line ...
+Defining \g__hook_cmd/@makecol/before_code_prop on line ...
+Defining \__hook_toplevel cmd/@makecol/before on line ...
+Defining \__hook_next cmd/@makecol/before on line ...
+Defining \g__hook_cmd/@makecol/before_labels_clist on line ...
+Defining \g__hook_cmd/@makecol/before_reversed_tl on line ...
 Defining \__pdf_backend_link_last: on line ...
 Defining \__pdf_backend_link_margin:n on line ...
 Defining \__pdf_backend_destination:nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index ef4f01570..3eaeaab93 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -170,6 +170,12 @@ Defining \__pdf_backend_link_minima: on line ...
 Defining \__pdf_backend_link_outerbox:n on line ...
 Defining \__pdf_backend_link_sf_save: on line ...
 Defining \__pdf_backend_link_sf_restore: on line ...
+Defining \__hook cmd/@makecol/before on line ...
+Defining \g__hook_cmd/@makecol/before_code_prop on line ...
+Defining \__hook_toplevel cmd/@makecol/before on line ...
+Defining \__hook_next cmd/@makecol/before on line ...
+Defining \g__hook_cmd/@makecol/before_labels_clist on line ...
+Defining \g__hook_cmd/@makecol/before_reversed_tl on line ...
 Defining \__pdf_backend_link_last: on line ...
 Defining \__pdf_backend_link_margin:n on line ...
 Defining \__pdf_backend_destination:nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index ef4f01570..3eaeaab93 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -170,6 +170,12 @@ Defining \__pdf_backend_link_minima: on line ...
 Defining \__pdf_backend_link_outerbox:n on line ...
 Defining \__pdf_backend_link_sf_save: on line ...
 Defining \__pdf_backend_link_sf_restore: on line ...
+Defining \__hook cmd/@makecol/before on line ...
+Defining \g__hook_cmd/@makecol/before_code_prop on line ...
+Defining \__hook_toplevel cmd/@makecol/before on line ...
+Defining \__hook_next cmd/@makecol/before on line ...
+Defining \g__hook_cmd/@makecol/before_labels_clist on line ...
+Defining \g__hook_cmd/@makecol/before_reversed_tl on line ...
 Defining \__pdf_backend_link_last: on line ...
 Defining \__pdf_backend_link_margin:n on line ...
 Defining \__pdf_backend_destination:nn on line ...





More information about the latex3-commits mailing list.