summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/postnotes
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-08-22 03:01:06 +0000
committerNorbert Preining <norbert@preining.info>2023-08-22 03:01:06 +0000
commitcf3e954514eb50bea0335bdc97d6b76f80f5d03e (patch)
tree84960c9724915fd64626f3b8c532a671ea7e87f2 /macros/latex/contrib/postnotes
parentf4e4c48e897bec27fd8d07ba278c03c6f0c64336 (diff)
CTAN sync 202308220301
Diffstat (limited to 'macros/latex/contrib/postnotes')
-rw-r--r--macros/latex/contrib/postnotes/CHANGELOG.md8
-rw-r--r--macros/latex/contrib/postnotes/postnotes-code.pdfbin848203 -> 849779 bytes
-rw-r--r--macros/latex/contrib/postnotes/postnotes-doc.pdfbin177629 -> 177635 bytes
-rw-r--r--macros/latex/contrib/postnotes/postnotes.dtx62
4 files changed, 49 insertions, 21 deletions
diff --git a/macros/latex/contrib/postnotes/CHANGELOG.md b/macros/latex/contrib/postnotes/CHANGELOG.md
index dc6811e52c..fda5f61173 100644
--- a/macros/latex/contrib/postnotes/CHANGELOG.md
+++ b/macros/latex/contrib/postnotes/CHANGELOG.md
@@ -1,6 +1,12 @@
# 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@filesw` before writing labels to the .aux file.
+- Ensure `\post@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)
diff --git a/macros/latex/contrib/postnotes/postnotes-code.pdf b/macros/latex/contrib/postnotes/postnotes-code.pdf
index 46520b3bf6..d4a78a2cfe 100644
--- a/macros/latex/contrib/postnotes/postnotes-code.pdf
+++ b/macros/latex/contrib/postnotes/postnotes-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/postnotes/postnotes-doc.pdf b/macros/latex/contrib/postnotes/postnotes-doc.pdf
index 8f2ea4fdc6..62ee64468b 100644
--- a/macros/latex/contrib/postnotes/postnotes-doc.pdf
+++ b/macros/latex/contrib/postnotes/postnotes-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/postnotes/postnotes.dtx b/macros/latex/contrib/postnotes/postnotes.dtx
index cb7998fbea..5a32a17963 100644
--- a/macros/latex/contrib/postnotes/postnotes.dtx
+++ b/macros/latex/contrib/postnotes/postnotes.dtx
@@ -138,23 +138,22 @@
% kernel or newer.
%
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
+\def\postnotes@required@kernel{2022-06-01}
+\NeedsTeXFormat{LaTeX2e}[\postnotes@required@kernel]
\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
-\IfFormatAtLeastTF{2022-06-01}
+\IfFormatAtLeastTF{\postnotes@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@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@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@note [2]{} }
+ }
+ }
+\AddToHook { include/before }
+ {
+ \legacy_if:nT { @filesw }
+ {
+ \iow_now:Nx \@partaux
+ { \token_to_str:N \providecommand \token_to_str:N \post@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@note { mark@ #1 } { \thepage } }
+ \legacy_if:nT { @filesw }
+ {
+ \iow_shipout_x:Nn \@auxout
+ { \token_to_str:N \post@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@note { text@ #1 } { \int_use:N \c@page } }
- }
+ { \@@_set_label:nn { text@ #1 } { \int_use:N \c@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@note { print@ #1 } { \int_use:N \c@page } }
- }
+ { \@@_set_label:nn { print@ #1 } { \int_use:N \c@page } }
\cs_generate_variant:Nn \@@_set_print_page_label:n { x }
% \end{macrocode}
% \end{macro}