[latex3-commits] [git/LaTeX3-latex3-pdfresources] splitting: moved pages code (70e9aec)
Ulrike Fischer
fischer at troubleshooting-tex.de
Tue Jul 7 19:15:38 CEST 2020
Repository : https://github.com/latex3/pdfresources
On branch : splitting
Link : https://github.com/latex3/pdfresources/commit/70e9aec7f110ad738d9c454b709e30d389ba4f40
>---------------------------------------------------------------
commit 70e9aec7f110ad738d9c454b709e30d389ba4f40
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sat Jun 13 00:09:34 2020 +0200
moved pages code
>---------------------------------------------------------------
70e9aec7f110ad738d9c454b709e30d389ba4f40
l3pdfgdict.dtx | 46 ++++++++++++++++++++++++++++++++++++++
pdfresources.dtx | 68 ++++++++++++--------------------------------------------
2 files changed, 60 insertions(+), 54 deletions(-)
diff --git a/l3pdfgdict.dtx b/l3pdfgdict.dtx
index 22e5522..171c803 100644
--- a/l3pdfgdict.dtx
+++ b/l3pdfgdict.dtx
@@ -201,6 +201,32 @@
% \pdfgdict_gput:nnx {Info} {Title}{(\l_tmpa_str)}
% \end{verbatim}
% \end{function}
+%
+% \subsection{The \enquote{Pages} dictionary}
+% \potentialclash As the content of this dictionary is written at the end it will
+% in pdftex and luatex overwrite values added with the primitive commands (e.g.
+% \cs{pdfpagesattr}.
+% Package authors should use the management commands instead.
+
+% The content of the property list associated with this dictionary name
+% is written to the /Pages object. This replaces for example \cs{pdfpagesattr}.
+%
+% \begin{function}{pdfgdict: Pages}
+% \begin{syntax}
+% \cs{pdfgdict_gput:nnn} \{Pages\} \Arg{name} \Arg{value}
+% \end{syntax}
+%
+% Adds |/|\meta{name} \meta{value} to the |/Pages| dictionary.
+% It is always stored globally. The content is written to the pdf
+% at the end of the compilation, so values can be added, changed or
+% removed until then.
+% \meta{name} should be a valid pdf name without the leading slash,
+% \meta{value} should be a valid pdf value. Any escaping or (re)encoding must
+% be done explicitly. Some backends expand the value but this should not be
+% relied on. If a \meta{name} is used twice, only the last \meta{value}
+% set will be used.
+%
+% \end{function}
% \end{documentation}
%
% \begin{implementation}
@@ -548,6 +574,26 @@
}
% \end{macrocode}
% \end{macro}
+% The Pages dictionary code. At first the initialisation
+% \begin{macrocode}
+\@@_new:n {Pages}
+% \end{macrocode}
+%
+% \begin{macro}{\@@_Pages_gpush:}
+% This is the command that outputs the Pages dictionary. It is used
+% at the end of the document in \cs{g__pdf_backend_end_run_tl}
+% \begin{macrocode}
+% push to the register command / issue the special
+\cs_new_protected:Npn \@@_Pages_gpush:
+ {
+ \exp_args:Nx \__pdf_backend_Pages_primitive:n
+ {
+ \@@_map:n {Pages}
+ }
+ }
+
+% \end{macrocode}
+% \end{macro}
% \begin{macrocode}
%</package>
% \end{macrocode}
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 8b6cf7c..7ecc747 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -350,7 +350,7 @@
% are created in the pdfannot section \ref{pdf:annot:widget}
% \subsubsection{annot/Widget}
% \texttt{annot/Widget} see section \ref{sec:links}.
-%
+%</package>
% \subsection{The \enquote{Info} dictionary (pdfinfo)}
% \begin{NOTE}{UF}
% path: Info
@@ -393,8 +393,8 @@
% content, dvips and dvipdfmx are additive. luatex sets it in lua.
% The higher level code has to take this into account.
% \begin{macrocode}
-%pdftex
-\bool_if:nT {\sys_if_engine_pdftex_p: && \sys_if_output_pdf_p:}
+%<*pdfmode>
+\sys_if_engine_pdftex:T
{
\cs_new_protected:Npn \@@_backend_Pages_primitive:n #1
{
@@ -412,26 +412,23 @@
}
}
}
+%</pdfmode>
+%<*dvips>
%dvips
-\bool_if:nT {\sys_if_engine_pdftex_p: && !\sys_if_output_pdf_p: }
+\cs_new_protected:Npx \@@_backend_Pages_primitive:n #1
{
- \cs_new_protected:Npx \@@_backend_Pages_primitive:n #1
- {
- \tex_special:D{ps:~[#1~/PAGES~pdfmark} %]
- }
+ \tex_special:D{ps:~[#1~/PAGES~pdfmark} %]
}
-
-%xetex
-\sys_if_engine_xetex:T
+%</dvips>
+%<*xdvipdfmx>
+\cs_new_protected:Npn \@@_backend_Pages_primitive:n #1
{
- \cs_new_protected:Npn \@@_backend_Pages_primitive:n #1
- {
- \@@_backend:n{put~@pages~<<#1>>}
- }
+ \@@_backend:n{put~@pages~<<#1>>}
}
+%</xdvipdfmx>
% \end{macrocode}
% \end{macro}
-%
+%<*package>
% \subsubsection{\enquote{Pages} / management}
% \begin{NOTE}{UF}
% The register is normally used only a few times in a document, so it would be
@@ -439,44 +436,7 @@
% but with dvips/dvipdfmx this would disable removing entries.
% So we issue the push code only at the end of the document.
% \end{NOTE}
-% \begin{function}{pdfdict: Pages (global)}
-% \begin{syntax}
-% \cs{pdfdict_gput:nnn} \{Pages\} \Arg{name} \Arg{value}
-% \end{syntax}
-%
-% Adds |/|\meta{name} \meta{value} to the |/Pages| dictionary.
-% It is always stored globally. The content is written to the pdf
-% at the end of the compilation, so values can be added, changed or
-% removed until then.
-% \meta{name} should be a valid pdf name without the leading slash,
-% \meta{value} should be a valid pdf value. Any escaping or (re)encoding must
-% be done explicitly. Some backends expand the value but this should not be
-% relied on. If a \meta{name} is used twice, only the last \meta{value}
-% set will be used.
-%
-% \potentialclash As the content is written at the end it will
-% in pdftex and luatex overwrite values added with the primitive commands.
-% Package authors should use the management commands instead.
-% \end{function}
-% \begin{macrocode}
-\@@_dict_gnew:n {Pages}
-% \end{macrocode}
-%
-% \begin{macro}{\@@_dict_Pages_gpush:}
-% This is the command that outputs the Pages dictionary. It is used
-% at the end of the document in \cs{g_@@_backend_end_run_tl}
-% \begin{macrocode}
-% push to the register command / issue the special
-\cs_new_protected:Npn \@@_dict_Pages_gpush:
- {
- \exp_args:Nx \@@_backend_Pages_primitive:n
- {
- \@@_dict_map:n {Pages}
- }
- }
-
-% \end{macrocode}
-% \end{macro}
+% moved to l3pdfgdict
%
% \subsection{\enquote{Page} and \enquote{ThisPage} (pdfpageattr)}
% \subsubsection{\enquote{Page} and \enquote{ThisPage} /backend}
More information about the latex3-commits
mailing list.