diff options
author | Karl Berry <karl@freefriends.org> | 2022-08-02 20:47:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-08-02 20:47:40 +0000 |
commit | b29b4e4d5408b5261a146df0c568cc29719ca5ac (patch) | |
tree | 3e3d2d7e48f066d0acfaa5be60aafc17f8006ca6 /Master/texmf-dist | |
parent | d050f05231b12ad0f2748819fd688f618963fdb0 (diff) |
postnotes (2aug22)
git-svn-id: svn://tug.org/texlive/trunk@64031 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf | bin | 812284 -> 814509 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/postnotes/postnotes.pdf | bin | 176560 -> 176261 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/postnotes/postnotes.tex | 50 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/postnotes/postnotes.dtx | 97 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/postnotes/postnotes.sty | 79 |
6 files changed, 92 insertions, 142 deletions
diff --git a/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md b/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md index c3cb3d525a6..6df07b54a7b 100644 --- a/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog -## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.1.5...HEAD) +## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.1.6...HEAD) + +## [v0.1.6](https://github.com/gusbrs/postnotes/compare/v0.1.5...v0.1.6) (2022-08-01) + +### Removed +- Withdraw experimental attempt to support `biblatex`'s `refsegment`s and + `refcontext`s until upstream support is available. ## [v0.1.5](https://github.com/gusbrs/postnotes/compare/v0.1.4...v0.1.5) (2022-07-07) 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 e2b82b38c89..a47aefa0027 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.pdf b/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf Binary files differindex 4d11b82c55f..758ad81528a 100644 --- a/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf +++ b/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf diff --git a/Master/texmf-dist/doc/latex/postnotes/postnotes.tex b/Master/texmf-dist/doc/latex/postnotes/postnotes.tex index e9fa40b215d..1ab31725926 100644 --- a/Master/texmf-dist/doc/latex/postnotes/postnotes.tex +++ b/Master/texmf-dist/doc/latex/postnotes/postnotes.tex @@ -66,10 +66,10 @@ \usepackage{zref-clever} \zcsetup{ cap, - check, - titleref, countertype = { pnexample = example } , } +\usepackage{zref-titleref} +\usepackage{zref-check} \usepackage{listings} \lstdefinestyle{code}{ @@ -156,17 +156,13 @@ \makeatother \ExplSyntaxOff +\setlength{\marginparsep}{2\labelsep} + \NewDocumentCommand\opt{m}{\texttt{#1}} % Temporary workaround for 'l3doc' bug. % https://github.com/latex3/latex3/issues/1111 % FIXME Remove when fixed upstream. -\NewDocElement[ - macrolike = false , - printtype = \textit{opt.} , -]{Option}{optiondesc} -\NewDocElement[ - macrolike = true , -]{UserMacro}{usermacro} +\NewDocElement[macrolike=false]{Option}{option} \begin{document} @@ -331,7 +327,7 @@ receives options and values in \texttt{key=value} fashion. \bigskip{} \DescribeOption{heading} % -\DescribeUserMacro{\pnheading} % +\DescribeMacro{\pnheading} % The \opt{heading} option sets the heading for the printed notes or, more generally put, that which is printed at the beginning of \cs{printpostnotes}. Its default value depends on the document class in use. If \cs{chapter} is @@ -374,7 +370,7 @@ different than the defaults. \DescribeOption{makemark} % \DescribeOption{maketextmark} % -\DescribeUserMacro{\pnthepage} % +\DescribeMacro{\pnthepage} % The \opt{makemark} and \opt{maketextmark} options control how the mark is to be typeset, at the point \cs{postnote} is called and at the point the note's text is printed at \cs{printpostnotes}, respectively. They both can receive @@ -530,10 +526,10 @@ case, but be able to override it manually for an occasional unnumbered one. For this reason, a more semantic name was chosen for it, instead of the generic ``add to''. -\DescribeUserMacro{\pnthechapter} % -\DescribeUserMacro{\pnthesection} % -\DescribeUserMacro{\pnthechapternextnote} % -\DescribeUserMacro{\pnthesectionnextnote} % +\DescribeMacro{\pnthechapter} % +\DescribeMacro{\pnthesection} % +\DescribeMacro{\pnthechapternextnote} % +\DescribeMacro{\pnthesectionnextnote} % Just like with \cs{postnote}, the contents of \cs{postnotesection} are not expanded in place, but rather stored with ``no manipulation'' to be typeset later at \cs{printpostnotes}. For this reason, some contextual information is @@ -689,14 +685,14 @@ part of the definition: \ExplSyntaxOff \end{pnsnippet} -\DescribeUserMacro{\pnhdpagefirst} % -\DescribeUserMacro{\pnhdpagelast} % -\DescribeUserMacro{\pnhdchapfirst} % -\DescribeUserMacro{\pnhdchaplast} % -\DescribeUserMacro{\pnhdsectfirst} % -\DescribeUserMacro{\pnhdsectlast} % -\DescribeUserMacro{\pnhdnamefirst} % -\DescribeUserMacro{\pnhdnamelast} % +\DescribeMacro{\pnhdpagefirst} % +\DescribeMacro{\pnhdpagelast} % +\DescribeMacro{\pnhdchapfirst} % +\DescribeMacro{\pnhdchaplast} % +\DescribeMacro{\pnhdsectfirst} % +\DescribeMacro{\pnhdsectlast} % +\DescribeMacro{\pnhdnamefirst} % +\DescribeMacro{\pnhdnamelast} % \cs{pnhdpagefirst} and \cs{pnhdpagelast} store the value of \cs{thepage} for the first and the last notes (where these notes were originally placed) of the current page (at the point they are being printed). These variables are @@ -820,10 +816,10 @@ places, etc. \section{Localization} \zlabel{sec:localization} -\DescribeUserMacro{\pntitle} % -\DescribeUserMacro{\pnhdnotes} % -\DescribeUserMacro{\pnhdtopage} % -\DescribeUserMacro{\pnhdtopages} % +\DescribeMacro{\pntitle} % +\DescribeMacro{\pnhdnotes} % +\DescribeMacro{\pnhdtopage} % +\DescribeMacro{\pnhdtopages} % \pkg{postnotes} uses a few localized strings, stored in the variables \cs{pntitle}, \cs{pnhdnotes}, \cs{pnhdtopage}, and \cs{pnhdtopages}. The first one is used in the default value of the \opt{heading} option and diff --git a/Master/texmf-dist/source/latex/postnotes/postnotes.dtx b/Master/texmf-dist/source/latex/postnotes/postnotes.dtx index f4cbdfe7a27..aa53abda406 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-07-07} {0.1.5} +\ProvidesExplPackage {postnotes} {2022-08-01} {0.1.6} {Endnotes for LaTeX} % \end{macrocode} % @@ -2014,18 +2014,55 @@ % Thanks \contributor{Moritz Wemheuer}: % \url{https://tex.stackexchange.com/q/597359#comment1594585_597389}. % -% We can make \pkg{biblatex}'s \texttt{refsegment}s and \texttt{refcontext}s -% work, but \texttt{refsection}s are more complicated. Currently, -% \texttt{refsection}s are only supported if \cs{printpostnotes} is called -% within each \texttt{refsection}, one cannot ``accumulate'' the notes from -% all \texttt{refsection}s and print them at the end. Well, one can, but they -% will be considered part of the current \texttt{refsection} of wherever -% \cs{printpostnotes} is placed (unless they were also cited in the original -% \texttt{refsection} out of a \cs{postnote} which, of course, is not -% something to rely on). % -% Note that support for these features of \pkg{biblatex} is -% \emph{experimental}. +% \begin{macrocode} +\AddToHook { package/biblatex/after } + { +% \end{macrocode} +% Let \pkg{biblatex} know we are in a ``notes'' context. See +% \url{https://tex.stackexchange.com/a/304464}, including comments. +% \begin{macrocode} + \AddToHook { postnotes/print/begin } [ postnotes ] + { \toggletrue { blx@footnote } } +% \end{macrocode} +% Make \pkg{biblatex}'s \cs{mkbibendnote} use \cs{postnote}. This is very +% likely desired in most cases, but may occasionally not be, so we add it to +% an individually labeled hook, which can be disabled with +% \texttt{\textbackslash{}RemoveFromHook\{begindocument/before\}[postnotes/mkbibendnote]} +% in the preamble. +% \begin{macrocode} + \AddToHook { begindocument/before } [ postnotes/mkbibendnote ] + { + \cs_set:Npn \blx@theendnote { \postnote } + \cs_set:Npn \blx@theendnotetext + { \blx@err@endnote \footnotetext } + } + } +% \end{macrocode} +% +% +% \begin{macrocode} +%<*gobble> +% \end{macrocode} +% +% I had made an initial experimental attempt to support \pkg{biblatex}'s +% \texttt{refsegment}s, \texttt{refcontext}s and \texttt{refsection}s. +% However, this attempt was rash. Even if I could get many example files to +% work for \texttt{refsegment}s and \texttt{refcontext}s, I could not do so +% for \texttt{refsection}s. More importantly, with this partial +% implementation, I could also generate documents which confused +% \pkg{biblatex} more than it helped. Things I couldn't understand well, or +% fix. All in all, I don't think this partial implementation is tenable, and +% I could not take it further. Hence, \pkg{postnotes} support for this +% feature set of \pkg{biblatex} will depend, as it should, on proper upstream +% support for ``saving'' and ``restoring'' citation ``context'' information. +% +% I have made a feature request at \pkg{biblatex} for this +% (\url{https://github.com/plk/biblatex/issues/1226}), which was +% (understandably) classified as ``long term, no promises''. +% +% +% The attempt was the following (currently ``gobbled'' from the package): % % \begin{macrocode} \AddToHook { package/biblatex/after } @@ -2052,11 +2089,6 @@ { \@@_biblatex_endrefcontext_local: \@@_biblatex_citereset_local: -% \end{macrocode} -% Let \pkg{biblatex} know we are in a ``notes'' context. See -% \url{https://tex.stackexchange.com/a/304464}, including comments. -% \begin{macrocode} - \toggletrue { blx@footnote } } % \end{macrocode} % Restore \pkg{biblatex} variables for each note. @@ -2077,19 +2109,6 @@ \blx@edef@refcontext { \l_@@_restore_tmp_tl } } % \end{macrocode} -% Make \pkg{biblatex}'s \cs{mkbibendnote} use \cs{postnote}. This is very -% likely desired in most cases, but may occasionally not be, so we add it to -% an individually labeled hook, which can be disabled with -% \texttt{\textbackslash{}RemoveFromHook\{begindocument/before\}[postnotes/mkbibendnote]} -% in the preamble. -% \begin{macrocode} - \AddToHook { begindocument/before } [ postnotes/mkbibendnote ] - { - \cs_set_nopar:Npn \blx@theendnote { \postnote } - \cs_set_nopar:Npn \blx@theendnotetext - { \blx@err@endnote \footnotetext } - } -% \end{macrocode} % Auxiliary functions. % % \begin{macro}{\@@_biblatex_endrefcontext_local:} @@ -2176,9 +2195,7 @@ % corresponding citation data written to the \file{.bcf} file. And the way % \cs{refsection} is implemented presumes each section is only ever begun once % (fair\dots{}), thus making it difficult to ``reopen'' it, or append new -% citations to it later on, when the notes are printed. Given the complexity -% of this machinery, it would be madness not to use \pkg{biblatex}'s -% infrastructure directly, and try to ``emulate'' it. The start of a +% citations to it later on, when the notes are printed. The start of a % \texttt{refsection} must be registered on the \file{.bcf} file, and this is % done by \cs{refsection} (and its auxiliary functions). However, a number of % its characteristics make things particularly difficult for the purpose at @@ -2187,14 +2204,13 @@ % environment (which receives the \meta{resources}) is used to set a local % assignment to \cs{blx@bibfiles}, based on which the relevant information is % written to the \file{.bcf} file, and when the group closes the information -% is gone. My best attempt is below (excluded from the package) but it is not -% good. It feels a wrong approach to ``go around'' the intended use of -% \cs{refsection} so much, and it can't handle at all its optional argument, -% for the reasons above. It's also incomplete, since it does not handle -% restoring \cs{l_@@_biblatex_orig_refsection_tl}. +% is gone. My best attempt is below but it is not good. It feels a wrong +% approach to ``go around'' the intended use of \cs{refsection} so much, and +% it can't handle at all its optional argument, for the reasons above. It's +% also incomplete, since it does not handle restoring +% \cs{l_@@_biblatex_orig_refsection_tl}. % % \begin{macrocode} -%<*gobble> \AddToHook { package/biblatex/after } { \tl_new:N \l_@@_biblatex_orig_refsection_tl @@ -2227,6 +2243,9 @@ } } } +% \end{macrocode} +% +% \begin{macrocode} %</gobble> % \end{macrocode} % diff --git a/Master/texmf-dist/tex/latex/postnotes/postnotes.sty b/Master/texmf-dist/tex/latex/postnotes/postnotes.sty index 56a0c0c8021..8040fe9ecfc 100644 --- a/Master/texmf-dist/tex/latex/postnotes/postnotes.sty +++ b/Master/texmf-dist/tex/latex/postnotes/postnotes.sty @@ -53,7 +53,7 @@ }% \endinput }% -\ProvidesExplPackage {postnotes} {2022-07-07} {0.1.5} +\ProvidesExplPackage {postnotes} {2022-08-01} {0.1.6} {Endnotes for LaTeX} \cs_new:Npn \__postnotes_data_name:n #1 { g__postnotes_ #1 _data_prop } @@ -979,85 +979,14 @@ } \AddToHook { package/biblatex/after } { - \AddToHook { postnotes/store/note } [ postnotes ] - { - \prop_gput:cnx { \__postnotes_data_name:e { \l__postnotes_note_id_tl } } - { biblatex@refsection } { \int_use:N \c@refsection } - \prop_gput:cnx { \__postnotes_data_name:e { \l__postnotes_note_id_tl } } - { biblatex@refsegment } { \int_use:N \c@refsegment } - \prop_gput:cnx { \__postnotes_data_name:e { \l__postnotes_note_id_tl } } - { biblatex@refcontextbool } - { \iftoggle { blx@refcontext } { true } { false } } - \prop_gput:cnV { \__postnotes_data_name:e { \l__postnotes_note_id_tl } } - { biblatex@refcontext } \blx@refcontext@context - } \AddToHook { postnotes/print/begin } [ postnotes ] - { - \__postnotes_biblatex_endrefcontext_local: - \__postnotes_biblatex_citereset_local: - \toggletrue { blx@footnote } - } - \AddToHook { postnotes/print/eachnote } [ postnotes ] - { - \__postnotes_prop_get:nnN { \l__postnotes_print_note_id_tl } - { biblatex@refsection } \l__postnotes_restore_tmp_tl - \int_set:Nn \c@refsection { \l__postnotes_restore_tmp_tl } - \__postnotes_prop_get:nnN { \l__postnotes_print_note_id_tl } - { biblatex@refsegment } \l__postnotes_restore_tmp_tl - \int_set:Nn \c@refsegment { \l__postnotes_restore_tmp_tl } - \__postnotes_prop_get:nnN { \l__postnotes_print_note_id_tl } - { biblatex@refcontextbool } \l__postnotes_restore_tmp_tl - \use:c { toggle \l__postnotes_restore_tmp_tl } { blx@refcontext } - \__postnotes_prop_get:nnN { \l__postnotes_print_note_id_tl } - { biblatex@refcontext } \l__postnotes_restore_tmp_tl - \blx@edef@refcontext { \l__postnotes_restore_tmp_tl } - } + { \toggletrue { blx@footnote } } \AddToHook { begindocument/before } [ postnotes/mkbibendnote ] { - \cs_set_nopar:Npn \blx@theendnote { \postnote } - \cs_set_nopar:Npn \blx@theendnotetext + \cs_set:Npn \blx@theendnote { \postnote } + \cs_set:Npn \blx@theendnotetext { \blx@err@endnote \footnotetext } } - \cs_new_protected:Npn \__postnotes_biblatex_endrefcontext_local: - { - \togglefalse { blx@refcontext } - \tl_clear:N \blx@refcontext@labelprefix - \tl_clear:N \blx@refcontext@labelprefix@real - \tl_set:Nx \blx@refcontext@sortingtemplatename { \blx@sorting } - \tl_set:Nn \blx@refcontext@sortingnamekeytemplatename { global } - \tl_set:Nn \blx@refcontext@uniquenametemplatename { global } - \tl_set:Nn \blx@refcontext@labelalphanametemplatename { global } - \blx@edef@refcontext - { - \blx@refcontext@sortingtemplatename / - \blx@refcontext@sortingnamekeytemplatename / - / - \blx@refcontext@uniquenametemplatename / - \blx@refcontext@labelalphanametemplatename - } - } - \cs_new_protected:Npn \__postnotes_biblatex_citereset_local: - { - \tl_clear:c { blx@bsee@ \int_use:N \c@refsection } - \tl_clear:c { blx@fsee@ \int_use:N \c@refsection } - \undef \blx@lastkey@text - \undef \blx@lastkey@foot - \undef \blx@lasthash@text - \undef \blx@lasthash@foot - \clist_map_inline:Nn \blx@trackhash@text - { \csundef { blx@lastkey@text@ ##1 } } - \tl_clear:N \blx@trackhash@text - \clist_map_inline:Nn \blx@trackhash@foot - { \csundef { blx@lastkey@foot@ ##1 } } - \tl_clear:N \blx@trackhash@foot - \clist_map_inline:Nn \blx@trackkeys@text - { \csundef { blx@lastnote@text@ ##1 } } - \tl_clear:N \blx@trackkeys@text - \clist_map_inline:Nn \blx@trackkeys@foot - { \csundef { blx@lastnote@foot@ ##1 } } - \tl_clear:N \blx@trackkeys@foot - \cs_set_eq:NN \blx@lastmpfn \z@ - } } \tl_new:N \l__postnotes_note_zlabel_tl \AddToHook { package/zref-user/after } |