[latex3-commits] [git/LaTeX3-latex3-latex3] master: Save data needed for link manipulation (0de28d2)

Joseph Wright joseph.wright at morningstar2.co.uk
Sat Apr 13 00:07:12 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/0de28d2d6cdc46f8334c07cd5936b6db5aabae8b

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

commit 0de28d2d6cdc46f8334c07cd5936b6db5aabae8b
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Apr 12 23:07:12 2019 +0100

    Save data needed for link manipulation
    
    Just the set up at present.
    
    We may want to look again at all of this ...


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

0de28d2d6cdc46f8334c07cd5936b6db5aabae8b
 l3kernel/l3drivers-pdf.dtx |   43 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/l3kernel/l3drivers-pdf.dtx b/l3kernel/l3drivers-pdf.dtx
index d02ac1d..f088405 100644
--- a/l3kernel/l3drivers-pdf.dtx
+++ b/l3kernel/l3drivers-pdf.dtx
@@ -295,12 +295,15 @@
 % \begin{macro}{\driver_pdf_link_goto:nnn, \driver_pdf_link_user:nnn}
 % \begin{macro}{\@@_pdf_link:nnnn}
 % \begin{macro}{\@@_pdf_link_minima:}
+% \begin{macro}{\@@_pdf_link_outerbox:n}
 % \begin{macro}
 %   {
 %     driver.linkdp.min, driver.linkht.min,
 %     driver.llx, driver.lly,
 %     driver.ury, driver.ury,
-%     driver.linkdict
+%     driver.linkdict,
+%     driver.outerbox,
+%     driver.baselineskip
 %   }
 %   Links are crated like annotations but with dedicated code to allow for
 %   adjusting the size of the rectangle. In contrast to \pkg{hyperref},
@@ -315,6 +318,9 @@
 %   that the full content is always above the link border, we do not allow
 %   this to be negative (contrast \pkg{hypdvips} approach). The result should
 %   be similar to \pdfTeX{} in the vast majority of foreseeable cases.
+%
+%  Getting the outer dimensions of the text area may be better using a two-pass
+%  approach and |\tex_savepos:D|. That plus format mode are still to re-examine.
 %    \begin{macrocode}
 \cs_new_protected:Npn \driver_pdf_link_goto:nnn #1#2#3
   { \@@_pdf_link:nnnn {#1} { /GoTo } {#2} {#3} }
@@ -334,6 +340,17 @@
         \hbox:n
           { \@@_postscript:n { driver.link.ur } }
       }
+    \exp_args:Nx \@@_driver_link_outerbox:n
+      {
+%<*initex>
+         \l_galley_total_left_margin_dim
+%</initex>
+%<*package>
+         \int_if_odd:nTF { \value { page } }
+           { \oddsidemargin }
+           { \evensidemargin }
+%</package>
+      }
     \int_gincr:N \g_@@_pdf_object_int
     \int_gset_eq:NN \g_@@_pdf_link_int \g_@@_pdf_object_int
     \@@_postscript:x
@@ -373,11 +390,35 @@
               driver.pt.dvi ~ def
       }
   }
+\cs_new_protected:Npn \@@_driver_link_outerbox:n #1
+  {
+    \@@_postscript:x
+      {
+        /driver.outerbox ~
+          [
+            \dim_to_decimal:n {#1} ~
+            \dim_to_decimal:n { -\box_dp:N \l_@@_pdf_model_box } ~
+%<*initex>
+            \dim_to_decimal:n { #1 + \l_galley_text_width_dim } ~
+%</initex>
+%<*package>
+            \dim_to_decimal:n { #1 + \linewidth } ~
+%</package>
+            \dim_to_decimal:n { -\box_dp:N \l_@@_pdf_model_box } ~
+          ] ~
+          [ exch ~ { driver.pt.dvi } ~ forall ] ~ def ~
+        /driver.baselineskip ~
+          \dim_to_decimal:n
+            { \dim_max:nn { 0pt } { \tex_baselineskip:D } } ~
+              driver.pt.dvi ~ def
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\driver_pdf_link_last:}
 %   The same as annotations, but with a custom integer.





More information about the latex3-commits mailing list