texlive[64031] Master/texmf-dist: postnotes (2aug22)

commits+karl at tug.org commits+karl at tug.org
Tue Aug 2 22:47:40 CEST 2022


Revision: 64031
          http://tug.org/svn/texlive?view=revision&revision=64031
Author:   karl
Date:     2022-08-02 22:47:40 +0200 (Tue, 02 Aug 2022)
Log Message:
-----------
postnotes (2aug22)

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.pdf
    trunk/Master/texmf-dist/doc/latex/postnotes/postnotes.tex
    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	2022-08-02 20:47:24 UTC (rev 64030)
+++ trunk/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md	2022-08-02 20:47:40 UTC (rev 64031)
@@ -1,7 +1,13 @@
 # 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)
 
 ### Fixed

Modified: trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/postnotes/postnotes.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/postnotes/postnotes.tex	2022-08-02 20:47:24 UTC (rev 64030)
+++ trunk/Master/texmf-dist/doc/latex/postnotes/postnotes.tex	2022-08-02 20:47:40 UTC (rev 64031)
@@ -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 @@
 \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 @@
 
 \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 @@
 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 @@
 \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 @@
 \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

Modified: trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx	2022-08-02 20:47:24 UTC (rev 64030)
+++ trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx	2022-08-02 20:47:40 UTC (rev 64031)
@@ -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,20 +2014,57 @@
 % 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 at 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 at theendnote { \postnote }
+        \cs_set:Npn \blx at theendnotetext
+          { \blx at 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 }
   {
 %    \end{macrocode}
@@ -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 at footnote }
       }
 %    \end{macrocode}
 % Restore \pkg{biblatex} variables for each note.
@@ -2077,19 +2109,6 @@
         \blx at 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 at theendnote { \postnote }
-        \cs_set_nopar:Npn \blx at theendnotetext
-          { \blx at 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 at 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}
 %

Modified: trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty	2022-08-02 20:47:24 UTC (rev 64030)
+++ trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty	2022-08-02 20:47:40 UTC (rev 64031)
@@ -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 at refsection } { \int_use:N \c at refsection }
-        \prop_gput:cnx { \__postnotes_data_name:e { \l__postnotes_note_id_tl } }
-          { biblatex at refsegment } { \int_use:N \c at refsegment }
-        \prop_gput:cnx { \__postnotes_data_name:e { \l__postnotes_note_id_tl } }
-          { biblatex at refcontextbool }
-          { \iftoggle { blx at refcontext } { true } { false } }
-        \prop_gput:cnV { \__postnotes_data_name:e { \l__postnotes_note_id_tl } }
-          { biblatex at refcontext } \blx at refcontext@context
-      }
     \AddToHook { postnotes/print/begin } [ postnotes ]
-      {
-        \__postnotes_biblatex_endrefcontext_local:
-        \__postnotes_biblatex_citereset_local:
-        \toggletrue { blx at footnote }
-      }
-    \AddToHook { postnotes/print/eachnote } [ postnotes ]
-      {
-        \__postnotes_prop_get:nnN { \l__postnotes_print_note_id_tl }
-          { biblatex at refsection } \l__postnotes_restore_tmp_tl
-        \int_set:Nn \c at refsection { \l__postnotes_restore_tmp_tl }
-        \__postnotes_prop_get:nnN { \l__postnotes_print_note_id_tl }
-          { biblatex at refsegment } \l__postnotes_restore_tmp_tl
-        \int_set:Nn \c at refsegment { \l__postnotes_restore_tmp_tl }
-        \__postnotes_prop_get:nnN { \l__postnotes_print_note_id_tl }
-          { biblatex at refcontextbool } \l__postnotes_restore_tmp_tl
-        \use:c { toggle \l__postnotes_restore_tmp_tl } { blx at refcontext }
-        \__postnotes_prop_get:nnN { \l__postnotes_print_note_id_tl }
-          { biblatex at refcontext } \l__postnotes_restore_tmp_tl
-        \blx at edef@refcontext { \l__postnotes_restore_tmp_tl }
-      }
+      { \toggletrue { blx at footnote } }
     \AddToHook { begindocument/before } [ postnotes/mkbibendnote ]
       {
-        \cs_set_nopar:Npn \blx at theendnote { \postnote }
-        \cs_set_nopar:Npn \blx at theendnotetext
+        \cs_set:Npn \blx at theendnote { \postnote }
+        \cs_set:Npn \blx at theendnotetext
           { \blx at err@endnote \footnotetext }
       }
-    \cs_new_protected:Npn \__postnotes_biblatex_endrefcontext_local:
-      {
-        \togglefalse { blx at refcontext }
-        \tl_clear:N \blx at refcontext@labelprefix
-        \tl_clear:N \blx at refcontext@labelprefix at real
-        \tl_set:Nx \blx at refcontext@sortingtemplatename { \blx at sorting }
-        \tl_set:Nn \blx at refcontext@sortingnamekeytemplatename { global }
-        \tl_set:Nn \blx at refcontext@uniquenametemplatename { global }
-        \tl_set:Nn \blx at refcontext@labelalphanametemplatename { global }
-        \blx at edef@refcontext
-          {
-            \blx at refcontext@sortingtemplatename /
-            \blx at refcontext@sortingnamekeytemplatename /
-            /
-            \blx at refcontext@uniquenametemplatename /
-            \blx at refcontext@labelalphanametemplatename
-          }
-      }
-    \cs_new_protected:Npn \__postnotes_biblatex_citereset_local:
-      {
-        \tl_clear:c { blx at bsee@ \int_use:N \c at refsection }
-        \tl_clear:c { blx at fsee@ \int_use:N \c at refsection }
-        \undef \blx at lastkey@text
-        \undef \blx at lastkey@foot
-        \undef \blx at lasthash@text
-        \undef \blx at lasthash@foot
-        \clist_map_inline:Nn \blx at trackhash@text
-          { \csundef { blx at lastkey@text@ ##1 } }
-        \tl_clear:N \blx at trackhash@text
-        \clist_map_inline:Nn \blx at trackhash@foot
-          { \csundef { blx at lastkey@foot@ ##1 } }
-        \tl_clear:N \blx at trackhash@foot
-        \clist_map_inline:Nn \blx at trackkeys@text
-          { \csundef { blx at lastnote@text@ ##1 } }
-        \tl_clear:N \blx at trackkeys@text
-        \clist_map_inline:Nn \blx at trackkeys@foot
-          { \csundef { blx at lastnote@foot@ ##1 } }
-        \tl_clear:N \blx at trackkeys@foot
-        \cs_set_eq:NN \blx at lastmpfn \z@
-      }
   }
 \tl_new:N \l__postnotes_note_zlabel_tl
 \AddToHook { package/zref-user/after }



More information about the tex-live-commits mailing list.