texlive[73045] Master/texmf-dist: postnotes (5dec24)
commits+karl at tug.org
commits+karl at tug.org
Thu Dec 5 22:22:45 CET 2024
Revision: 73045
https://tug.org/svn/texlive?view=revision&revision=73045
Author: karl
Date: 2024-12-05 22:22:45 +0100 (Thu, 05 Dec 2024)
Log Message:
-----------
postnotes (5dec24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md
trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf
trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.pdf
trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx
trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty
Modified: trunk/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md 2024-12-05 21:22:35 UTC (rev 73044)
+++ trunk/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md 2024-12-05 21:22:45 UTC (rev 73045)
@@ -1,7 +1,23 @@
# Changelog
-## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.5.0...HEAD)
+## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.5.1...HEAD)
+## [v0.5.1](https://github.com/gusbrs/postnotes/compare/v0.5.0...v0.5.1) (2024-12-05)
+
+### Changed
+- The "legacy" version of the header support variables deprecated in v0.5.0
+ (see previous release notes in the change log) have been put under the new
+ `deprecatedheadervars` option, which is opt-in, disabled by default.
+ - The affected variables are, namely, `\pnhdpagefirst`, `\pnhdpagelast`,
+ `\pnhdchapfirst`, `\pnhdchaplast`, `\pnhdsectfirst`, `\pnhdsectlast`,
+ `\pnhdnamefirst`, and `\pnhdnamelast`.
+ - Unless `deprecatedheadervars` is enabled, the use of any of these
+ variables will result in an error, but with an informative message,
+ recommending the use of the new `ltmarks` mark classes but also offering
+ the `deprecatedheadervars` option as a temporary quick fix.
+ - This option will only be offered for a transitional period and will be
+ removed in the future.
+
## [v0.5.0](https://github.com/gusbrs/postnotes/compare/v0.4.2...v0.5.0) (2024-12-03)
### Changed
Modified: trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx 2024-12-05 21:22:35 UTC (rev 73044)
+++ trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx 2024-12-05 21:22:45 UTC (rev 73045)
@@ -153,7 +153,7 @@
%
%
% \begin{macrocode}
-\ProvidesExplPackage {postnotes} {2024-12-03} {0.5.0}
+\ProvidesExplPackage {postnotes} {2024-12-05} {0.5.1}
{Endnotes for LaTeX}
% \end{macrocode}
%
@@ -412,7 +412,6 @@
% \@@_set_mark_page_label:nn ,
% \@@_set_section_page_label:n ,
% \@@_set_print_label:n ,
-% \c_@@_page_counter_tl ,
% }
% Label setting functions for each pertinent context. They must use
% \cs{iow_shipout_e:Nn}, since the main information we are interested in is
@@ -1835,8 +1834,7 @@
\@@_check_duplicates:N \g_@@_print_queue_seq
\@@_sort_queue:N \g_@@_print_queue_seq
\@@_check_floats:N \g_@@_print_queue_seq
- \bool_gset_true:N \g_@@_header_vars_next_bool
- \@@_set_headers_vars_first:
+ \@@_set_header_vars_first:
% \end{macrocode}
% Ensure the first note after a heading has paragraph indentation when
% \opt{listenv} is \texttt{none}. \pkg{endnotes} uses a workaroundish
@@ -2040,8 +2038,7 @@
\l_@@_print_type_curr_tl
}
}
- \AddToHookNext { shipout/after }
- { \bool_gset_false:N \g_@@_header_vars_next_bool }
+ \@@_set_header_vars_bool:
% \end{macrocode}
% We won't use the variables anymore, clear them to reduce memory usage.
% \begin{macrocode}
@@ -2414,6 +2411,24 @@
% migrating sooner rather than later.
%
% \begin{macrocode}
+\bool_new:N \l_@@_deprecated_headervars_bool
+\keys_define:nn { postnotes/setup }
+ {
+ deprecatedheadervars .bool_set:N = \l_@@_deprecated_headervars_bool ,
+ deprecatedheadervars .default:n = true ,
+ deprecatedheadervars .initial:n = false ,
+ }
+\AddToHook { begindocument }
+ {
+ \keys_define:nn { postnotes/setup }
+ {
+ deprecatedheadervars .code:n =
+ {
+ \msg_warning:nnn { postnotes }
+ { option-preamble-only } { deprecatedheadervars }
+ } ,
+ }
+ }
\tl_new:N \pnhdpagefirst
\tl_new:N \pnhdpagelast
\tl_new:N \pnhdchapfirst
@@ -2422,94 +2437,139 @@
\tl_new:N \pnhdsectlast
\tl_new:N \pnhdnamefirst
\tl_new:N \pnhdnamelast
-% \end{macrocode}
-%
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_set_headers_vars:n #1
+\tl_gset:Nn \pnhdpagefirst
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdpagefirst } }
+\tl_gset:Nn \pnhdpagelast
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdpagelast } }
+\tl_gset:Nn \pnhdchapfirst
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdchapfirst } }
+\tl_gset:Nn \pnhdchaplast
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdchaplast } }
+\tl_gset:Nn \pnhdsectfirst
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdsectfirst } }
+\tl_gset:Nn \pnhdsectlast
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdsectlast } }
+\tl_gset:Nn \pnhdnamefirst
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdnamefirst } }
+\tl_gset:Nn \pnhdnamelast
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdnamelast } }
+\msg_new:nnn { postnotes } { deprecatedheadervars }
{
- \group_begin:
- \protected at xdef \pnhdpagefirst
- { \property_ref:nn { #1 } { postnotes/page/first } }
- \protected at xdef \pnhdpagelast
- { \property_ref:nn { #1 } { postnotes/page/last } }
- \protected at xdef \pnhdchapfirst
- { \property_ref:nn { #1 } { postnotes/chapter/first } }
- \protected at xdef \pnhdchaplast
- { \property_ref:nn { #1 } { postnotes/chapter/last } }
- \protected at xdef \pnhdsectfirst
- { \property_ref:nn { #1 } { postnotes/section/first } }
- \protected at xdef \pnhdsectlast
- { \property_ref:nn { #1 } { postnotes/section/last } }
- \protected at xdef \pnhdnamefirst
- { \property_ref:nn { #1 } { postnotes/sectname/first } }
- \protected at xdef \pnhdnamelast
- { \property_ref:nn { #1 } { postnotes/sectname/last } }
- \group_end:
+ '\iow_char:N\\ #1'~is~deprecated~\msg_line_context:.~
+ You~should~migrate~to~the~new~'ltmarks'~(see~User~manual),~but~for~
+ a~temporary~quick~fix~you~can~enable~the~'deprecatedheadervars'~option.
}
-\cs_generate_variant:Nn \@@_set_headers_vars:n { e }
+\cs_set_eq:NN \@@_set_header_vars_first: \prg_do_nothing:
+\cs_set_eq:NN \@@_set_header_vars_bool: \prg_do_nothing:
% \end{macrocode}
%
% \begin{macrocode}
-\property_new:nnnn { postnotes/page/first } { shipout } { }
- { \FirstMark { postnotes/page } }
-\property_new:nnnn { postnotes/page/last } { shipout } { }
- { \LastMark { postnotes/page } }
-\property_new:nnnn { postnotes/chapter/first } { shipout } { }
- { \FirstMark { postnotes/chapter } }
-\property_new:nnnn { postnotes/chapter/last } { shipout } { }
- { \LastMark { postnotes/chapter } }
-\property_new:nnnn { postnotes/section/first } { shipout } { }
- { \FirstMark { postnotes/section } }
-\property_new:nnnn { postnotes/section/last } { shipout } { }
- { \LastMark { postnotes/section } }
-\property_new:nnnn { postnotes/sectname/first } { shipout } { }
- { \FirstMark { postnotes/sectname } }
-\property_new:nnnn { postnotes/sectname/last } { shipout } { }
- { \LastMark { postnotes/sectname } }
-\clist_const:Nn \c_@@_header_marks_clist
+\AddToHook { begindocument }
{
- postnotes/page/first ,
- postnotes/page/last ,
- postnotes/chapter/first ,
- postnotes/chapter/last ,
- postnotes/section/first ,
- postnotes/section/last ,
- postnotes/sectname/first ,
- postnotes/sectname/last ,
- }
-\AddToHook { shipout/before } [ ./header ]
- { \@@_set_headers_vars_next: }
-\bool_new:N \g_@@_header_vars_next_bool
-\int_new:N \g_@@_print_header_vars_int
-\cs_new_protected:Npn \@@_set_headers_vars_next:
- {
- \bool_if:NT \g_@@_header_vars_next_bool
+ \bool_if:NT \l_@@_deprecated_headervars_bool
{
- \int_gincr:N \g_@@_print_header_vars_int
- \exp_args:Ne \property_record:nN
- { __postnotes_header_ \int_use:N \g_@@_print_header_vars_int }
- \c_@@_header_marks_clist
- \@@_set_headers_vars:e
- { __postnotes_header_ \int_use:N \g_@@_print_header_vars_int }
+ \property_new:nnnn { postnotes/page/first } { shipout } { }
+ { \FirstMark { postnotes/page } }
+ \property_new:nnnn { postnotes/page/last } { shipout } { }
+ { \LastMark { postnotes/page } }
+ \property_new:nnnn { postnotes/chapter/first } { shipout } { }
+ { \FirstMark { postnotes/chapter } }
+ \property_new:nnnn { postnotes/chapter/last } { shipout } { }
+ { \LastMark { postnotes/chapter } }
+ \property_new:nnnn { postnotes/section/first } { shipout } { }
+ { \FirstMark { postnotes/section } }
+ \property_new:nnnn { postnotes/section/last } { shipout } { }
+ { \LastMark { postnotes/section } }
+ \property_new:nnnn { postnotes/sectname/first } { shipout } { }
+ { \FirstMark { postnotes/sectname } }
+ \property_new:nnnn { postnotes/sectname/last } { shipout } { }
+ { \LastMark { postnotes/sectname } }
+ \clist_const:Nn \c_@@_header_marks_clist
+ {
+ postnotes/page/first ,
+ postnotes/page/last ,
+ postnotes/chapter/first ,
+ postnotes/chapter/last ,
+ postnotes/section/first ,
+ postnotes/section/last ,
+ postnotes/sectname/first ,
+ postnotes/sectname/last ,
+ }
+ \cs_new_protected:Npn \@@_set_header_vars:n #1
+ {
+ \group_begin:
+ \protected at xdef \pnhdpagefirst
+ { \property_ref:nn { #1 } { postnotes/page/first } }
+ \protected at xdef \pnhdpagelast
+ { \property_ref:nn { #1 } { postnotes/page/last } }
+ \protected at xdef \pnhdchapfirst
+ { \property_ref:nn { #1 } { postnotes/chapter/first } }
+ \protected at xdef \pnhdchaplast
+ { \property_ref:nn { #1 } { postnotes/chapter/last } }
+ \protected at xdef \pnhdsectfirst
+ { \property_ref:nn { #1 } { postnotes/section/first } }
+ \protected at xdef \pnhdsectlast
+ { \property_ref:nn { #1 } { postnotes/section/last } }
+ \protected at xdef \pnhdnamefirst
+ { \property_ref:nn { #1 } { postnotes/sectname/first } }
+ \protected at xdef \pnhdnamelast
+ { \property_ref:nn { #1 } { postnotes/sectname/last } }
+ \group_end:
+ }
+ \cs_generate_variant:Nn \@@_set_header_vars:n { e }
+ \bool_new:N \g_@@_header_vars_next_bool
+ \int_new:N \g_@@_print_header_vars_int
+ \cs_new_protected:Npn \@@_set_headers_vars_next:
+ {
+ \bool_if:NT \g_@@_header_vars_next_bool
+ {
+ \int_gincr:N \g_@@_print_header_vars_int
+ \exp_args:Ne \property_record:nN
+ {
+ __postnotes_header_
+ \int_use:N \g_@@_print_header_vars_int
+ }
+ \c_@@_header_marks_clist
+ \@@_set_header_vars:e
+ {
+ __postnotes_header_
+ \int_use:N \g_@@_print_header_vars_int
+ }
+ }
+ }
+ \AddToHook { shipout/before } [ ./header ]
+ { \@@_set_headers_vars_next: }
+ \cs_set_protected:Npn \@@_set_header_vars_first:
+ {
+ \bool_gset_true:N \g_@@_header_vars_next_bool
+ \tl_gset:Nn \pnhdpagefirst { \FirstMark{postnotes/page} }
+ \tl_gset:Nn \pnhdpagelast { \LastMark{postnotes/page} }
+ \tl_gset:Nn \pnhdchapfirst { \FirstMark{postnotes/chapter} }
+ \tl_gset:Nn \pnhdchaplast { \LastMark{postnotes/chapter} }
+ \tl_gset:Nn \pnhdsectfirst { \FirstMark{postnotes/section} }
+ \tl_gset:Nn \pnhdsectlast { \LastMark{postnotes/section} }
+ \tl_gset:Nn \pnhdnamefirst { \FirstMark{postnotes/sectname} }
+ \tl_gset:Nn \pnhdnamelast { \LastMark{postnotes/sectname} }
+ \int_gincr:N \g_@@_print_header_vars_int
+ \exp_args:Ne \property_record:nN
+ {
+ __postnotes_header_
+ \int_use:N \g_@@_print_header_vars_int
+ }
+ \c_@@_header_marks_clist
+ \@@_set_header_vars:e
+ {
+ __postnotes_header_
+ \int_use:N \g_@@_print_header_vars_int
+ }
+ }
+ \cs_set_protected:Npn \@@_set_header_vars_bool:
+ {
+ \AddToHookNext { shipout/after }
+ { \bool_gset_false:N \g_@@_header_vars_next_bool }
+ }
}
}
-\cs_new_protected:Npn \@@_set_headers_vars_first:
- {
- \tl_gset:Nn \pnhdpagefirst { \FirstMark{postnotes/page} }
- \tl_gset:Nn \pnhdpagelast { \LastMark{postnotes/page} }
- \tl_gset:Nn \pnhdchapfirst { \FirstMark{postnotes/chapter} }
- \tl_gset:Nn \pnhdchaplast { \LastMark{postnotes/chapter} }
- \tl_gset:Nn \pnhdsectfirst { \FirstMark{postnotes/section} }
- \tl_gset:Nn \pnhdsectlast { \LastMark{postnotes/section} }
- \tl_gset:Nn \pnhdnamefirst { \FirstMark{postnotes/sectname} }
- \tl_gset:Nn \pnhdnamelast { \LastMark{postnotes/sectname} }
- \int_gincr:N \g_@@_print_header_vars_int
- \exp_args:Ne \property_record:nN
- { __postnotes_header_ \int_use:N \g_@@_print_header_vars_int }
- \c_@@_header_marks_clist
- \@@_set_headers_vars:e
- { __postnotes_header_ \int_use:N \g_@@_print_header_vars_int }
- }
% \end{macrocode}
%
%
Modified: trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty 2024-12-05 21:22:35 UTC (rev 73044)
+++ trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty 2024-12-05 21:22:45 UTC (rev 73045)
@@ -52,7 +52,7 @@
'postnotes' requires a LaTeX kernel \postnotes at required@kernel\space or newer.%
}%
}%
-\ProvidesExplPackage {postnotes} {2024-12-03} {0.5.0}
+\ProvidesExplPackage {postnotes} {2024-12-05} {0.5.1}
{Endnotes for LaTeX}
\tl_new:N \l__postnotes_tmpa_tl
\tl_new:N \l__postnotes_tmpb_tl
@@ -894,8 +894,7 @@
\__postnotes_check_duplicates:N \g__postnotes_print_queue_seq
\__postnotes_sort_queue:N \g__postnotes_print_queue_seq
\__postnotes_check_floats:N \g__postnotes_print_queue_seq
- \bool_gset_true:N \g__postnotes_header_vars_next_bool
- \__postnotes_set_headers_vars_first:
+ \__postnotes_set_header_vars_first:
\bool_if:NF \l__postnotes_print_as_list_bool
{
\cs_set_eq:NN \@afterindentfalse \@afterindenttrue
@@ -1053,8 +1052,7 @@
\l__postnotes_print_type_curr_tl
}
}
- \AddToHookNext { shipout/after }
- { \bool_gset_false:N \g__postnotes_header_vars_next_bool }
+ \__postnotes_set_header_vars_bool:
\seq_map_inline:Nn \l__postnotes_clear_queue_seq
{ \__postnotes_prop_gclear:n { ##1 } }
}
@@ -1260,6 +1258,24 @@
There~are~'#1'~stray~notes~after~the~last~'\iow_char:N\\printpostnotes'~
\msg_line_context:.~At~this~point,~they~are~lost.
}
+\bool_new:N \l__postnotes_deprecated_headervars_bool
+\keys_define:nn { postnotes/setup }
+ {
+ deprecatedheadervars .bool_set:N = \l__postnotes_deprecated_headervars_bool ,
+ deprecatedheadervars .default:n = true ,
+ deprecatedheadervars .initial:n = false ,
+ }
+\AddToHook { begindocument }
+ {
+ \keys_define:nn { postnotes/setup }
+ {
+ deprecatedheadervars .code:n =
+ {
+ \msg_warning:nnn { postnotes }
+ { option-preamble-only } { deprecatedheadervars }
+ } ,
+ }
+ }
\tl_new:N \pnhdpagefirst
\tl_new:N \pnhdpagelast
\tl_new:N \pnhdchapfirst
@@ -1268,88 +1284,136 @@
\tl_new:N \pnhdsectlast
\tl_new:N \pnhdnamefirst
\tl_new:N \pnhdnamelast
-\cs_new_protected:Npn \__postnotes_set_headers_vars:n #1
+\tl_gset:Nn \pnhdpagefirst
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdpagefirst } }
+\tl_gset:Nn \pnhdpagelast
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdpagelast } }
+\tl_gset:Nn \pnhdchapfirst
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdchapfirst } }
+\tl_gset:Nn \pnhdchaplast
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdchaplast } }
+\tl_gset:Nn \pnhdsectfirst
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdsectfirst } }
+\tl_gset:Nn \pnhdsectlast
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdsectlast } }
+\tl_gset:Nn \pnhdnamefirst
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdnamefirst } }
+\tl_gset:Nn \pnhdnamelast
+ { \msg_error:nnn { postnotes } { deprecatedheadervars } { pnhdnamelast } }
+\msg_new:nnn { postnotes } { deprecatedheadervars }
{
- \group_begin:
- \protected at xdef \pnhdpagefirst
- { \property_ref:nn { #1 } { postnotes/page/first } }
- \protected at xdef \pnhdpagelast
- { \property_ref:nn { #1 } { postnotes/page/last } }
- \protected at xdef \pnhdchapfirst
- { \property_ref:nn { #1 } { postnotes/chapter/first } }
- \protected at xdef \pnhdchaplast
- { \property_ref:nn { #1 } { postnotes/chapter/last } }
- \protected at xdef \pnhdsectfirst
- { \property_ref:nn { #1 } { postnotes/section/first } }
- \protected at xdef \pnhdsectlast
- { \property_ref:nn { #1 } { postnotes/section/last } }
- \protected at xdef \pnhdnamefirst
- { \property_ref:nn { #1 } { postnotes/sectname/first } }
- \protected at xdef \pnhdnamelast
- { \property_ref:nn { #1 } { postnotes/sectname/last } }
- \group_end:
+ '\iow_char:N\\ #1'~is~deprecated~\msg_line_context:.~
+ You~should~migrate~to~the~new~'ltmarks'~(see~User~manual),~but~for~
+ a~temporary~quick~fix~you~can~enable~the~'deprecatedheadervars'~option.
}
-\cs_generate_variant:Nn \__postnotes_set_headers_vars:n { e }
-\property_new:nnnn { postnotes/page/first } { shipout } { }
- { \FirstMark { postnotes/page } }
-\property_new:nnnn { postnotes/page/last } { shipout } { }
- { \LastMark { postnotes/page } }
-\property_new:nnnn { postnotes/chapter/first } { shipout } { }
- { \FirstMark { postnotes/chapter } }
-\property_new:nnnn { postnotes/chapter/last } { shipout } { }
- { \LastMark { postnotes/chapter } }
-\property_new:nnnn { postnotes/section/first } { shipout } { }
- { \FirstMark { postnotes/section } }
-\property_new:nnnn { postnotes/section/last } { shipout } { }
- { \LastMark { postnotes/section } }
-\property_new:nnnn { postnotes/sectname/first } { shipout } { }
- { \FirstMark { postnotes/sectname } }
-\property_new:nnnn { postnotes/sectname/last } { shipout } { }
- { \LastMark { postnotes/sectname } }
-\clist_const:Nn \c__postnotes_header_marks_clist
+\cs_set_eq:NN \__postnotes_set_header_vars_first: \prg_do_nothing:
+\cs_set_eq:NN \__postnotes_set_header_vars_bool: \prg_do_nothing:
+\AddToHook { begindocument }
{
- postnotes/page/first ,
- postnotes/page/last ,
- postnotes/chapter/first ,
- postnotes/chapter/last ,
- postnotes/section/first ,
- postnotes/section/last ,
- postnotes/sectname/first ,
- postnotes/sectname/last ,
- }
-\AddToHook { shipout/before } [ ./header ]
- { \__postnotes_set_headers_vars_next: }
-\bool_new:N \g__postnotes_header_vars_next_bool
-\int_new:N \g__postnotes_print_header_vars_int
-\cs_new_protected:Npn \__postnotes_set_headers_vars_next:
- {
- \bool_if:NT \g__postnotes_header_vars_next_bool
+ \bool_if:NT \l__postnotes_deprecated_headervars_bool
{
- \int_gincr:N \g__postnotes_print_header_vars_int
- \exp_args:Ne \property_record:nN
- { __postnotes_header_ \int_use:N \g__postnotes_print_header_vars_int }
- \c__postnotes_header_marks_clist
- \__postnotes_set_headers_vars:e
- { __postnotes_header_ \int_use:N \g__postnotes_print_header_vars_int }
+ \property_new:nnnn { postnotes/page/first } { shipout } { }
+ { \FirstMark { postnotes/page } }
+ \property_new:nnnn { postnotes/page/last } { shipout } { }
+ { \LastMark { postnotes/page } }
+ \property_new:nnnn { postnotes/chapter/first } { shipout } { }
+ { \FirstMark { postnotes/chapter } }
+ \property_new:nnnn { postnotes/chapter/last } { shipout } { }
+ { \LastMark { postnotes/chapter } }
+ \property_new:nnnn { postnotes/section/first } { shipout } { }
+ { \FirstMark { postnotes/section } }
+ \property_new:nnnn { postnotes/section/last } { shipout } { }
+ { \LastMark { postnotes/section } }
+ \property_new:nnnn { postnotes/sectname/first } { shipout } { }
+ { \FirstMark { postnotes/sectname } }
+ \property_new:nnnn { postnotes/sectname/last } { shipout } { }
+ { \LastMark { postnotes/sectname } }
+ \clist_const:Nn \c__postnotes_header_marks_clist
+ {
+ postnotes/page/first ,
+ postnotes/page/last ,
+ postnotes/chapter/first ,
+ postnotes/chapter/last ,
+ postnotes/section/first ,
+ postnotes/section/last ,
+ postnotes/sectname/first ,
+ postnotes/sectname/last ,
+ }
+ \cs_new_protected:Npn \__postnotes_set_header_vars:n #1
+ {
+ \group_begin:
+ \protected at xdef \pnhdpagefirst
+ { \property_ref:nn { #1 } { postnotes/page/first } }
+ \protected at xdef \pnhdpagelast
+ { \property_ref:nn { #1 } { postnotes/page/last } }
+ \protected at xdef \pnhdchapfirst
+ { \property_ref:nn { #1 } { postnotes/chapter/first } }
+ \protected at xdef \pnhdchaplast
+ { \property_ref:nn { #1 } { postnotes/chapter/last } }
+ \protected at xdef \pnhdsectfirst
+ { \property_ref:nn { #1 } { postnotes/section/first } }
+ \protected at xdef \pnhdsectlast
+ { \property_ref:nn { #1 } { postnotes/section/last } }
+ \protected at xdef \pnhdnamefirst
+ { \property_ref:nn { #1 } { postnotes/sectname/first } }
+ \protected at xdef \pnhdnamelast
+ { \property_ref:nn { #1 } { postnotes/sectname/last } }
+ \group_end:
+ }
+ \cs_generate_variant:Nn \__postnotes_set_header_vars:n { e }
+ \bool_new:N \g__postnotes_header_vars_next_bool
+ \int_new:N \g__postnotes_print_header_vars_int
+ \cs_new_protected:Npn \__postnotes_set_headers_vars_next:
+ {
+ \bool_if:NT \g__postnotes_header_vars_next_bool
+ {
+ \int_gincr:N \g__postnotes_print_header_vars_int
+ \exp_args:Ne \property_record:nN
+ {
+ __postnotes_header_
+ \int_use:N \g__postnotes_print_header_vars_int
+ }
+ \c__postnotes_header_marks_clist
+ \__postnotes_set_header_vars:e
+ {
+ __postnotes_header_
+ \int_use:N \g__postnotes_print_header_vars_int
+ }
+ }
+ }
+ \AddToHook { shipout/before } [ ./header ]
+ { \__postnotes_set_headers_vars_next: }
+ \cs_set_protected:Npn \__postnotes_set_header_vars_first:
+ {
+ \bool_gset_true:N \g__postnotes_header_vars_next_bool
+ \tl_gset:Nn \pnhdpagefirst { \FirstMark{postnotes/page} }
+ \tl_gset:Nn \pnhdpagelast { \LastMark{postnotes/page} }
+ \tl_gset:Nn \pnhdchapfirst { \FirstMark{postnotes/chapter} }
+ \tl_gset:Nn \pnhdchaplast { \LastMark{postnotes/chapter} }
+ \tl_gset:Nn \pnhdsectfirst { \FirstMark{postnotes/section} }
+ \tl_gset:Nn \pnhdsectlast { \LastMark{postnotes/section} }
+ \tl_gset:Nn \pnhdnamefirst { \FirstMark{postnotes/sectname} }
+ \tl_gset:Nn \pnhdnamelast { \LastMark{postnotes/sectname} }
+ \int_gincr:N \g__postnotes_print_header_vars_int
+ \exp_args:Ne \property_record:nN
+ {
+ __postnotes_header_
+ \int_use:N \g__postnotes_print_header_vars_int
+ }
+ \c__postnotes_header_marks_clist
+ \__postnotes_set_header_vars:e
+ {
+ __postnotes_header_
+ \int_use:N \g__postnotes_print_header_vars_int
+ }
+ }
+ \cs_set_protected:Npn \__postnotes_set_header_vars_bool:
+ {
+ \AddToHookNext { shipout/after }
+ { \bool_gset_false:N \g__postnotes_header_vars_next_bool }
+ }
}
}
-\cs_new_protected:Npn \__postnotes_set_headers_vars_first:
- {
- \tl_gset:Nn \pnhdpagefirst { \FirstMark{postnotes/page} }
- \tl_gset:Nn \pnhdpagelast { \LastMark{postnotes/page} }
- \tl_gset:Nn \pnhdchapfirst { \FirstMark{postnotes/chapter} }
- \tl_gset:Nn \pnhdchaplast { \LastMark{postnotes/chapter} }
- \tl_gset:Nn \pnhdsectfirst { \FirstMark{postnotes/section} }
- \tl_gset:Nn \pnhdsectlast { \LastMark{postnotes/section} }
- \tl_gset:Nn \pnhdnamefirst { \FirstMark{postnotes/sectname} }
- \tl_gset:Nn \pnhdnamelast { \LastMark{postnotes/sectname} }
- \int_gincr:N \g__postnotes_print_header_vars_int
- \exp_args:Ne \property_record:nN
- { __postnotes_header_ \int_use:N \g__postnotes_print_header_vars_int }
- \c__postnotes_header_marks_clist
- \__postnotes_set_headers_vars:e
- { __postnotes_header_ \int_use:N \g__postnotes_print_header_vars_int }
- }
\tl_new:N \l__postnotes_restore_tmp_tl
\AddToHook { postnotes/note/begin } [ ./compat/caption ]
{ \cs_if_exist:NT \@captype { \postnotesetup { maybemulti } } }
More information about the tex-live-commits
mailing list.