summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-12-28 22:28:54 +0000
committerKarl Berry <karl@freefriends.org>2022-12-28 22:28:54 +0000
commite5e1082561ce3eb3d5ee2245c28f906b87daa076 (patch)
tree3cf5cb29803f56870b18945ac064a20457c737ad
parent7c4fdb40c3d8ae02f9b3f15cd69e62576a8fb248 (diff)
postnotes (28dec22)
git-svn-id: svn://tug.org/texlive/trunk@65385 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md18
-rw-r--r--Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdfbin815249 -> 815331 bytes
-rw-r--r--Master/texmf-dist/doc/latex/postnotes/postnotes.pdfbin176944 -> 177361 bytes
-rw-r--r--Master/texmf-dist/doc/latex/postnotes/postnotes.tex39
-rw-r--r--Master/texmf-dist/source/latex/postnotes/postnotes.dtx160
-rw-r--r--Master/texmf-dist/tex/latex/postnotes/postnotes.sty106
6 files changed, 155 insertions, 168 deletions
diff --git a/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md b/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md
index 5ae69925f00..c6fa6634787 100644
--- a/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md
+++ b/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md
@@ -1,6 +1,22 @@
# Changelog
-## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.1.7...HEAD)
+## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.2.0...HEAD)
+
+## [v0.2.0](https://github.com/gusbrs/postnotes/compare/v0.1.7...v0.2.0) (2022-12-28)
+
+### Added
+- `\postnote` option `markstr`, which can receive a string as value, and does
+ not set `sortnum`.
+- `\postnotesection` option `exp`, to expand the contents in place.
+
+### Changed
+- To simplify user input, `\postnote` option `mark` now requires a number as
+ value, but it also sets `sortnum`.
+- `\postnotesectionx` is deprecated in favor of the new `exp` option.
+- Bumped the required kernel to 2022-06-01, so that we can use the new
+ `\MakeLinkTarget` and the starred version of `\ref*` defined by the kernel,
+ which simplifies the relation with `hyperref`. All in all, `postnotes` no
+ longer needs to use any internal `hyperref` commands.
## [v0.1.7](https://github.com/gusbrs/postnotes/compare/v0.1.6...v0.1.7) (2022-11-13)
diff --git a/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf b/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf
index ac52fa60c36..b5a50db4248 100644
--- a/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf
+++ b/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf b/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf
index e82c9195b42..58a7d4a3e74 100644
--- a/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf
+++ b/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/postnotes/postnotes.tex b/Master/texmf-dist/doc/latex/postnotes/postnotes.tex
index 04ea7ccc274..79f77d22cbb 100644
--- a/Master/texmf-dist/doc/latex/postnotes/postnotes.tex
+++ b/Master/texmf-dist/doc/latex/postnotes/postnotes.tex
@@ -159,10 +159,8 @@
\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]{Option}{option}
+
+\NewDocumentCommand\username{m}{`\texttt{#1}'}
\begin{document}
@@ -284,10 +282,7 @@ for making notes subdivisions, and it places \meta{text} between the notes
where it occurs, at the point the notes are printed by \cs{printpostnotes}.
For more details and some examples, see \zcref{sec:notes-sections}. Its
\meta{options} are presented in \zcref{sec:options},
-\zcref[ref=title,noname]{sec:section-options}. A \cs{postnotesectionx} is
-also provided which expands \meta{text} in place (\texttt{x}-type expansion)
-before storing it (differently from \cs{postnotesection} which stores
-\meta{text} with ``no manipulation'').
+\zcref[ref=title,noname]{sec:section-options}.
\begin{function}{\printpostnotes}
\begin{syntax}
@@ -450,14 +445,17 @@ following:
\bigskip{}
\DescribeOption{mark} %
+\DescribeOption{markstr} %
By default, the mark generated by \cs{postnote} is determined by the printed
representation of the \texttt{postnote} counter, \cs{thepostnote}, which is
-stepped when \cs{postnote} is called. But the \opt{mark} option allows you to
-manually set it, in case you want, or need, to do so. When \opt{mark} is
-manually set, the \texttt{postnote} counter is not stepped. Note that,
-differently from the optional argument of \cs{footnote}, this does not need to
-be a number, it can receive some text as value, which is directly used as the
-mark.
+stepped when \cs{postnote} is called. But the \opt{mark} and \opt{markstr}
+options allow you to manually set it, in case you want, or need, to do so.
+When either \opt{mark} or \opt{markstr} is manually set, the \texttt{postnote}
+counter is not stepped. The difference between them is that \opt{mark} must
+receive a number as value, and uses its value to also set the \opt{sortnum}
+option, while \opt{markstr}, differently from the optional argument of
+\cs{footnote}, can receive a string as value which is directly used as the
+mark, but it does not set \opt{sortnum}.
\DescribeOption{sortnum} %
Normally, the sort value used for sorting the notes queue (see the \opt{sort}
@@ -468,7 +466,7 @@ manually with the \opt{sortnum} option, typically, when you have also manually
specified the mark. It receives a floating point number as value. So, for
example, if one needed to insert a note between notes 2 and 3, without
disturbing the numbering of other notes, one could use
-\texttt{\cs{postnote}[mark=2*,sortnum=2.5]\marg{text}}.
+\texttt{\cs{postnote}[markstr=2*,sortnum=2.5]\marg{text}}.
\DescribeOption{nomark} %
The \opt{nomark} option makes \cs{postnote} inhibit the typesetting of the
@@ -503,6 +501,13 @@ available for the first and last note on a given page through the variables
is typeset. For details on how to use these variables, see
\zcref{sec:headers}.
+\DescribeOption{exp} %
+By default, \cs{postnotesection} stores its \meta{text} argument with ``no
+manipulation''. The \opt{exp} option allows one to fully expand
+(\texttt{x}-type expansion) \meta{text} in place before storing it. It is a
+boolean option, and the option given with no value is equivalent to
+\texttt{exp=true}.
+
\section{Notes sections}
\zlabel{sec:notes-sections}
@@ -898,7 +903,7 @@ correctly ordered printed notes (as a result of sorting):
\postnote{2}
\begin{table}[p]
\caption{Table}
- Table.\postnote[mark=5,sortnum=5]{3}
+ Table.\postnote[mark=5]{3}
\end{table}
\postnote{4}
\postnote{5}
@@ -965,7 +970,7 @@ provided by (in chronological order):
% 2022-04-05: https://tex.stackexchange.com/q/597359#comment1594585_597389
The package's language support have been provided or improved thanks to:
- `\texttt{Pika78}' (French)
+ \username{Pika78} (French)
% 2022-04-25: https://github.com/gusbrs/postnotes/issues/1#issuecomment-1108634938
and Herbert Voß (German).
% 2022-11-12: https://github.com/gusbrs/postnotes/issues/2
diff --git a/Master/texmf-dist/source/latex/postnotes/postnotes.dtx b/Master/texmf-dist/source/latex/postnotes/postnotes.dtx
index 2ab7308acea..b6a9a15572c 100644
--- a/Master/texmf-dist/source/latex/postnotes/postnotes.dtx
+++ b/Master/texmf-dist/source/latex/postnotes/postnotes.dtx
@@ -65,8 +65,8 @@
% \NewDocumentCommand\githubPR{m}{^^A
% PR~\href{https://github.com/gusbrs/postnotes/pull/#1}{\##1}}
%
-% ^^A Currently just for keeping semantic markup on this.
% \NewDocumentCommand\contributor{m}{#1}
+% \NewDocumentCommand\username{m}{`\texttt{#1}'}
%
% \NewDocumentCommand\opt{m}{\texttt{#1}}
%
@@ -128,17 +128,23 @@
% \end{macrocode}
%
%
-% Require the new syntax for file/package hooks (\texttt{ltnews34},
-% \texttt{ltfilehook}).
+% The new syntax for file/package hooks, which the package assumes, requires
+% kernel 2021-11-15 (\texttt{ltnews34}, \texttt{ltfilehook}). Furthermore,
+% the kernel of 2022-06-01 introduced a couple of very nice features which
+% simplifies the relation with \pkg{hyperref} (\texttt{ltnews35},
+% \texttt{hyperref-linktarget}): the provision of \cs{MakeLinkTarget} and the
+% definition by the kernel of the starred version of \cs{ref}, which we can
+% use regardless of \pkg{hyperref} being loaded. So we require the 2022-06-01
+% kernel or newer.
%
% \begin{macrocode}
\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
-\IfFormatAtLeastTF{2021-11-15}
+\IfFormatAtLeastTF{2022-06-01}
{}
{%
\PackageError{postnotes}{LaTeX kernel too old}
{%
- 'postnotes' requires a LaTeX kernel 2021-11-15 or newer.%
+ 'postnotes' requires a LaTeX kernel 2022-06-01 or newer.%
\MessageBreak Loading will abort!%
}%
\endinput
@@ -147,7 +153,7 @@
%
%
% \begin{macrocode}
-\ProvidesExplPackage {postnotes} {2022-11-13} {0.1.7}
+\ProvidesExplPackage {postnotes} {2022-12-28} {0.2.0}
{Endnotes for LaTeX}
% \end{macrocode}
%
@@ -233,6 +239,7 @@
{ \thesection }
\prop_gput:cnn { \@@_data_name:e {#1} } { content } {#2}
}
+\cs_generate_variant:Nn \@@_store_section:nn { nx }
% \end{macrocode}
% \end{macro}
%
@@ -863,18 +870,10 @@
\UseHook { postnotes/note/begin }
\cs_set:Npn \@currentcounter { postnote }
\cs_set:Npx \@currentlabel { \p@postnote \l_@@_mark_tl }
- \@@_hyperref_make_currentHref:n
- { postnote. \l_@@_note_id_tl .mark }
+ \MakeLinkTarget* { postnote. \l_@@_note_id_tl .mark }
\@@_set_mark_page_label:x { \l_@@_note_id_tl }
\@@_set_user_labels:
- \bool_if:NTF \l_@@_nomark_bool
- {
- \bool_if:NT \l_@@_hyperlink_bool
- {
- \@@_hyperref_set_anchor:n
- { postnote. \l_@@_note_id_tl .mark }
- }
- }
+ \bool_if:NF \l_@@_nomark_bool
{
\@@_typeset_mark:xV
{ \l_@@_note_id_tl } \l_@@_mark_tl
@@ -898,16 +897,22 @@
\bool_new:N \l_@@_maybe_multi_bool
\keys_define:nn { postnotes/note }
{
- mark .tl_set:N = \l_@@_mark_tl ,
- mark .value_required:n = true ,
- nomark .bool_set:N = \l_@@_nomark_bool ,
- nomark .default:n = true ,
+ markstr .tl_set:N = \l_@@_mark_tl ,
+ markstr .value_required:n = true ,
sortnum .code:n =
{
\fp_set:Nn \l_@@_sort_num_fp {#1}
\bool_set_true:N \l_@@_manual_sortnum_bool
} ,
sortnum .value_required:n = true ,
+ mark .meta:n =
+ {
+ markstr = {#1} ,
+ sortnum = {#1} ,
+ } ,
+ mark .value_required:n = true ,
+ nomark .bool_set:N = \l_@@_nomark_bool ,
+ nomark .default:n = true ,
label .tl_set:N = \l_@@_note_label_tl ,
label .value_required:n = true ,
}
@@ -981,7 +986,6 @@
{
\bool_if:NTF \l_@@_hyperlink_bool
{
- \@@_hyperref_set_anchor:n { postnote. #1 .mark }
\@@_make_mark:nnn {#2}
{ \hyper@linkstart { link } { postnote. #1 .text } }
{ \hyper@linkend }
@@ -1054,7 +1058,7 @@
\hyperref [#2]
{ \@@_make_mark:nnn { \ref*{#2} } { } { } }
}
- { \@@_make_mark:nnn { \@@_ref_star:n {#2} } { } { } }
+ { \@@_make_mark:nnn { \ref*{#2} } { } { } }
}
\group_end:
}
@@ -1078,7 +1082,16 @@
\NewDocumentCommand \postnotesection { O { } +m }
{ \@@_section:nn {#1} {#2} }
\NewDocumentCommand \postnotesectionx { O { } +m }
- { \@@_section:nx {#1} {#2} }
+ {
+ % NOTE Command deprecated in 2022-12-27 for v0.2.0.
+ \msg_warning:nn { postnotes } { postnotesectionx-deprecated }
+ \postnotesection [ #1 , exp ] {#2}
+ }
+\msg_new:nnn { postnotes } { postnotesectionx-deprecated }
+ {
+ '\iow_char:N\\postnotesectionx'~is~deprecated~\msg_line_context:.~
+ Use~the~'exp'~option~of~'\iow_char:N\\postnotesection'~instead.
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1097,10 +1110,11 @@
\seq_gput_right:Nx \g_@@_queue_seq { \l_@@_note_id_tl }
\tl_gclear:N \g_@@_section_name_tl
\keys_set:nn { postnotes/section } {#1}
- \@@_store_section:nn { \l_@@_note_id_tl } {#2}
+ \bool_if:NTF \l_@@_section_exp_bool
+ { \@@_store_section:nx { \l_@@_note_id_tl } {#2} }
+ { \@@_store_section:nn { \l_@@_note_id_tl } {#2} }
\group_end:
}
-\cs_generate_variant:Nn \@@_section:nn { nx }
% \end{macrocode}
% \end{macro}
%
@@ -1111,10 +1125,14 @@
%
% \begin{macrocode}
\tl_new:N \g_@@_section_name_tl
+\bool_new:N \l_@@_section_exp_bool
\keys_define:nn { postnotes/section }
{
name .tl_gset:N = \g_@@_section_name_tl ,
name .value_required:n = true ,
+ exp .bool_set:N = \l_@@_section_exp_bool ,
+ exp .initial:n = false ,
+ exp .default:n = true ,
}
% \end{macrocode}
%
@@ -1208,7 +1226,8 @@
% that the particular value of \texttt{postnotesection} is of little practical
% meaning, it really is just meant to provide recognizable ``bounds'' for
% \texttt{postnote} along the printing of the notes. Indeed, it is
-% initialized to a very high value, so that ``marks'' and ``texts'' don't mix
+% initialized to a very high value (larger than the conceivable number of
+% postnote sections in a document), so that ``marks'' and ``texts'' don't mix
% in the same reference list, which would occur if the enclosing counters of
% both belonged to the same range, and with somewhat arbitrary results, since
% we cannot ensure the step of the enclosing counter along the document
@@ -1341,10 +1360,10 @@
{ \l_@@_print_counter_tl }
\cs_set:Npx \@currentlabel
{ \p@postnote \l_@@_print_mark_tl }
- \@@_hyperref_make_currentHref:n
- { postnote. \l_@@_print_note_id_tl .text }
\@@_text_mark_wrapper:n
{
+ \MakeLinkTarget*
+ { postnote. \l_@@_print_note_id_tl .text }
\@@_set_text_page_label:x
{ \l_@@_print_note_id_tl }
\@@_typeset_text_mark:eV
@@ -1420,16 +1439,13 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_typeset_text_mark:nn #1#2
{
- \bool_if:NTF \l_@@_hyperlink_bool
+ \bool_lazy_and:nnTF
+ { \l_@@_hyperlink_bool }
+ { \l_@@_backlink_bool }
{
- \@@_hyperref_set_anchor:n { postnote. #1 .text }
- \bool_if:NTF \l_@@_backlink_bool
- {
- \@@_make_text_mark:nnn {#2}
- { \hyper@linkstart { link } { postnote. #1 .mark } }
- { \hyper@linkend }
- }
- { \@@_make_text_mark:nnn {#2} { } { } }
+ \@@_make_text_mark:nnn {#2}
+ { \hyper@linkstart { link } { postnote. #1 .mark } }
+ { \hyper@linkend }
}
{ \@@_make_text_mark:nnn {#2} { } { } }
}
@@ -1437,10 +1453,7 @@
\cs_new_protected:Npn \@@_text_mark_wrapper:n #1
{
\bool_if:NTF \l_@@_print_as_list_bool
- {
- \item
- [ \l_@@_pre_textmark_tl #1 \l_@@_post_textmark_tl ]
- }
+ { \item [ \l_@@_pre_textmark_tl #1 \l_@@_post_textmark_tl ] }
{ \l_@@_pre_textmark_tl #1 \l_@@_post_textmark_tl }
}
% \end{macrocode}
@@ -1968,47 +1981,6 @@
% \end{macrocode}
%
%
-% \subsection*{\pkg{hyperref}}
-%
-% \begin{macrocode}
-\bool_new:N \g_@@_hyperref_loaded_bool
-\AddToHook { package/hyperref/after }
- { \bool_gset_true:N \g_@@_hyperref_loaded_bool }
-% \end{macrocode}
-%
-% \begin{macro}
-% {
-% \@@_hyperref_make_currentHref:n ,
-% \@@_hyperref_set_anchor:n ,
-% \@@_ref_star:n ,
-% }
-% Auxiliary functions for \pkg{hyperref} support.
-% \begin{syntax}
-% \cs{@@_hyperref_make_currentHref:n} \Arg{anchor/destination}
-% \cs{@@_hyperref_set_anchor:n} \Arg{anchor/destination}
-% \cs{@@_ref_star:n} \Arg{label}
-% \end{syntax}
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_hyperref_make_currentHref:n #1
- {
- \bool_if:NT \g_@@_hyperref_loaded_bool
- { \Hy@MakeCurrentHref {#1} }
- }
-\cs_new_protected:Npn \@@_hyperref_set_anchor:n #1
- {
- \bool_if:NT \g_@@_hyperref_loaded_bool
- { \Hy@raisedlink { \hyper@anchor {#1} } }
- }
-\cs_new_protected:Npn \@@_ref_star:n #1
- {
- \bool_if:NTF \g_@@_hyperref_loaded_bool
- { \ref*{#1} }
- { \ref{#1} }
- }
-% \end{macrocode}
-% \end{macro}
-%
-%
% \subsection*{\pkg{biblatex}}
%
% Thanks \contributor{Moritz Wemheuer}:
@@ -2389,7 +2361,12 @@
% \cs{textnormal}, \cs{textup}, etc.) in inline math environments is not
% supported. If a note really needs to be there, one can use the \opt{nomark}
% option and \cs{postnoteref}. Things should work in text mode and in display
-% style.
+% style. For some related discussion with regard to footnotes,
+% see \url{https://tex.stackexchange.com/a/82820} and, in particular, Barbara
+% Beeton's comment: ``This is certainly bravura code. I do hope it doesn't
+% result in a request to add \cs{footnote} capabilities to \pkg{amsmath}'s
+% multi-line display facilities. (The answer will almost certainly be "no".
+% We agree with Kopka \& Daly.)''
% \begin{macrocode}
\AddToHook { postnotes/note/begin } [ postnotes ]
{
@@ -2640,9 +2617,13 @@
%
% \subsection*{French}
%
-% French localization validated by \contributor{\texttt{Pika78}} at
+% French localization validated by \contributor{\username{Pika78}} at
% \githubissue{1}.
%
+% \pkg{babel-french} also has \file{.ldf}s for \texttt{francais},
+% \texttt{frenchb}, and \texttt{canadien}, but they are deprecated as options
+% and, if used, they fall back to either \texttt{french} or \texttt{acadian}.
+%
% \begin{macrocode}
\@@_define_language:nn { french }
{
@@ -2651,11 +2632,8 @@
\tl_set:Nn \pnhdtopage { de~la~page }
\tl_set:Nn \pnhdtopages { des~pages }
}
-\@@_set_babel_language:nn { french } { french }
-\@@_set_babel_language:nn { acadian } { french }
-\@@_set_babel_language:nn { canadien } { french }
-\@@_set_babel_language:nn { francais } { french }
-\@@_set_babel_language:nn { frenchb } { french }
+\@@_set_babel_language:nn { french } { french }
+\@@_set_babel_language:nn { acadian } { french }
\@@_set_polyglossia_language:nn { french } { french }
% \end{macrocode}
%
@@ -2665,6 +2643,10 @@
% German localization provided by \contributor{Herbert Voß} at
% \githubissue{2}.
%
+% \pkg{babel-german} also has \file{.ldf}s for \texttt{germanb} and
+% \texttt{ngermanb}, but they are deprecated as options and, if used, they
+% fall back respectively to \texttt{german} and \texttt{ngerman}.
+%
% \begin{macrocode}
\@@_define_language:nn { german }
{
diff --git a/Master/texmf-dist/tex/latex/postnotes/postnotes.sty b/Master/texmf-dist/tex/latex/postnotes/postnotes.sty
index 747e8faab55..1a55e28309a 100644
--- a/Master/texmf-dist/tex/latex/postnotes/postnotes.sty
+++ b/Master/texmf-dist/tex/latex/postnotes/postnotes.sty
@@ -43,17 +43,17 @@
%% -----------------------------------------------------------------------
%%
\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
-\IfFormatAtLeastTF{2021-11-15}
+\IfFormatAtLeastTF{2022-06-01}
{}
{%
\PackageError{postnotes}{LaTeX kernel too old}
{%
- 'postnotes' requires a LaTeX kernel 2021-11-15 or newer.%
+ 'postnotes' requires a LaTeX kernel 2022-06-01 or newer.%
\MessageBreak Loading will abort!%
}%
\endinput
}%
-\ProvidesExplPackage {postnotes} {2022-11-13} {0.1.7}
+\ProvidesExplPackage {postnotes} {2022-12-28} {0.2.0}
{Endnotes for LaTeX}
\cs_new:Npn \__postnotes_data_name:n #1
{ g__postnotes_ #1 _data_prop }
@@ -102,6 +102,7 @@
{ \thesection }
\prop_gput:cnn { \__postnotes_data_name:e {#1} } { content } {#2}
}
+\cs_generate_variant:Nn \__postnotes_store_section:nn { nx }
\cs_new_protected:Npn \__postnotes_prop_get:nnN #1#2#3
{
\prop_get:cnNF { \__postnotes_data_name:e {#1} } {#2} #3
@@ -369,18 +370,10 @@
\UseHook { postnotes/note/begin }
\cs_set:Npn \@currentcounter { postnote }
\cs_set:Npx \@currentlabel { \p@postnote \l__postnotes_mark_tl }
- \__postnotes_hyperref_make_currentHref:n
- { postnote. \l__postnotes_note_id_tl .mark }
+ \MakeLinkTarget* { postnote. \l__postnotes_note_id_tl .mark }
\__postnotes_set_mark_page_label:x { \l__postnotes_note_id_tl }
\__postnotes_set_user_labels:
- \bool_if:NTF \l__postnotes_nomark_bool
- {
- \bool_if:NT \l__postnotes_hyperlink_bool
- {
- \__postnotes_hyperref_set_anchor:n
- { postnote. \l__postnotes_note_id_tl .mark }
- }
- }
+ \bool_if:NF \l__postnotes_nomark_bool
{
\__postnotes_typeset_mark:xV
{ \l__postnotes_note_id_tl } \l__postnotes_mark_tl
@@ -397,16 +390,22 @@
\bool_new:N \l__postnotes_maybe_multi_bool
\keys_define:nn { postnotes/note }
{
- mark .tl_set:N = \l__postnotes_mark_tl ,
- mark .value_required:n = true ,
- nomark .bool_set:N = \l__postnotes_nomark_bool ,
- nomark .default:n = true ,
+ markstr .tl_set:N = \l__postnotes_mark_tl ,
+ markstr .value_required:n = true ,
sortnum .code:n =
{
\fp_set:Nn \l__postnotes_sort_num_fp {#1}
\bool_set_true:N \l__postnotes_manual_sortnum_bool
} ,
sortnum .value_required:n = true ,
+ mark .meta:n =
+ {
+ markstr = {#1} ,
+ sortnum = {#1} ,
+ } ,
+ mark .value_required:n = true ,
+ nomark .bool_set:N = \l__postnotes_nomark_bool ,
+ nomark .default:n = true ,
label .tl_set:N = \l__postnotes_note_label_tl ,
label .value_required:n = true ,
}
@@ -441,7 +440,6 @@
{
\bool_if:NTF \l__postnotes_hyperlink_bool
{
- \__postnotes_hyperref_set_anchor:n { postnote. #1 .mark }
\__postnotes_make_mark:nnn {#2}
{ \hyper@linkstart { link } { postnote. #1 .text } }
{ \hyper@linkend }
@@ -485,14 +483,23 @@
\hyperref [#2]
{ \__postnotes_make_mark:nnn { \ref*{#2} } { } { } }
}
- { \__postnotes_make_mark:nnn { \__postnotes_ref_star:n {#2} } { } { } }
+ { \__postnotes_make_mark:nnn { \ref*{#2} } { } { } }
}
\group_end:
}
\NewDocumentCommand \postnotesection { O { } +m }
{ \__postnotes_section:nn {#1} {#2} }
\NewDocumentCommand \postnotesectionx { O { } +m }
- { \__postnotes_section:nx {#1} {#2} }
+ {
+ % NOTE Command deprecated in 2022-12-27 for v0.2.0.
+ \msg_warning:nn { postnotes } { postnotesectionx-deprecated }
+ \postnotesection [ #1 , exp ] {#2}
+ }
+\msg_new:nnn { postnotes } { postnotesectionx-deprecated }
+ {
+ '\iow_char:N\\postnotesectionx'~is~deprecated~\msg_line_context:.~
+ Use~the~'exp'~option~of~'\iow_char:N\\postnotesection'~instead.
+ }
\int_new:N \g__postnotes_sectid_int
\cs_new_protected:Npn \__postnotes_section:nn #1#2
{
@@ -502,15 +509,20 @@
\seq_gput_right:Nx \g__postnotes_queue_seq { \l__postnotes_note_id_tl }
\tl_gclear:N \g__postnotes_section_name_tl
\keys_set:nn { postnotes/section } {#1}
- \__postnotes_store_section:nn { \l__postnotes_note_id_tl } {#2}
+ \bool_if:NTF \l__postnotes_section_exp_bool
+ { \__postnotes_store_section:nx { \l__postnotes_note_id_tl } {#2} }
+ { \__postnotes_store_section:nn { \l__postnotes_note_id_tl } {#2} }
\group_end:
}
-\cs_generate_variant:Nn \__postnotes_section:nn { nx }
\tl_new:N \g__postnotes_section_name_tl
+\bool_new:N \l__postnotes_section_exp_bool
\keys_define:nn { postnotes/section }
{
name .tl_gset:N = \g__postnotes_section_name_tl ,
name .value_required:n = true ,
+ exp .bool_set:N = \l__postnotes_section_exp_bool ,
+ exp .initial:n = false ,
+ exp .default:n = true ,
}
\NewDocumentCommand \printpostnotes { }
{ \__postnotes_print_notes: }
@@ -627,10 +639,10 @@
{ \l__postnotes_print_counter_tl }
\cs_set:Npx \@currentlabel
{ \p@postnote \l__postnotes_print_mark_tl }
- \__postnotes_hyperref_make_currentHref:n
- { postnote. \l__postnotes_print_note_id_tl .text }
\__postnotes_text_mark_wrapper:n
{
+ \MakeLinkTarget*
+ { postnote. \l__postnotes_print_note_id_tl .text }
\__postnotes_set_text_page_label:x
{ \l__postnotes_print_note_id_tl }
\__postnotes_typeset_text_mark:eV
@@ -673,16 +685,13 @@
{ Empty~'\iow_char:N\\printpostnotes'~\msg_line_context:. }
\cs_new_protected:Npn \__postnotes_typeset_text_mark:nn #1#2
{
- \bool_if:NTF \l__postnotes_hyperlink_bool
+ \bool_lazy_and:nnTF
+ { \l__postnotes_hyperlink_bool }
+ { \l__postnotes_backlink_bool }
{
- \__postnotes_hyperref_set_anchor:n { postnote. #1 .text }
- \bool_if:NTF \l__postnotes_backlink_bool
- {
- \__postnotes_make_text_mark:nnn {#2}
- { \hyper@linkstart { link } { postnote. #1 .mark } }
- { \hyper@linkend }
- }
- { \__postnotes_make_text_mark:nnn {#2} { } { } }
+ \__postnotes_make_text_mark:nnn {#2}
+ { \hyper@linkstart { link } { postnote. #1 .mark } }
+ { \hyper@linkend }
}
{ \__postnotes_make_text_mark:nnn {#2} { } { } }
}
@@ -690,10 +699,7 @@
\cs_new_protected:Npn \__postnotes_text_mark_wrapper:n #1
{
\bool_if:NTF \l__postnotes_print_as_list_bool
- {
- \item
- [ \l__postnotes_pre_textmark_tl #1 \l__postnotes_post_textmark_tl ]
- }
+ { \item [ \l__postnotes_pre_textmark_tl #1 \l__postnotes_post_textmark_tl ] }
{ \l__postnotes_pre_textmark_tl #1 \l__postnotes_post_textmark_tl }
}
\cs_new_protected:Npn \__postnotes_verify_multipass:N #1
@@ -958,25 +964,6 @@
\cs_if_exist:NT \@captype
{ \bool_set_true:N \l__postnotes_maybe_multi_bool }
}
-\bool_new:N \g__postnotes_hyperref_loaded_bool
-\AddToHook { package/hyperref/after }
- { \bool_gset_true:N \g__postnotes_hyperref_loaded_bool }
-\cs_new_protected:Npn \__postnotes_hyperref_make_currentHref:n #1
- {
- \bool_if:NT \g__postnotes_hyperref_loaded_bool
- { \Hy@MakeCurrentHref {#1} }
- }
-\cs_new_protected:Npn \__postnotes_hyperref_set_anchor:n #1
- {
- \bool_if:NT \g__postnotes_hyperref_loaded_bool
- { \Hy@raisedlink { \hyper@anchor {#1} } }
- }
-\cs_new_protected:Npn \__postnotes_ref_star:n #1
- {
- \bool_if:NTF \g__postnotes_hyperref_loaded_bool
- { \ref*{#1} }
- { \ref{#1} }
- }
\AddToHook { package/biblatex/after }
{
\AddToHook { postnotes/print/begin } [ postnotes ]
@@ -1169,11 +1156,8 @@
\tl_set:Nn \pnhdtopage { de~la~page }
\tl_set:Nn \pnhdtopages { des~pages }
}
-\__postnotes_set_babel_language:nn { french } { french }
-\__postnotes_set_babel_language:nn { acadian } { french }
-\__postnotes_set_babel_language:nn { canadien } { french }
-\__postnotes_set_babel_language:nn { francais } { french }
-\__postnotes_set_babel_language:nn { frenchb } { french }
+\__postnotes_set_babel_language:nn { french } { french }
+\__postnotes_set_babel_language:nn { acadian } { french }
\__postnotes_set_polyglossia_language:nn { french } { french }
\__postnotes_define_language:nn { german }
{