From b70fc3fabe4489f1b839f898132a64e206b1feb6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 6 Jul 2022 20:18:37 +0000 Subject: postnotes (6jul22) git-svn-id: svn://tug.org/texlive/trunk@63822 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/postnotes/postnotes.dtx | 64 +++++++++++++++++----- 1 file changed, 49 insertions(+), 15 deletions(-) (limited to 'Master/texmf-dist/source/latex') diff --git a/Master/texmf-dist/source/latex/postnotes/postnotes.dtx b/Master/texmf-dist/source/latex/postnotes/postnotes.dtx index 7124ed7d70e..489c40bf5d3 100644 --- a/Master/texmf-dist/source/latex/postnotes/postnotes.dtx +++ b/Master/texmf-dist/source/latex/postnotes/postnotes.dtx @@ -147,7 +147,7 @@ % % % \begin{macrocode} -\ProvidesExplPackage {postnotes} {2022-05-28} {0.1.3} +\ProvidesExplPackage {postnotes} {2022-07-06} {0.1.4} {Endnotes for LaTeX} % \end{macrocode} % @@ -1338,7 +1338,7 @@ { content } \l_@@_print_content_tl \cs_set:Npn \@currentcounter { postnotetext } \int_set:Nn \c@postnotetext - { \int_eval:n { \l_@@_print_counter_tl } } + { \l_@@_print_counter_tl } \cs_set:Npx \@currentlabel { \p@postnote \l_@@_print_mark_tl } \@@_hyperref_make_currentHref:n @@ -1940,6 +1940,12 @@ % % \section{Compatibility} % +% A dedicated temp variable for restoring data. +% +% \begin{macrocode} +\tl_new:N \l_@@_restore_tmp_tl +% \end{macrocode} +% % \subsection*{\cs{caption}} % % For \cs{caption}'s possible two passes. This catches more than just @@ -2055,21 +2061,20 @@ % \end{macrocode} % Restore \pkg{biblatex} variables for each note. % \begin{macrocode} - \tl_new:N \l_@@_biblatex_restore_tl \AddToHook { postnotes/print/eachnote } [ postnotes ] { \@@_prop_get:nnN { \l_@@_print_note_id_tl } - { biblatex@refsection } \l_@@_biblatex_restore_tl - \int_set:Nn \c@refsection { \l_@@_biblatex_restore_tl } + { biblatex@refsection } \l_@@_restore_tmp_tl + \int_set:Nn \c@refsection { \l_@@_restore_tmp_tl } \@@_prop_get:nnN { \l_@@_print_note_id_tl } - { biblatex@refsegment } \l_@@_biblatex_restore_tl - \int_set:Nn \c@refsegment { \l_@@_biblatex_restore_tl } + { biblatex@refsegment } \l_@@_restore_tmp_tl + \int_set:Nn \c@refsegment { \l_@@_restore_tmp_tl } \@@_prop_get:nnN { \l_@@_print_note_id_tl } - { biblatex@refcontextbool } \l_@@_biblatex_restore_tl - \use:c { toggle \l_@@_biblatex_restore_tl } { blx@refcontext } + { biblatex@refcontextbool } \l_@@_restore_tmp_tl + \use:c { toggle \l_@@_restore_tmp_tl } { blx@refcontext } \@@_prop_get:nnN { \l_@@_print_note_id_tl } - { biblatex@refcontext } \l_@@_biblatex_restore_tl - \blx@edef@refcontext { \l_@@_biblatex_restore_tl } + { biblatex@refcontext } \l_@@_restore_tmp_tl + \blx@edef@refcontext { \l_@@_restore_tmp_tl } } % \end{macrocode} % Make \pkg{biblatex}'s \cs{mkbibendnote} use \cs{postnote}. This is very @@ -2204,15 +2209,15 @@ \AddToHook { postnotes/print/eachnote } [ postnotes ] { \@@_prop_get:nnN { \l_@@_print_note_id_tl } - { biblatex@refsection } \l_@@_biblatex_restore_tl + { biblatex@refsection } \l_@@_restore_tmp_tl \tl_if_eq:NNF - \l_@@_biblatex_restore_tl + \l_@@_restore_tmp_tl \g_@@_biblatex_prev_refsection_tl { \int_set:Nn \c@blx@maxsection - { \l_@@_biblatex_restore_tl - 1 } + { \l_@@_restore_tmp_tl - 1 } \tl_gset_eq:NN \g_@@_biblatex_prev_refsection_tl - \l_@@_biblatex_restore_tl + \l_@@_restore_tmp_tl \group_begin: \cs_set_eq:NN \label \use_none:n \cs_set_eq:NN \blx@info \use_none:n @@ -2308,6 +2313,35 @@ % \end{macrocode} % % +% \subsection*{\pkg{zref-check}} +% +% \begin{macrocode} +\AddToHook { package/zref-check/after } + { + \IfPackageAtLeastTF { zref-check } { 2022-07-05 } + { + \AddToHook { postnotes/store/note } [ postnotes ] + { + \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + { zref-check@abschap } { \int_use:N \c@zc@abschap } + \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + { zref-check@abssec } { \int_use:N \c@zc@abssec } + } + \AddToHook { postnotes/print/eachnote } [ postnotes ] + { + \@@_prop_get:nnN { \l_@@_print_note_id_tl } + { zref-check@abschap } \l_@@_restore_tmp_tl + \int_set:Nn \c@zc@abschap { \l_@@_restore_tmp_tl } + \@@_prop_get:nnN { \l_@@_print_note_id_tl } + { zref-check@abssec } \l_@@_restore_tmp_tl + \int_set:Nn \c@zc@abssec { \l_@@_restore_tmp_tl } + } + } + { } + } +% \end{macrocode} +% +% % \subsection*{\pkg{amsmath}} % % \begin{macrocode} -- cgit v1.2.3