diff options
author | Karl Berry <karl@freefriends.org> | 2023-06-12 20:15:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-06-12 20:15:14 +0000 |
commit | 53de1ded099dfae852b5bf342c9411ca566b0e00 (patch) | |
tree | b475ce02b073686e0c5c62b88e1ebda5b945acd2 /Master/texmf-dist | |
parent | 6340c1f1407b6c8a60d4d531ce456278f28ce0f3 (diff) |
postnotes (12jun23)
git-svn-id: svn://tug.org/texlive/trunk@67345 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md | 14 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf | bin | 840032 -> 847740 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/postnotes/postnotes-code.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/postnotes/postnotes-doc.pdf (renamed from Master/texmf-dist/doc/latex/postnotes/postnotes.pdf) | bin | 177453 -> 177584 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/postnotes/postnotes-doc.tex (renamed from Master/texmf-dist/doc/latex/postnotes/postnotes.tex) | 6 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/postnotes/postnotes.dtx | 106 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/postnotes/postnotes.ins | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/postnotes/postnotes.sty | 51 |
8 files changed, 136 insertions, 47 deletions
diff --git a/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md b/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md index 54cc0ec3456..7cc16f8afbf 100644 --- a/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md @@ -1,6 +1,18 @@ # Changelog -## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.2.3...HEAD) +## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.2.4...HEAD) + +## [v0.2.4](https://github.com/gusbrs/postnotes/compare/v0.2.3...v0.2.4) (2023-06-12) + +### Changed +- Use new `\lTblrMeasuringBool` for identifying measuring passes in + `tabularray` tables. + +### Fixed +- Don't inhibit `postnote` counter stepping in contexts which restore counter + values in measuring passes to ensure proper measuring. +- Update User manual and regression tests for `l3kernel`'s renaming of + `\bool_case_true:n(TF)` to `\bool_case:n(TF)`. ## [v0.2.3](https://github.com/gusbrs/postnotes/compare/v0.2.2...v0.2.3) (2023-02-21) diff --git a/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf b/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf Binary files differindex 9c1f7bc4dd1..392677b7590 100644 --- a/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf +++ b/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf diff --git a/Master/texmf-dist/doc/latex/postnotes/postnotes-code.tex b/Master/texmf-dist/doc/latex/postnotes/postnotes-code.tex index 59ed76afd88..67aff57582c 100644 --- a/Master/texmf-dist/doc/latex/postnotes/postnotes-code.tex +++ b/Master/texmf-dist/doc/latex/postnotes/postnotes-code.tex @@ -22,7 +22,7 @@ % % This work consists of the files postnotes.dtx, % postnotes.ins, -% postnotes.tex, +% postnotes-doc.tex, % postnotes-code.tex, % and the files generated from them. % diff --git a/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf b/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.pdf Binary files differindex 0b0f803611f..11677d5e6c8 100644 --- a/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf +++ b/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.pdf diff --git a/Master/texmf-dist/doc/latex/postnotes/postnotes.tex b/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.tex index 0be7d505735..3d29f76a69c 100644 --- a/Master/texmf-dist/doc/latex/postnotes/postnotes.tex +++ b/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.tex @@ -22,7 +22,7 @@ % % This work consists of the files postnotes.dtx, % postnotes.ins, -% postnotes.tex, +% postnotes-doc.tex, % postnotes-code.tex, % and the files generated from them. % @@ -86,7 +86,7 @@ \ExplSyntaxOff , \NewDocumentCommand , \tl_if_eq:NNTF , - \bool_case_true:nF , + \bool_case:nF , \str_if_eq_p:ee , \prg_replicate:nn , \lipsum , @@ -754,7 +754,7 @@ their use (of course, the use of \pkg{lipsum} is just for demonstration): \ExplSyntaxOn \NewDocumentCommand \mypnheader {} { - \bool_case_true:nF + \bool_case:nF { { \str_if_eq_p:ee { \pnhdnamefirst } { intro } && diff --git a/Master/texmf-dist/source/latex/postnotes/postnotes.dtx b/Master/texmf-dist/source/latex/postnotes/postnotes.dtx index edf129ed9c1..03a43914527 100644 --- a/Master/texmf-dist/source/latex/postnotes/postnotes.dtx +++ b/Master/texmf-dist/source/latex/postnotes/postnotes.dtx @@ -22,7 +22,7 @@ % % This work consists of the files postnotes.dtx, % postnotes.ins, -% postnotes.tex, +% postnotes-doc.tex, % postnotes-code.tex, % and the files generated from them. % @@ -153,7 +153,7 @@ % % % \begin{macrocode} -\ProvidesExplPackage {postnotes} {2023-02-21} {0.2.3} +\ProvidesExplPackage {postnotes} {2023-06-12} {0.2.4} {Endnotes for LaTeX} % \end{macrocode} % @@ -700,7 +700,7 @@ % offers a boolean to indicate when it is a measuring pass; \pkg{csquotes} % offers further handles. But the standard \cs{caption} offers none, and % neither does \pkg{amsmath}'s \cs{text} macro. Well, the pkg{caption} -% package has can disable the multiple passes for \cs{caption} with the option +% package can disable the multiple passes for \cs{caption} with the option % \opt{singlelinecheck}, but it is not reasonable to require it for our % purposes, so we must assume the worst case. % @@ -932,36 +932,50 @@ % conditional, obviously, will always return the true branch unless % something is done in the \texttt{postnotes/note/inhibit} hook. This hook % is meant to handle support for packages or features which may justify note -% inhibition, and the code there should set \cs{l_@@_inhibit_note_bool} and -% \cs{l_@@_print_plain_mark_bool} as appropriate to the case. +% inhibition, and the code there should set \cs{l_@@_inhibit_note_bool}, +% \cs{l_@@_print_plain_mark_bool} and +% \cs{l_@@_print_plain_mark_stepcounter_bool} as appropriate to the case. % \begin{macrocode} \bool_new:N \l_@@_inhibit_note_bool \bool_new:N \l_@@_print_plain_mark_bool +\bool_new:N \l_@@_print_plain_mark_stepcounter_bool \NewHook { postnotes/note/inhibit } \prg_new_protected_conditional:Npnn \@@_inhibit_note: { F } { \bool_set_false:N \l_@@_inhibit_note_bool \bool_set_false:N \l_@@_print_plain_mark_bool + \bool_set_false:N \l_@@_print_plain_mark_stepcounter_bool \UseHook { postnotes/note/inhibit } % \end{macrocode} % Printing a plain mark here may be needed because, if we are inhibiting the % note in a ``measuring context'' and omit it completely, the measuring being % performed will be off by the size of the mark. So, to ensure the measuring -% can be done correctly, we place the mark. Since we'd only print this mark -% in case of inhibition, when we don't actually step the counter, to typeset -% correctly the mark that would be printed if the counter had been stepped, we -% increment \cs{c@postnote} locally and grouped, and smuggle \cs{thepostnote} -% out of the group. +% can be done correctly, we place the mark. What to do with the counter +% itself, depends on the situation. In places that are known to restore the +% counter values after the measuring pass, we can let the counter be stepped. +% And, actually we should do so, for example, in a \env{tabularx} with +% multiple postnotes, if we don't step the counter, all the measuring will be +% done with the number of the first note. Otherwise, we don't actually step +% the counter but, to typeset correctly the mark that would be printed if the +% counter had been stepped, we increment \cs{c@postnote} locally and grouped, +% and smuggle \cs{thepostnote} out of the group. % \begin{macrocode} \bool_if:NT \l_@@_print_plain_mark_bool { \tl_if_empty:NT \l_@@_mark_tl { - \group_begin: - \int_incr:N \c@postnote - \exp_args:NNNx - \group_end: - \tl_set:Nn \l_@@_mark_tl { \thepostnote } + \bool_if:NTF \l_@@_print_plain_mark_stepcounter_bool + { + \stepcounter { postnote } + \tl_set:Nx \l_@@_mark_tl { \thepostnote } + } + { + \group_begin: + \int_incr:N \c@postnote + \exp_args:NNNx + \group_end: + \tl_set:Nn \l_@@_mark_tl { \thepostnote } + } } \@@_typeset_mark_wrapper:n { \@@_make_mark:nnn { \l_@@_mark_tl } { } { } } @@ -2371,6 +2385,7 @@ { \bool_set_true:N \l_@@_inhibit_note_bool \bool_set_true:N \l_@@_print_plain_mark_bool + \bool_set_true:N \l_@@_print_plain_mark_stepcounter_bool } } % \end{macrocode} @@ -2414,6 +2429,7 @@ { \bool_set_true:N \l_@@_inhibit_note_bool \bool_set_true:N \l_@@_print_plain_mark_bool + \bool_set_true:N \l_@@_print_plain_mark_stepcounter_bool } } } @@ -2445,6 +2461,7 @@ { \bool_set_true:N \l_@@_inhibit_note_bool \bool_set_true:N \l_@@_print_plain_mark_bool + \bool_set_true:N \l_@@_print_plain_mark_stepcounter_bool } } } @@ -2453,24 +2470,55 @@ % % \subsection*{\pkg{tabularray}} % -% I've tried, but I could not find any ``handle'' to distinguish in -% \pkg{tabularray} a trial/measure pass from the final one. So we use -% \cs{@@_verify_multipass:N} for it. -% -% See, however, \url{https://tex.stackexchange.com/q/675818} and -% \url{https://github.com/lvjr/tabularray/issues/179} (thanks -% \contributor{Ulrike Fischer}). In sum, there's a not yet released new -% boolean \cs{lTblrMeasuringBool} provided by \pkg{tabularray}, use it when it -% comes. -% % \begin{macrocode} \AddToHook { package/tabularray/after } { - \clist_map_inline:nn - { tblr , longtblr , talltblr , booktabs , longtabs , talltabs , +array } +% \end{macrocode} +% Since version \texttt{2023A}, from 2023-03-01, \pkg{tabularray} offers the +% \cs{lTblrMeasuringBool} which is true when measuring and false otherwise. +% See \url{https://tex.stackexchange.com/q/675818} +% and \url{https://github.com/lvjr/tabularray/issues/179} (thanks +% \contributor{Ulrike Fischer}). +% \begin{macrocode} + \bool_if_exist:NTF \lTblrMeasuringBool { - \AddToHook { env/#1/begin } [ postnotes ] - { \bool_set_true:N \l_@@_maybe_multi_bool } +% \end{macrocode} +% I'd be inclined to restrict the inhibition effect to known \pkg{tabularray} +% environments to ``keep things under control''. However this is a dedicated +% and public boolean, and users can create arbitrary new \pkg{tabularray} +% environments with \cs{NewTblrEnviron}, which we either wouldn't catch or +% have to provide an user interface for. So, for the time being, let's trust +% this boolean won't be misused by third-parties or users. Note that setting +% \cs{l_@@_print_plain_mark_stepcounter_bool} to true presumes +% \pkg{tabularray}'s \texttt{counter} module is enabled. But, since this is +% the only way to get the measuring right in this context if there is more +% than one \cs{postnote} inside a given table, pkg{postnotes} expects and +% requires the \texttt{counter} module. +% \begin{macrocode} + \AddToHook { postnotes/note/inhibit } [ postnotes ] + { + \bool_if:NT \lTblrMeasuringBool + { + \bool_set_true:N \l_@@_inhibit_note_bool + \bool_set_true:N \l_@@_print_plain_mark_bool + \bool_set_true:N \l_@@_print_plain_mark_stepcounter_bool + } + } + } + { +% \end{macrocode} +% If the new boolean is not yet available, we use \cs{@@_verify_multipass:N} +% to distinguish a trial/measure pass from the final one. +% \begin{macrocode} + \clist_map_inline:nn + { + tblr , longtblr , talltblr , booktabs , + longtabs , talltabs , +array + } + { + \AddToHook { env/#1/begin } [ postnotes ] + { \bool_set_true:N \l_@@_maybe_multi_bool } + } } } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/postnotes/postnotes.ins b/Master/texmf-dist/source/latex/postnotes/postnotes.ins index 3897fb0534d..08c592ad16c 100644 --- a/Master/texmf-dist/source/latex/postnotes/postnotes.ins +++ b/Master/texmf-dist/source/latex/postnotes/postnotes.ins @@ -22,7 +22,7 @@ % % This work consists of the files postnotes.dtx, % postnotes.ins, -% postnotes.tex, +% postnotes-doc.tex, % postnotes-code.tex, % and the files generated from them. % @@ -68,7 +68,7 @@ This work is "maintained" (as per LPPL maintenance status) by This work consists of the files postnotes.dtx, postnotes.ins, - postnotes.tex, + postnotes-doc.tex, postnotes-code.tex, and the files generated from them. diff --git a/Master/texmf-dist/tex/latex/postnotes/postnotes.sty b/Master/texmf-dist/tex/latex/postnotes/postnotes.sty index b5b2e1924b2..1e53b51878d 100644 --- a/Master/texmf-dist/tex/latex/postnotes/postnotes.sty +++ b/Master/texmf-dist/tex/latex/postnotes/postnotes.sty @@ -26,7 +26,7 @@ %% %% This work consists of the files postnotes.dtx, %% postnotes.ins, -%% postnotes.tex, +%% postnotes-doc.tex, %% postnotes-code.tex, %% and the files generated from them. %% @@ -53,7 +53,7 @@ }% \endinput }% -\ProvidesExplPackage {postnotes} {2023-02-21} {0.2.3} +\ProvidesExplPackage {postnotes} {2023-06-12} {0.2.4} {Endnotes for LaTeX} \cs_new:Npn \__postnotes_data_name:n #1 { g__postnotes_ #1 _data_prop } @@ -411,21 +411,30 @@ } \bool_new:N \l__postnotes_inhibit_note_bool \bool_new:N \l__postnotes_print_plain_mark_bool +\bool_new:N \l__postnotes_print_plain_mark_stepcounter_bool \NewHook { postnotes/note/inhibit } \prg_new_protected_conditional:Npnn \__postnotes_inhibit_note: { F } { \bool_set_false:N \l__postnotes_inhibit_note_bool \bool_set_false:N \l__postnotes_print_plain_mark_bool + \bool_set_false:N \l__postnotes_print_plain_mark_stepcounter_bool \UseHook { postnotes/note/inhibit } \bool_if:NT \l__postnotes_print_plain_mark_bool { \tl_if_empty:NT \l__postnotes_mark_tl { - \group_begin: - \int_incr:N \c@postnote - \exp_args:NNNx - \group_end: - \tl_set:Nn \l__postnotes_mark_tl { \thepostnote } + \bool_if:NTF \l__postnotes_print_plain_mark_stepcounter_bool + { + \stepcounter { postnote } + \tl_set:Nx \l__postnotes_mark_tl { \thepostnote } + } + { + \group_begin: + \int_incr:N \c@postnote + \exp_args:NNNx + \group_end: + \tl_set:Nn \l__postnotes_mark_tl { \thepostnote } + } } \__postnotes_typeset_mark_wrapper:n { \__postnotes_make_mark:nnn { \l__postnotes_mark_tl } { } { } } @@ -1053,6 +1062,7 @@ { \bool_set_true:N \l__postnotes_inhibit_note_bool \bool_set_true:N \l__postnotes_print_plain_mark_bool + \bool_set_true:N \l__postnotes_print_plain_mark_stepcounter_bool } } \AddToHook { postnotes/note/begin } [ postnotes ] @@ -1072,6 +1082,7 @@ { \bool_set_true:N \l__postnotes_inhibit_note_bool \bool_set_true:N \l__postnotes_print_plain_mark_bool + \bool_set_true:N \l__postnotes_print_plain_mark_stepcounter_bool } } } @@ -1091,16 +1102,34 @@ { \bool_set_true:N \l__postnotes_inhibit_note_bool \bool_set_true:N \l__postnotes_print_plain_mark_bool + \bool_set_true:N \l__postnotes_print_plain_mark_stepcounter_bool } } } \AddToHook { package/tabularray/after } { - \clist_map_inline:nn - { tblr , longtblr , talltblr , booktabs , longtabs , talltabs , +array } + \bool_if_exist:NTF \lTblrMeasuringBool { - \AddToHook { env/#1/begin } [ postnotes ] - { \bool_set_true:N \l__postnotes_maybe_multi_bool } + \AddToHook { postnotes/note/inhibit } [ postnotes ] + { + \bool_if:NT \lTblrMeasuringBool + { + \bool_set_true:N \l__postnotes_inhibit_note_bool + \bool_set_true:N \l__postnotes_print_plain_mark_bool + \bool_set_true:N \l__postnotes_print_plain_mark_stepcounter_bool + } + } + } + { + \clist_map_inline:nn + { + tblr , longtblr , talltblr , booktabs , + longtabs , talltabs , +array + } + { + \AddToHook { env/#1/begin } [ postnotes ] + { \bool_set_true:N \l__postnotes_maybe_multi_bool } + } } } \tl_new:N \pntitle |