summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/postnotes
diff options
context:
space:
mode:
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.pdfbin812284 -> 814509 bytes
-rw-r--r--macros/latex/contrib/postnotes/postnotes.dtx97
-rw-r--r--macros/latex/contrib/postnotes/postnotes.pdfbin176560 -> 176261 bytes
-rw-r--r--macros/latex/contrib/postnotes/postnotes.tex50
5 files changed, 88 insertions, 67 deletions
diff --git a/macros/latex/contrib/postnotes/CHANGELOG.md b/macros/latex/contrib/postnotes/CHANGELOG.md
index c3cb3d525a..6df07b54a7 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.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/macros/latex/contrib/postnotes/postnotes-code.pdf b/macros/latex/contrib/postnotes/postnotes-code.pdf
index e2b82b38c8..a47aefa002 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.dtx b/macros/latex/contrib/postnotes/postnotes.dtx
index f4cbdfe7a2..aa53abda40 100644
--- a/macros/latex/contrib/postnotes/postnotes.dtx
+++ b/macros/latex/contrib/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/macros/latex/contrib/postnotes/postnotes.pdf b/macros/latex/contrib/postnotes/postnotes.pdf
index 4d11b82c55..758ad81528 100644
--- a/macros/latex/contrib/postnotes/postnotes.pdf
+++ b/macros/latex/contrib/postnotes/postnotes.pdf
Binary files differ
diff --git a/macros/latex/contrib/postnotes/postnotes.tex b/macros/latex/contrib/postnotes/postnotes.tex
index e9fa40b215..1ab3172592 100644
--- a/macros/latex/contrib/postnotes/postnotes.tex
+++ b/macros/latex/contrib/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