diff options
Diffstat (limited to 'macros/latex/contrib/l3backend/l3backend-pdf.dtx')
-rw-r--r-- | macros/latex/contrib/l3backend/l3backend-pdf.dtx | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/macros/latex/contrib/l3backend/l3backend-pdf.dtx b/macros/latex/contrib/l3backend/l3backend-pdf.dtx index 58c7da7f08..e74ac8286b 100644 --- a/macros/latex/contrib/l3backend/l3backend-pdf.dtx +++ b/macros/latex/contrib/l3backend/l3backend-pdf.dtx @@ -2,7 +2,7 @@ % %% File: l3backend-pdf.dtx % -% Copyright (C) 2019,2020 The LaTeX3 Project +% Copyright (C) 2019-2021 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-09-24} +% \date{Released 2021-01-09} % % \maketitle % @@ -565,7 +565,6 @@ % question about the name of the hook: to be resolved at the \LaTeXe{} % end. % \begin{macrocode} -%<*package> \use_none:n { \cs_if_exist:NT \@makecol@hook @@ -593,7 +592,6 @@ \cs_set_eq:NN \@@_breaklink_usebox:N \hbox_unpack:N } } -%</package> % \end{macrocode} % \end{macro} % @@ -622,6 +620,7 @@ % Here, we need to turn the zoom into a scale. We also need to know where % the current anchor point actually is: worked out in PostScript. For the % rectangle version, we have a bit more PostScript: we need two points. +% fitr without rule spec doesn't work, so it falls back to /Fit here. % \begin{macrocode} \cs_new_protected:Npn \@@_backend_destination:nn #1#2 { @@ -639,6 +638,7 @@ { fitbv } { /FitBV ~ pdf.dest.x } { fith } { /FitH ~ pdf.dest.y } { fitv } { /FitV ~ pdf.dest.x } + { fitr } { /Fit } } { /XYZ ~ pdf.dest.point ~ \fp_eval:n { (#2) / 100 } @@ -883,6 +883,7 @@ { fitbv } { fitbv } { fith } { fith } { fitv } { fitv } + { fitr } { fitr } } { xyz ~ zoom \fp_eval:n { #2 * 10 } } \scan_stop: @@ -1406,6 +1407,13 @@ % \end{macrocode} % \end{macro} % +% \begin{variable}{\g_@@_backend_link_int} +% To track annotations which are links. +% \begin{macrocode} +\int_new:N \g_@@_backend_link_int +% \end{macrocode} +% \end{variable} +% % \begin{macro} % {\@@_backend_link_begin_goto:nnw, \@@_backend_link_begin_user:nnw} % \begin{macro}{\@@_backend_link_begin:n} @@ -1416,11 +1424,21 @@ { \@@_backend_link_begin:n { #1 /Subtype /Link /A << /S /GoTo /D ( #2 ) >> } } \cs_new_protected:Npn \@@_backend_link_begin_user:nnw #1#2 { \@@_backend_link_begin:n {#1#2} } -\cs_new_protected:Npn \@@_backend_link_begin:n #1 +\cs_new_protected:Npx \@@_backend_link_begin:n #1 { - \@@_backend:n + \int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 } { - bann + \exp_not:N \int_gincr:N \exp_not:N \g_@@_backend_link_int + } + \@@_backend:x + { + bann ~ + \int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 } + { + @pdf.lnk + \exp_not:N \int_use:N \exp_not:N \g_@@_backend_link_int + \c_space_tl + } << /Type /Annot #1 @@ -1435,9 +1453,17 @@ % \end{macro} % % \begin{macro}{\@@_backend_link_last:} -% Data not available. +% Available using the backend mechanism with a suitably-recent +% version. % \begin{macrocode} -\cs_new:Npn \@@_backend_link_last: { } +\cs_new:Npx \@@_backend_link_last: + { + \int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 } + { + @pdf.lnk + \exp_not:N \int_use:N \exp_not:N \g_@@_backend_link_int + } + } % \end{macrocode} % \end{macro} % @@ -1453,6 +1479,7 @@ % Here, we need to turn the zoom into a scale. The method for \texttt{FitR} % is from Alexander Grahn: the idea is to avoid needing to do any calculations % in \TeX{} by using the backend data for \texttt{@xpos} and \texttt{@ypos}. +% fitr without rule spec doesn't work, so it falls back to /Fit here. % \begin{macrocode} \cs_new_protected:Npn \@@_backend_destination:nn #1#2 { @@ -1470,6 +1497,7 @@ { fitbv } { /FitBV ~ @xpos } { fith } { /FitH ~ @ypos } { fitv } { /FitV ~ @xpos } + { fitr } { /Fit } } { /XYZ ~ @xpos ~ @ypos ~ \fp_eval:n { (#2) / 100 } } ] |