From 51d2ed3f72df7d1a0db22453af2fda5d318eae6f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 27 Apr 2022 19:39:01 +0000 Subject: postnotes (27apr22) git-svn-id: svn://tug.org/texlive/trunk@63160 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md | 10 ++- .../doc/latex/postnotes/postnotes-code.pdf | Bin 804363 -> 808643 bytes .../texmf-dist/doc/latex/postnotes/postnotes.pdf | Bin 176458 -> 177239 bytes .../texmf-dist/doc/latex/postnotes/postnotes.tex | 71 ++++++++++++--------- .../source/latex/postnotes/postnotes.dtx | 49 +++++++++++--- .../texmf-dist/tex/latex/postnotes/postnotes.sty | 18 +++++- 6 files changed, 105 insertions(+), 43 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md b/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md index dad884203a9..27ebf1ab31c 100644 --- a/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md @@ -1,6 +1,14 @@ # Changelog -## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.1.1...HEAD) +## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.1.2...HEAD) + +## [v0.1.2](https://github.com/gusbrs/postnotes/compare/v0.1.1...v0.1.2) (2022-04-27) + +### Added +- `\postnotesectionx`, a version of `\postnotesection` which expands the + content in place. +- French localization (see issue + [#1](https://github.com/gusbrs/postnotes/issues/1)). ## [v0.1.1](https://github.com/gusbrs/postnotes/compare/v0.1.0...v0.1.1) (2022-04-21) diff --git a/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf b/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf index ac1c84d450d..8271b11509b 100644 Binary files a/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf and b/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf differ diff --git a/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf b/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf index 56441582f2c..69960a6f33e 100644 Binary files a/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf and b/Master/texmf-dist/doc/latex/postnotes/postnotes.pdf differ diff --git a/Master/texmf-dist/doc/latex/postnotes/postnotes.tex b/Master/texmf-dist/doc/latex/postnotes/postnotes.tex index eab8f438ed6..c47a9d9cdfe 100644 --- a/Master/texmf-dist/doc/latex/postnotes/postnotes.tex +++ b/Master/texmf-dist/doc/latex/postnotes/postnotes.tex @@ -278,7 +278,10 @@ 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}. +\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''). \begin{function}{\printpostnotes} \begin{syntax} @@ -525,33 +528,35 @@ 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 stored at the place \cs{postnotesection} is called, and made available at the -point it's content gets expanded by means of some variables. When the content -of a notes section gets typeset, \cs{pnthechapter} contains the value of -\cs{thechapter} where \cs{postnotesection} was originally called. Similarly, -\cs{pnthesection} contains the value of \cs{thesection}. -\cs{pnthechapternextnote} and \cs{pnthesectionnextnote} are meant to support -the automation of the notes subdivision by using hooks to sectioning commands, -which is a quite natural way to do this. However, since it may be problematic -to hook \emph{after} sectioning commands -- \cs{section}, for example, figures -prominently in the documentation of \pkg{ltcmdhooks} as a case of ``look -ahead'' command for which the \texttt{after} hook is not supported -- we will -typically want to hook \emph{before} them. But, at this point the values of -the \texttt{chapter} or \texttt{section} counters have not yet been stepped, -therefore \cs{thechapter} and \cs{thesection} do not correspond to what we -would like to refer to. For this reason, \cs{pnthechapternextnote} contains -the value of \cs{thechapter} at the point the ``next note'' is placed (a -\cs{postnote}, that is), the first in the chapter, and already inside it, thus -with an expected value of the \texttt{chapter} counter. Similarly, -\cs{pnthesectionnextnote} contains the value of \cs{thesection} for the ``next -note''. Of course, the ``next note'' variables are \emph{proxies}, but they -are meant to support the automation of the subdivision of the notes through -the use of \texttt{before} hooks to the document's sectioning commands, in -which case the subdivision of the notes will correspond to the document's -structure and, given empty notes sections are skipped, the values will be the -ones we are interested in. But more complex use cases may require something -different. Either way, it is up to the user to judge whether the \emph{proxy} -is a good one for their use case, the variables just do what they say, and -contain the values of interest for the ``next note''. +point it's content gets expanded by means of some variables (you can use +\cs{postnotesectionx} instead, in which case these variables are of little +use). When the content of a notes section gets typeset, \cs{pnthechapter} +contains the value of \cs{thechapter} where \cs{postnotesection} was +originally called. Similarly, \cs{pnthesection} contains the value of +\cs{thesection}. \cs{pnthechapternextnote} and \cs{pnthesectionnextnote} are +meant to support the automation of the notes subdivision by using hooks to +sectioning commands, which is a quite natural way to do this. However, since +it may be problematic to hook \emph{after} sectioning commands -- +\cs{section}, for example, figures prominently in the documentation of +\pkg{ltcmdhooks} as a case of ``look ahead'' command for which the +\texttt{after} hook is not supported -- we will typically want to hook +\emph{before} them. But, at this point the values of the \texttt{chapter} or +\texttt{section} counters have not yet been stepped, therefore \cs{thechapter} +and \cs{thesection} do not correspond to what we would like to refer to. For +this reason, \cs{pnthechapternextnote} contains the value of \cs{thechapter} +at the point the ``next note'' is placed (a \cs{postnote}, that is), the first +in the chapter, and already inside it, thus with an expected value of the +\texttt{chapter} counter. Similarly, \cs{pnthesectionnextnote} contains the +value of \cs{thesection} for the ``next note''. Of course, the ``next note'' +variables are \emph{proxies}, but they are meant to support the automation of +the subdivision of the notes through the use of \texttt{before} hooks to the +document's sectioning commands, in which case the subdivision of the notes +will correspond to the document's structure and, given empty notes sections +are skipped, the values will be the ones we are interested in. But more +complex use cases may require something different. Either way, it is up to +the user to judge whether the \emph{proxy} is a good one for their use case, +the variables just do what they say, and contain the values of interest for +the ``next note''. This is meant to be simple. Some examples might make things more concrete. At its most basic, \cs{postnotesection} can just be set manually: @@ -820,9 +825,9 @@ don't have to worry about them. These strings will automatically adjust to the document language, set either by \pkg{babel} or by \pkg{polyglossia}, \emph{if} the language is supported by -\pkg{postnotes}. Currently supported are English and Portuguese, and their -variants. Either way, you can always change these variables to the values of -your preference. If you are not using either \pkg{babel} or +\pkg{postnotes}. Currently supported are English, French, Portuguese, and +their variants. Either way, you can always change these variables to the +values of your preference. If you are not using either \pkg{babel} or \pkg{polyglossia}, you can do so directly, for example, with: \begin{pnsnippet} \renewcommand*{\pntitle}{My title} @@ -953,6 +958,10 @@ provided by (in chronological order): and Moritz Wemheuer. % 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). + % 2022-04-25: https://github.com/gusbrs/postnotes/issues/1#issuecomment-1108634938 + If I have inadvertently left anyone off the list I apologize, and please let me know, so that I can correct the oversight. diff --git a/Master/texmf-dist/source/latex/postnotes/postnotes.dtx b/Master/texmf-dist/source/latex/postnotes/postnotes.dtx index d8175197546..703466554b8 100644 --- a/Master/texmf-dist/source/latex/postnotes/postnotes.dtx +++ b/Master/texmf-dist/source/latex/postnotes/postnotes.dtx @@ -147,7 +147,7 @@ % % % \begin{macrocode} -\ProvidesExplPackage {postnotes} {2022-04-21} {0.1.1} +\ProvidesExplPackage {postnotes} {2022-04-27} {0.1.2} {Endnotes for LaTeX} % \end{macrocode} % @@ -1064,14 +1064,21 @@ % % \section{\cs{postnotesection}} % -% \begin{macro}[int]{\postnotesection} -% Provide \cs{postnotesection}. +% \begin{macro}[int] +% { +% \postnotesection , +% \postnotesectionx , +% } +% Provide \cs{postnotesection} and \cs{postnotesectionx}. % \begin{syntax} % \cs{postnotesection}\oarg{options}\marg{section content} +% \cs{postnotesectionx}\oarg{options}\marg{section content} % \end{syntax} % \begin{macrocode} \NewDocumentCommand \postnotesection { O { } +m } { \@@_section:nn {#1} {#2} } +\NewDocumentCommand \postnotesectionx { O { } +m } + { \@@_section:nx {#1} {#2} } % \end{macrocode} % \end{macro} % @@ -1093,6 +1100,7 @@ \@@_store_section:nn { \l_@@_note_id_tl } {#2} \group_end: } +\cs_generate_variant:Nn \@@_section:nn { nx } % \end{macrocode} % \end{macro} % @@ -1458,9 +1466,9 @@ % must have been stored with the \cs{l_@@_maybe_multi_bool} set to % \texttt{true}, which is then saved in the \texttt{multibool} property. One % implication of this procedure is that, if there are any new notes marked as -% \texttt{multibool}, (at least) three rounds of compilation will be needed, -% since the labels of the printed notes will be written only on the second run -% and the document will thus require a third one to stabilize. +% \texttt{multibool}, three rounds of compilation will be needed, since the +% labels of the printed notes will be written only on the second run and the +% document will thus require a third one to stabilize. % % \begin{macro}{\@@_verify_multipass:N} % \begin{syntax} @@ -1940,10 +1948,10 @@ % From the user's perspective, one-line captions will just work. For two-line % captions, there are two alternatives: i) decrement the counter by 1 % \texttt{\textbackslash{}addtocounter\{postnote\}\{-1\}} before the caption, -% then call \cs{postnote} inside the caption; or ii) call -% \texttt{\textbackslash{}postnote[nomark]\{\textbackslash{}label\{mynote\}...\}} -% right before the caption, then use -% \texttt{\textbackslash{}postnoteref\{mynote\}} inside the caption. +% then call \cs{postnote} inside the caption; or ii) right before the caption, +% call +% \texttt{\textbackslash{}postnote[nomark]\{\textbackslash{}label\{mynote\}...\}}, +% then use \texttt{\textbackslash{}postnoteref\{mynote\}} inside the caption. % % \begin{macrocode} \AddToHook { postnotes/note/begin } [ postnotes ] @@ -2577,6 +2585,27 @@ % \end{macrocode} % % +% \subsection*{French} +% +% French localization validated by \texttt{Pika78} at \githubissue{1}. +% +% \begin{macrocode} +\@@_define_language:nn { french } + { + \tl_set:Nn \pntitle { Notes } + \tl_set:Nn \pnhdnotes { Notes } + \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_polyglossia_language:nn { french } { french } +% \end{macrocode} +% +% % \begin{macrocode} % % \end{macrocode} diff --git a/Master/texmf-dist/tex/latex/postnotes/postnotes.sty b/Master/texmf-dist/tex/latex/postnotes/postnotes.sty index 9cd8913ae73..a58f51b2821 100644 --- a/Master/texmf-dist/tex/latex/postnotes/postnotes.sty +++ b/Master/texmf-dist/tex/latex/postnotes/postnotes.sty @@ -53,7 +53,7 @@ }% \endinput }% -\ProvidesExplPackage {postnotes} {2022-04-21} {0.1.1} +\ProvidesExplPackage {postnotes} {2022-04-27} {0.1.2} {Endnotes for LaTeX} \cs_new:Npn \__postnotes_data_name:n #1 { g__postnotes_ #1 _data_prop } @@ -491,6 +491,8 @@ } \NewDocumentCommand \postnotesection { O { } +m } { \__postnotes_section:nn {#1} {#2} } +\NewDocumentCommand \postnotesectionx { O { } +m } + { \__postnotes_section:nx {#1} {#2} } \int_new:N \g__postnotes_sectid_int \cs_new_protected:Npn \__postnotes_section:nn #1#2 { @@ -503,6 +505,7 @@ \__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 \keys_define:nn { postnotes/section } { @@ -1207,6 +1210,19 @@ \__postnotes_set_babel_language:nn { portuges } { portuguese } \__postnotes_set_babel_language:nn { brazil } { portuguese } \__postnotes_set_polyglossia_language:nn { portuguese } { portuguese } +\__postnotes_define_language:nn { french } + { + \tl_set:Nn \pntitle { Notes } + \tl_set:Nn \pnhdnotes { Notes } + \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_polyglossia_language:nn { french } { french } %% %% %% End of file `postnotes.sty'. -- cgit v1.2.3