From 670b438a41f5ae0f064be333560ed5a184d3859a Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 2 Nov 2021 03:03:16 +0000 Subject: CTAN sync 202111020303 --- macros/latex/contrib/pdfoverlay/pdfoverlay.dtx | 29 +++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'macros/latex/contrib/pdfoverlay/pdfoverlay.dtx') diff --git a/macros/latex/contrib/pdfoverlay/pdfoverlay.dtx b/macros/latex/contrib/pdfoverlay/pdfoverlay.dtx index 82fb0e35e3..1ae9d9ded0 100644 --- a/macros/latex/contrib/pdfoverlay/pdfoverlay.dtx +++ b/macros/latex/contrib/pdfoverlay/pdfoverlay.dtx @@ -22,10 +22,11 @@ % \changes{v1.1}{2019/11/03}{Fix deprecated macros} % \changes{v1.2}{2020/10/29}{Update to use \pkg{l3hooks}} % \changes{v1.2a}{2021/02/25}{Ensure backend loaded before counting pages} +% \changes{v1.2b}{2021/11/01}{Protect unexpandable macros} % % \title{The \pkg{pdfoverlay} package} % \author{David Purton\thanks{Email: \url{dcpurton@marshwiggle.net}}} -% \date{2021/02/25 v1.2a} +% \date{2021/11/01 v1.2b} % % \maketitle % @@ -164,7 +165,7 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[2020-10-01] -\ProvidesExplPackage{pdfoverlay}{2021/02/25}{1.2a} +\ProvidesExplPackage{pdfoverlay}{2021/11/01}{1.2b} {Overlay text on an existing PDF document (DCP)} % \end{macrocode} % @@ -322,7 +323,7 @@ % Main function to output the current page of the PDF file. This is called % before every page is shipped using the \texttt{shipout/background} hook. % \begin{macrocode} -\cs_new:Nn \@@_output_pdf_page: +\cs_new_protected:Nn \@@_output_pdf_page: { % \end{macrocode} % Check if we are currently outputting pages, a PDF file has been set, and @@ -361,7 +362,7 @@ % Format the PDF page with options from \cs{g_@@_graphics_options_clist} and % place it in \cs{g_@@_pdf_page_coffin}. % \begin{macrocode} -\cs_new:Nn \@@_format_pdf_page: +\cs_new_protected:Nn \@@_format_pdf_page: { \hcoffin_gset:Nn \g_@@_pdf_page_coffin { @@ -409,7 +410,7 @@ % with \cs{pdfoverlay_set_pdf} then \cs{g_@@_pdf_page_count_int} is set to % zero. % \begin{macrocode} -\cs_new:Nn \@@_count_pdf_pages: +\cs_new_protected:Nn \@@_count_pdf_pages: { \int_gzero:N \g_@@_page_count_int \str_if_empty:NTF \g_@@_pdf_file_name_str @@ -467,7 +468,7 @@ % Check if a PDF file has been set and the requested page is valid. If not, % generate suitable error messages. % \begin{macrocode} -\prg_new_conditional:Npnn \@@_if_page_exists:n #1 { p, T, F, TF } +\prg_new_conditional:Nnn \@@_if_page_exists:n { p, T, F, TF } { \str_if_empty:NTF \g_@@_pdf_file_name_str { @@ -500,7 +501,7 @@ % \begin{macro}{\pdfoverlay_set_pdf:n} % Specify a PDF file to overlay text on to. % \begin{macrocode} -\cs_new:Npn \pdfoverlay_set_pdf:n #1 +\cs_new_protected:Nn \pdfoverlay_set_pdf:n { % \end{macrocode} % Test if the file exists and generate a suitable error if it doesn't. @@ -532,7 +533,7 @@ % \texttt{page} option is appended automatically in the % correct format. % \begin{macrocode} -\cs_new:Nn \pdfoverlay_set_graphics_options:n +\cs_new_protected:Nn \pdfoverlay_set_graphics_options:n { \clist_gset:Nn \g_@@_graphics_options_clist { #1 } \clist_gput_right:Nn \g_@@_graphics_options_clist @@ -549,7 +550,7 @@ % \texttt{shipout/background} hook, we just insert the required number of % blank pages into the document. % \begin{macrocode} -\cs_new:Npn \pdfoverlay_include_to_page:n #1 +\cs_new_protected:Nn \pdfoverlay_include_to_page:n { % \end{macrocode} % Check if a PDF file is set and the requested page exists. @@ -606,7 +607,7 @@ % \begin{macro}{\pdfoverlay_include_to_last_page:} % Output all remaining pages in the PDF file. % \begin{macrocode} -\cs_new:Nn \pdfoverlay_include_to_last_page: +\cs_new_protected:Nn \pdfoverlay_include_to_last_page: { \pdfoverlay_include_to_page:n { \g_@@_page_count_int } } @@ -616,8 +617,8 @@ % \begin{macro}{\pdfoverlay_skip_to_page:n} % Skip to the specified page number in the PDF file. % \begin{macrocode} -\cs_new:Npn \pdfoverlay_skip_to_page:n #1 - { +\cs_new_protected:Nn \pdfoverlay_skip_to_page:n + { \@@_if_page_exists:nT { #1 } { % \end{macrocode} @@ -645,7 +646,7 @@ % \begin{macro}{\pdfoverlay_pause_output:} % Pause outputting pages from the PDF file. % \begin{macrocode} -\cs_new:Nn \pdfoverlay_pause_output: +\cs_new_protected:Nn \pdfoverlay_pause_output: { \bool_gset_false:N \g_@@_output_active_bool } @@ -655,7 +656,7 @@ % \begin{macro}{\pdfoverlay_resume_output:} % Resume outputting pages from the PDF file. % \begin{macrocode} -\cs_new:Nn \pdfoverlay_resume_output: +\cs_new_protected:Nn \pdfoverlay_resume_output: { \bool_gset_true:N \g_@@_output_active_bool } -- cgit v1.2.3