texlive[68006] Master/texmf-dist: postnotes (21aug23)

commits+karl at tug.org commits+karl at tug.org
Mon Aug 21 22:21:02 CEST 2023


Revision: 68006
          http://tug.org/svn/texlive?view=revision&revision=68006
Author:   karl
Date:     2023-08-21 22:21:01 +0200 (Mon, 21 Aug 2023)
Log Message:
-----------
postnotes (21aug23)

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	2023-08-21 20:20:51 UTC (rev 68005)
+++ trunk/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md	2023-08-21 20:21:01 UTC (rev 68006)
@@ -1,7 +1,13 @@
 # Changelog
 
-## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.2.5...HEAD)
+## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.2.6...HEAD)
 
+## [v0.2.6](https://github.com/gusbrs/postnotes/compare/v0.2.5...v0.2.6) (2023-08-21)
+
+### Fixed
+- Check `if at filesw` before writing labels to the .aux file.
+- Ensure `\post at note` is defined in the .aux file.
+
 ## [v0.2.5](https://github.com/gusbrs/postnotes/compare/v0.2.4...v0.2.5) (2023-06-16)
 
 ### Fixed

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	2023-08-21 20:20:51 UTC (rev 68005)
+++ trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx	2023-08-21 20:21:01 UTC (rev 68006)
@@ -138,23 +138,22 @@
 % kernel or newer.
 %
 %    \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
+\def\postnotes at required@kernel{2022-06-01}
+\NeedsTeXFormat{LaTeX2e}[\postnotes at required@kernel]
 \providecommand\IfFormatAtLeastTF{\@ifl at t@r\fmtversion}
-\IfFormatAtLeastTF{2022-06-01}
+\IfFormatAtLeastTF{\postnotes at required@kernel}
   {}
   {%
     \PackageError{postnotes}{LaTeX kernel too old}
       {%
-        'postnotes' requires a LaTeX kernel 2022-06-01 or newer.%
-        \MessageBreak Loading will abort!%
+        'postnotes' requires a LaTeX kernel \postnotes at required@kernel\space or newer.%
       }%
-    \endinput
   }%
 %    \end{macrocode}
 %
 %
 %    \begin{macrocode}
-\ProvidesExplPackage {postnotes} {2023-06-16} {0.2.5}
+\ProvidesExplPackage {postnotes} {2023-08-21} {0.2.6}
   {Endnotes for LaTeX}
 %    \end{macrocode}
 %
@@ -296,9 +295,32 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% And ensure \cs{post at note} is defined in the \file{.aux} file.  The hooks are
+% the same used by \pkg{hyperref} for similar purpose.
 %
+%    \begin{macrocode}
+\AddToHook { begindocument }
+  {
+    \legacy_if:nT { @filesw }
+      {
+        \iow_now:Nx \@mainaux
+          { \token_to_str:N \providecommand \token_to_str:N \post at note [2]{} }
+      }
+  }
+\AddToHook { include/before }
+  {
+    \legacy_if:nT { @filesw }
+      {
+        \iow_now:Nx \@partaux
+          { \token_to_str:N \providecommand \token_to_str:N \post at note [2]{} }
+      }
+  }
+%    \end{macrocode}
+%
+%
 % \begin{macro}
 %   {
+%     \@@_set_label:nn ,
 %     \@@_set_mark_page_label:n ,
 %     \@@_set_text_page_label:n ,
 %     \@@_set_print_page_label:n ,
@@ -307,28 +329,28 @@
 %   \cs{iow_shipout_x:Nn}, since the main information we are interested in is
 %   the \texttt{page}.
 %     \begin{syntax}
-%       \cs{@@_set_mark_page_label:n} \Arg{label name}
-%       \cs{@@_set_text_page_label:n} \Arg{label name}
-%       \cs{@@_set_print_page_label:n} \Arg{label name}
+%       \cs{@@_set_label:nn} \Arg{label name} \Arg{value}
+%       \cs{@@_set_mark_page_label:n} \Arg{note id}
+%       \cs{@@_set_text_page_label:n} \Arg{note id}
+%       \cs{@@_set_print_page_label:n} \Arg{note id}
 %     \end{syntax}
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_set_mark_page_label:n #1
+\cs_new_protected:Npn \@@_set_label:nn #1#2
   {
-    \iow_shipout_x:Nn \@auxout
-      { \token_to_str:N \post at note { mark@ #1 } { \thepage } }
+    \legacy_if:nT { @filesw }
+      {
+        \iow_shipout_x:Nn \@auxout
+          { \token_to_str:N \post at note { #1 } { #2 } }
+      }
   }
+\cs_new_protected:Npn \@@_set_mark_page_label:n #1
+  { \@@_set_label:nn { mark@ #1 } { \thepage } }
 \cs_generate_variant:Nn \@@_set_mark_page_label:n { x }
 \cs_new_protected:Npn \@@_set_text_page_label:n #1
-  {
-    \iow_shipout_x:Nn \@auxout
-      { \token_to_str:N \post at note { text@ #1 } { \int_use:N \c at page } }
-  }
+  { \@@_set_label:nn { text@ #1 } { \int_use:N \c at page } }
 \cs_generate_variant:Nn \@@_set_text_page_label:n { x }
 \cs_new_protected:Npn \@@_set_print_page_label:n #1
-  {
-    \iow_shipout_x:Nn \@auxout
-      { \token_to_str:N \post at note { print@ #1 } { \int_use:N \c at page } }
-  }
+  { \@@_set_label:nn { print@ #1 } { \int_use:N \c at page } }
 \cs_generate_variant:Nn \@@_set_print_page_label:n { x }
 %    \end{macrocode}
 % \end{macro}

Modified: trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty	2023-08-21 20:20:51 UTC (rev 68005)
+++ trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty	2023-08-21 20:21:01 UTC (rev 68006)
@@ -42,19 +42,18 @@
 %% 
 %% -----------------------------------------------------------------------
 %% 
-\NeedsTeXFormat{LaTeX2e}
+\def\postnotes at required@kernel{2022-06-01}
+\NeedsTeXFormat{LaTeX2e}[\postnotes at required@kernel]
 \providecommand\IfFormatAtLeastTF{\@ifl at t@r\fmtversion}
-\IfFormatAtLeastTF{2022-06-01}
+\IfFormatAtLeastTF{\postnotes at required@kernel}
   {}
   {%
     \PackageError{postnotes}{LaTeX kernel too old}
       {%
-        'postnotes' requires a LaTeX kernel 2022-06-01 or newer.%
-        \MessageBreak Loading will abort!%
+        'postnotes' requires a LaTeX kernel \postnotes at required@kernel\space or newer.%
       }%
-    \endinput
   }%
-\ProvidesExplPackage {postnotes} {2023-06-16} {0.2.5}
+\ProvidesExplPackage {postnotes} {2023-08-21} {0.2.6}
   {Endnotes for LaTeX}
 \cs_new:Npn \__postnotes_data_name:n #1
   { g__postnotes_ #1 _data_prop }
@@ -116,23 +115,38 @@
 \tl_const:Nn \c__postnotes_ref_prefix_tl { postnote at r }
 \cs_new_protected:Npx \post at note #1#2
   { \exp_not:N \@newl at bel { \c__postnotes_ref_prefix_tl } {#1} {#2} }
-\cs_new_protected:Npn \__postnotes_set_mark_page_label:n #1
+\AddToHook { begindocument }
   {
-    \iow_shipout_x:Nn \@auxout
-      { \token_to_str:N \post at note { mark@ #1 } { \thepage } }
+    \legacy_if:nT { @filesw }
+      {
+        \iow_now:Nx \@mainaux
+          { \token_to_str:N \providecommand \token_to_str:N \post at note [2]{} }
+      }
   }
+\AddToHook { include/before }
+  {
+    \legacy_if:nT { @filesw }
+      {
+        \iow_now:Nx \@partaux
+          { \token_to_str:N \providecommand \token_to_str:N \post at note [2]{} }
+      }
+  }
+\cs_new_protected:Npn \__postnotes_set_label:nn #1#2
+  {
+    \legacy_if:nT { @filesw }
+      {
+        \iow_shipout_x:Nn \@auxout
+          { \token_to_str:N \post at note { #1 } { #2 } }
+      }
+  }
+\cs_new_protected:Npn \__postnotes_set_mark_page_label:n #1
+  { \__postnotes_set_label:nn { mark@ #1 } { \thepage } }
 \cs_generate_variant:Nn \__postnotes_set_mark_page_label:n { x }
 \cs_new_protected:Npn \__postnotes_set_text_page_label:n #1
-  {
-    \iow_shipout_x:Nn \@auxout
-      { \token_to_str:N \post at note { text@ #1 } { \int_use:N \c at page } }
-  }
+  { \__postnotes_set_label:nn { text@ #1 } { \int_use:N \c at page } }
 \cs_generate_variant:Nn \__postnotes_set_text_page_label:n { x }
 \cs_new_protected:Npn \__postnotes_set_print_page_label:n #1
-  {
-    \iow_shipout_x:Nn \@auxout
-      { \token_to_str:N \post at note { print@ #1 } { \int_use:N \c at page } }
-  }
+  { \__postnotes_set_label:nn { print@ #1 } { \int_use:N \c at page } }
 \cs_generate_variant:Nn \__postnotes_set_print_page_label:n { x }
 \cs_new_protected:Npn \__postnotes_get_pageref:Nn #1#2
   {



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