[latex3-commits] [git/LaTeX3-latex3-latex3] pdf_destination: adapt destination command (d1243899e)
Ulrike Fischer
fischer at troubleshooting-tex.de
Sun Jan 17 21:59:29 CET 2021
Repository : https://github.com/latex3/latex3
On branch : pdf_destination
Link : https://github.com/latex3/latex3/commit/d1243899e3f2d51080b1917aa668180423dc6ddb
>---------------------------------------------------------------
commit d1243899e3f2d51080b1917aa668180423dc6ddb
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sun Jan 17 21:59:29 2021 +0100
adapt destination command
changed destination_box command
>---------------------------------------------------------------
d1243899e3f2d51080b1917aa668180423dc6ddb
l3experimental/l3pdf/l3pdf.dtx | 47 ++++++++++++++++++++++++++++++------------
1 file changed, 34 insertions(+), 13 deletions(-)
diff --git a/l3experimental/l3pdf/l3pdf.dtx b/l3experimental/l3pdf/l3pdf.dtx
index 536093e01..ce40d3b12 100644
--- a/l3experimental/l3pdf/l3pdf.dtx
+++ b/l3experimental/l3pdf/l3pdf.dtx
@@ -231,16 +231,16 @@
% \end{tabular}
%
% \end{function}
-% \begin{function}[added = 2020-01-03]
-% {\pdf_destination_box:nn}
+%
+% \begin{function}[added = 2021-01-17]
+% {\pdf_destination:nnnn}
% \begin{syntax}
-% \cs{pdf_destination_box:nn} \Arg{name} \Arg{content}
+% \cs{pdf_destination:nnnn} \Arg{name} \Arg{width} \Arg{height} \Arg{depth}
% \end{syntax}
-% This stores the content in a hbox, outputs the box and
-% creates a destination with |/FitR| type encompassing this box. This works for
-% all drivers so is the preferred method to create a |/FitR| destination.
+% This creates a destination with |/FitR| type with the given dimensions relativ
+% to the current location. The destination is in a box of size zero, but it doesn't
+% switch to horizontal mode.
% \end{function}
-%
% \end{documentation}
%
% \begin{implementation}
@@ -414,17 +414,38 @@
% \end{macro}
%
% \subsection{Destinations}
-% \begin{macro}{\pdf_destination:nn,\pdf_destination_box:nn}
+% \begin{macro}{\pdf_destination:nn}
% \begin{macrocode}
\cs_new_protected:Npn \pdf_destination:nn #1 #2
{
\@@_backend_destination:nn {#1}{#2}
}
-
-\cs_new_protected:Npn \pdf_destination_box:nn #1 #2
- {
- \@@_backend_destination_box:nn { #1 }{ #2 }
- }
+% \end{macrocode}
+% \end{macro}
+% \begin{variable}{\l_@@_tmpa_box,\l_@@_tmpb_box}
+% \begin{macrocode}
+\box_new:N \l_@@_tmpa_box
+\box_new:N \l_@@_tmpb_box
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\pdf_destination:nnnn}
+% \begin{macrocode}
+\cs_new_protected:Npn \pdf_destination:nnnn #1 #2 #3 #4
+ {
+ \hbox_set_to_wd:Nnn \l_@@_tmpa_box {#2} {}
+ \box_set_ht:Nn \l_@@_tmpa_box {#3}
+ \box_set_dp:Nn \l_@@_tmpa_box {#4}
+ \hbox_set_to_wd:Nnn \l_@@_tmpb_box {0pt}
+ {
+ \@@_backend_destination_box:nn
+ { #1 }
+ { \box_use:N \l_@@_tmpa_box }
+ }
+ \box_set_dp:Nn \l_@@_tmpb_box {0pt}
+ \box_set_ht:Nn \l_@@_tmpb_box {0pt}
+ \box_use:N\l_@@_tmpb_box
+ }
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
More information about the latex3-commits
mailing list.