From 37168a3aca3950d1cc6a939d43aec01fe8805243 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 13 Feb 2023 20:53:21 +0000 Subject: postnotes (13feb23) git-svn-id: svn://tug.org/texlive/trunk@65820 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/postnotes/postnotes.dtx | 103 +++++++++++---------- .../source/latex/postnotes/postnotes.ins | 4 +- 2 files changed, 57 insertions(+), 50 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/postnotes/postnotes.dtx b/Master/texmf-dist/source/latex/postnotes/postnotes.dtx index b6a9a15572c..fab2cb99144 100644 --- a/Master/texmf-dist/source/latex/postnotes/postnotes.dtx +++ b/Master/texmf-dist/source/latex/postnotes/postnotes.dtx @@ -4,7 +4,7 @@ % % This file is part of the LaTeX package "postnotes". % -% Copyright (C) 2022 Gustavo Barros +% Copyright (C) 2022-2023 Gustavo Barros % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -153,7 +153,7 @@ % % % \begin{macrocode} -\ProvidesExplPackage {postnotes} {2022-12-28} {0.2.0} +\ProvidesExplPackage {postnotes} {2023-02-13} {0.2.1} {Endnotes for LaTeX} % \end{macrocode} % @@ -175,16 +175,23 @@ % \end{macro} % % +% \pkg{postnotes} provides a number of hooks from the new hook system to grant +% some points of access in key places of the package. Note that hooks created +% with \cs{NewHook} are meant to be public interfaces (see +% \url{https://chat.stackexchange.com/transcript/message/62955941#62955941}, +% and following discussion). +% +% % \begin{macro}{\@@_store:nn} % Stores the metadata and \meta{note content} of \cs{postnote} with ID % \meta{note id}, from where it is called. The -% \texttt{postnotes/store/note} hook is intended to add further data to the +% \texttt{postnotes/note/store} hook is intended to add further data to the % note, when required to support packages with specific needs. % \begin{syntax} % \cs{@@_store:nn} \Arg{note id} \Arg{note content} % \end{syntax} % \begin{macrocode} -\NewHook { postnotes/store/note } +\NewHook { postnotes/note/store } \cs_new_protected:Npn \@@_store:nn #1#2 { \prop_new:c { \@@_data_name:e {#1} } @@ -213,7 +220,7 @@ \prop_gput:cnx { \@@_data_name:e {#1} } { multibool } { \bool_to_str:N \l_@@_maybe_multi_bool } \prop_gput:cnn { \@@_data_name:e {#1} } { content } {#2} - \UseHook { postnotes/store/note } + \UseHook { postnotes/note/store } } % \end{macrocode} % \end{macro} @@ -811,20 +818,20 @@ % \begin{macro} % { % \g_@@_note_id_int , -% \l_@@_note_id_tl , +% \l_postnotes_note_id_tl , % \g_@@_queue_seq , % } % \cs{g_@@_note_id_int} is the internal, unique counter which provides the % ID number of each note. It ties ``mark'' and ``text'' together, is also % the connection between each note and its data, including the content, % which is stored in a property list named according to \cs{@@_data_name:n} -% and the ID number. \cs{l_@@_note_id_tl} is a convenience variable storing -% the counter's value. \cs{g_@@_queue_seq} stores the sequence of notes' -% IDs that to be processed by the next call of \cs{printpostnotes}. +% and the ID number. \cs{l_postnotes_note_id_tl} is a convenience variable +% storing the counter's value. \cs{g_@@_queue_seq} stores the sequence of +% notes' IDs to be processed by the next call of \cs{printpostnotes}. % \begin{macrocode} \int_new:N \g_@@_note_id_int -\tl_new:N \l_@@_note_id_tl -\tl_set:Nn \l_@@_note_id_tl { \int_use:N \g_@@_note_id_int } +\tl_new:N \l_postnotes_note_id_tl +\tl_set:Nn \l_postnotes_note_id_tl { \int_use:N \g_@@_note_id_int } \seq_new:N \g_@@_queue_seq % \end{macrocode} % \end{macro} @@ -866,19 +873,19 @@ \tl_set:Nx \l_@@_mark_tl { \thepostnote } } \seq_gput_right:Nx \g_@@_queue_seq - { \l_@@_note_id_tl } + { \l_postnotes_note_id_tl } \UseHook { postnotes/note/begin } \cs_set:Npn \@currentcounter { postnote } \cs_set:Npx \@currentlabel { \p@postnote \l_@@_mark_tl } - \MakeLinkTarget* { postnote. \l_@@_note_id_tl .mark } - \@@_set_mark_page_label:x { \l_@@_note_id_tl } + \MakeLinkTarget* { postnote. \l_postnotes_note_id_tl .mark } + \@@_set_mark_page_label:x { \l_postnotes_note_id_tl } \@@_set_user_labels: \bool_if:NF \l_@@_nomark_bool { \@@_typeset_mark:xV - { \l_@@_note_id_tl } \l_@@_mark_tl + { \l_postnotes_note_id_tl } \l_@@_mark_tl } - \@@_store:nn { \l_@@_note_id_tl } {#2} + \@@_store:nn { \l_postnotes_note_id_tl } {#2} } \group_end: } @@ -1107,12 +1114,12 @@ \group_begin: \int_gincr:N \g_@@_sectid_int \int_gincr:N \g_@@_note_id_int - \seq_gput_right:Nx \g_@@_queue_seq { \l_@@_note_id_tl } + \seq_gput_right:Nx \g_@@_queue_seq { \l_postnotes_note_id_tl } \tl_gclear:N \g_@@_section_name_tl \keys_set:nn { postnotes/section } {#1} \bool_if:NTF \l_@@_section_exp_bool - { \@@_store_section:nx { \l_@@_note_id_tl } {#2} } - { \@@_store_section:nn { \l_@@_note_id_tl } {#2} } + { \@@_store_section:nx { \l_postnotes_note_id_tl } {#2} } + { \@@_store_section:nn { \l_postnotes_note_id_tl } {#2} } \group_end: } % \end{macrocode} @@ -1173,7 +1180,7 @@ % \begin{macro} % { % \g_@@_print_postnotes_int , -% \l_@@_print_note_id_tl , +% \l_postnotes_print_note_id_tl , % \l_@@_print_note_id_next_tl , % \l_@@_print_counter_tl , % \l_@@_print_mark_tl , @@ -1186,7 +1193,7 @@ % Auxiliary variables for \cs{@@_print_notes:}. % \begin{macrocode} \int_new:N \g_@@_print_postnotes_int -\tl_new:N \l_@@_print_note_id_tl +\tl_new:N \l_postnotes_print_note_id_tl \tl_new:N \l_@@_print_note_id_next_tl \tl_new:N \l_@@_print_counter_tl \tl_new:N \l_@@_print_mark_tl @@ -1285,8 +1292,8 @@ \bool_until_do:nn { \seq_if_empty_p:N \g_@@_queue_seq } { \seq_gpop_left:NN \g_@@_queue_seq - \l_@@_print_note_id_tl - \@@_prop_get:nnN { \l_@@_print_note_id_tl } + \l_postnotes_print_note_id_tl + \@@_prop_get:nnN { \l_postnotes_print_note_id_tl } { type } \l_@@_print_type_curr_tl \tl_if_eq:NnTF \l_@@_print_type_curr_tl { section } { % type_curr = `section' @@ -1311,10 +1318,10 @@ \stepcounter { postnotesection } \group_begin: \@@_prop_get:nnN - { \l_@@_print_note_id_tl } + { \l_postnotes_print_note_id_tl } { thechapter } \pnthechapter \@@_prop_get:nnN - { \l_@@_print_note_id_tl } + { \l_postnotes_print_note_id_tl } { thesection } \pnthesection \@@_prop_get:nnN { \l_@@_print_note_id_next_tl } @@ -1323,7 +1330,7 @@ { \l_@@_print_note_id_next_tl } { thesection } \pnthesectionnextnote \@@_prop_get:nnN - { \l_@@_print_note_id_tl } + { \l_postnotes_print_note_id_tl } { content } \l_@@_print_content_tl \l_@@_print_content_tl \group_end: @@ -1345,15 +1352,15 @@ \group_begin: \UseHook { postnotes/print/eachnote } \@@_get_pageref:Nx \pnthepage - { mark@ \l_@@_print_note_id_tl } + { mark@ \l_postnotes_print_note_id_tl } \@@_prop_get:nnN - { \l_@@_print_note_id_tl } + { \l_postnotes_print_note_id_tl } { mark } \l_@@_print_mark_tl \@@_prop_get:nnN - { \l_@@_print_note_id_tl } + { \l_postnotes_print_note_id_tl } { counter } \l_@@_print_counter_tl \@@_prop_get:nnN - { \l_@@_print_note_id_tl } + { \l_postnotes_print_note_id_tl } { content } \l_@@_print_content_tl \cs_set:Npn \@currentcounter { postnotetext } \int_set:Nn \c@postnotetext @@ -1363,11 +1370,11 @@ \@@_text_mark_wrapper:n { \MakeLinkTarget* - { postnote. \l_@@_print_note_id_tl .text } + { postnote. \l_postnotes_print_note_id_tl .text } \@@_set_text_page_label:x - { \l_@@_print_note_id_tl } + { \l_postnotes_print_note_id_tl } \@@_typeset_text_mark:eV - { \l_@@_print_note_id_tl } + { \l_postnotes_print_note_id_tl } \l_@@_print_mark_tl } \l_@@_print_content_tl @@ -2042,16 +2049,16 @@ % \end{macrocode} % Store \pkg{biblatex} variables for each note. % \begin{macrocode} - \AddToHook { postnotes/store/note } [ postnotes ] + \AddToHook { postnotes/note/store } [ postnotes ] { - \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + \prop_gput:cnx { \@@_data_name:e { \l_postnotes_note_id_tl } } { biblatex@refsection } { \int_use:N \c@refsection } - \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + \prop_gput:cnx { \@@_data_name:e { \l_postnotes_note_id_tl } } { biblatex@refsegment } { \int_use:N \c@refsegment } - \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + \prop_gput:cnx { \@@_data_name:e { \l_postnotes_note_id_tl } } { biblatex@refcontextbool } { \iftoggle { blx@refcontext } { true } { false } } - \prop_gput:cnV { \@@_data_name:e { \l_@@_note_id_tl } } + \prop_gput:cnV { \@@_data_name:e { \l_postnotes_note_id_tl } } { biblatex@refcontext } \blx@refcontext@context } % \end{macrocode} @@ -2067,16 +2074,16 @@ % \begin{macrocode} \AddToHook { postnotes/print/eachnote } [ postnotes ] { - \@@_prop_get:nnN { \l_@@_print_note_id_tl } + \@@_prop_get:nnN { \l_postnotes_print_note_id_tl } { biblatex@refsection } \l_@@_restore_tmp_tl \int_set:Nn \c@refsection { \l_@@_restore_tmp_tl } - \@@_prop_get:nnN { \l_@@_print_note_id_tl } + \@@_prop_get:nnN { \l_postnotes_print_note_id_tl } { biblatex@refsegment } \l_@@_restore_tmp_tl \int_set:Nn \c@refsegment { \l_@@_restore_tmp_tl } - \@@_prop_get:nnN { \l_@@_print_note_id_tl } + \@@_prop_get:nnN { \l_postnotes_print_note_id_tl } { biblatex@refcontextbool } \l_@@_restore_tmp_tl \use:c { toggle \l_@@_restore_tmp_tl } { blx@refcontext } - \@@_prop_get:nnN { \l_@@_print_note_id_tl } + \@@_prop_get:nnN { \l_postnotes_print_note_id_tl } { biblatex@refcontext } \l_@@_restore_tmp_tl \blx@edef@refcontext { \l_@@_restore_tmp_tl } } @@ -2196,7 +2203,7 @@ } \AddToHook { postnotes/print/eachnote } [ postnotes ] { - \@@_prop_get:nnN { \l_@@_print_note_id_tl } + \@@_prop_get:nnN { \l_postnotes_print_note_id_tl } { biblatex@refsection } \l_@@_restore_tmp_tl \tl_if_eq:NNF \l_@@_restore_tmp_tl @@ -2311,19 +2318,19 @@ { \IfPackageAtLeastTF { zref-check } { 2022-07-05 } { - \AddToHook { postnotes/store/note } [ postnotes ] + \AddToHook { postnotes/note/store } [ postnotes ] { - \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + \prop_gput:cnx { \@@_data_name:e { \l_postnotes_note_id_tl } } { zref-check@abschap } { \int_use:N \c@zc@abschap } - \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + \prop_gput:cnx { \@@_data_name:e { \l_postnotes_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 } + \@@_prop_get:nnN { \l_postnotes_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 } + \@@_prop_get:nnN { \l_postnotes_print_note_id_tl } { zref-check@abssec } \l_@@_restore_tmp_tl \int_set:Nn \c@zc@abssec { \l_@@_restore_tmp_tl } } diff --git a/Master/texmf-dist/source/latex/postnotes/postnotes.ins b/Master/texmf-dist/source/latex/postnotes/postnotes.ins index e8c217a13b1..3897fb0534d 100644 --- a/Master/texmf-dist/source/latex/postnotes/postnotes.ins +++ b/Master/texmf-dist/source/latex/postnotes/postnotes.ins @@ -4,7 +4,7 @@ % % This file is part of the LaTeX package "postnotes". % -% Copyright (C) 2022 Gustavo Barros +% Copyright (C) 2022-2023 Gustavo Barros % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -50,7 +50,7 @@ This file was generated from file(s) of the LaTeX package "postnotes". -Copyright (C) 2022 Gustavo Barros +Copyright (C) 2022-2023 Gustavo Barros It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this -- cgit v1.2.3