diff options
author | Norbert Preining <norbert@preining.info> | 2019-11-12 03:01:13 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-11-12 03:01:13 +0000 |
commit | a6d73b76eb19794e956fe1f3ab1f9bab3915cd7a (patch) | |
tree | 26a9e14dec31508c4c4bd3ec69dfccef8c39bad2 /macros/latex | |
parent | 0e71c26d9aa79c6e92c3095d6c71f28a566e6054 (diff) |
CTAN sync 201911120301
Diffstat (limited to 'macros/latex')
29 files changed, 2452 insertions, 555 deletions
diff --git a/macros/latex/contrib/acronym/CHANGES b/macros/latex/contrib/acronym/CHANGES index 99ed62c868..f98d1f9b5c 100644 --- a/macros/latex/contrib/acronym/CHANGES +++ b/macros/latex/contrib/acronym/CHANGES @@ -1,3 +1,10 @@ + +Version 1.42 (Nov 2019) + +fix the carriage return with long lines (line 234/235) -- Philippe Chauvat +fix page number display for acfi Acfi -- Tobi Oetiker +fix double space and missing used flag with acfi -- Horst Schirmeier + Version 1.41 (Mar 2015) change names of internal macros to avoid nameing conflics with pageslts @@ -21,7 +28,7 @@ add support for dynamic indefinite articles depending on the acronym form used -- Ash Hughes fix for non hyphenation of first word in long form --- Martin Rler +-- Martin Rüßler fix description of acrodefplural -- Joel Johnson @@ -70,13 +77,13 @@ occurenace to list of acronyms. -- Tobias Oetiker (tobi with oetiker.ch) Version 1.26 (June 2006) supress lone item when nolist is in effect --- Immo Kster <Immo.Koester there rwth-aachen.de> +-- Immo Köster <Immo.Koester there rwth-aachen.de> Version 1.25 (November 2005) properly handle acronyms in pdfbookmarks -- Heiko Oberdiek <oberdiek there uni-freiburg.de> Version 1.24 (October 2005) ac* commands are now not fragile anymore ... --- Jos Emilio Vila Forcn jose.vila there cui.unige.ch +-- José Emilio Vila Forcén jose.vila there cui.unige.ch Version 1.23 (October 2005) fixed typo in nolist option. added comment about fragility of ac commands. -- Tobias Oetiker (tobi with oetiker.ch) @@ -91,7 +98,7 @@ Set acronyms as used in the first run, not only in the second one. -- Tobi Oetiker tobi at oetiker.ch added new option nolist to suppress printing the acronym list all together --- Jos Emilio Vila Forcn jose.vila there cui.unige.ch +-- José Emilio Vila Forcén jose.vila there cui.unige.ch Version 1.20 (August 2005): make the acused command actually work -- Richard Walker Richard.Walker there cs.anu.edu.au diff --git a/macros/latex/contrib/acronym/README b/macros/latex/contrib/acronym/README index cb17146dca..92bc92d41b 100644 --- a/macros/latex/contrib/acronym/README +++ b/macros/latex/contrib/acronym/README @@ -1,19 +1,16 @@ -I'd like to announce the availability of -my LaTeX2e acronym Package from CTAN. +An Acronym Environment for LaTeX INSTALLATION: - call 'latex acronym.ins' and copy the acronym.sty - file into a path searched by LaTeX. - to re-generate the documentation, call latex acronym.dtx -When writing a paper on cellular mobile radio I started to used a lot -of acronyms. This can be very disturbing for the reader, as he might -not know all the used acronyms. To help the reader I kept a list of -all the acronyms at the end of my paper. +While writing a paper on cellular mobile radio I had to used a lot of +acronyms. Acronyms can be quite disturbing for the novice reader ... -This package makes sure, that all acronyms used in the text are -spelled out in full at least once. And it provides an environment to -keep a list of used acronyms. +The Acronym package provides tooling to make sure that all acronyms used in +the text are spelled out in full at least once and it provides an +environment to keep a list of used acronyms. Note that acronym requires the 'suffix' package. You can find it on CTAN:macros/latex/contrib/bigfoot/ @@ -24,4 +21,3 @@ Files of the `acronym' package: acronym.ins Installation script generating the source and an example acronym.pdf PDF Version of the Docs CHANGES list of changes - diff --git a/macros/latex/contrib/acronym/acronym.dtx b/macros/latex/contrib/acronym/acronym.dtx index 6e54f37dc0..62df769abb 100644 --- a/macros/latex/contrib/acronym/acronym.dtx +++ b/macros/latex/contrib/acronym/acronym.dtx @@ -2,7 +2,7 @@ % % Doc-Source file to use with LaTeX2e % -% Copyright 1994-2015 by Tobias Oetiker (tobi@oetiker.ch) and many Contributors. +% Copyright 1994-2019 by Tobias Oetiker (tobi@oetiker.ch) and many Contributors. % All rights reserved. % % This work may be distributed and/or modified under the conditions of @@ -35,7 +35,7 @@ %</driver> % \fi % -% \CheckSum{1062} +% \CheckSum{1389} % %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -83,6 +83,7 @@ % \DoNotIndex{\usepackage} % % +% \changes{v1.42}{2019/11/11}{Philippe Chauvat \cmd{hskip} Fix the carriage return with long lines, Tobi Oetiker and Horst Schirmeier fixed usedflag and page number entries for acfi and Acfi} % \changes{v1.41}{2015/03/21}{Tobi Oetiker and Jason Mills \cmd{hskip} fix nameing conflicts with pageslts package} % \changes{v1.40}{2014/09/29}{Hartmut Henkel - remove \cmd{hskip} instances, since they cause bad formating since space at the end of a line can not be collapsed anymore} % \changes{v1.39}{2014/08/14}{Yann Leprince - make the appearance of labels consistent whether or not the acronym environment has its optional argument provided} @@ -180,7 +181,7 @@ % \DescribeMacro{\ac} % To enter an acronym inside the text, use the % \begin{quote} -% |\ac{|\meta{acronym}|}| +% |\ac[|\meta{linebreak penalty}|]{|\meta{acronym}|}| % \end{quote} % command. The first time you use an acronym, the full name of the % acronym along with the acronym in brackets will be printed. If you @@ -189,6 +190,18 @@ % The next time you access the acronym only the acronym will % be printed. % +% When an acronym is being used, for the first time (with the |footnote| +% option not specified), next to the end of the line, a line break between +% the full name of the acronym and the acronym in brackets can be +% encountered. The optional variable represents the penalty level of +% breaking the line at that place, taking integer values between 0 and 4. +% A higher number corresponds to a higher penalty. +% +% \DescribeMacro{\Ac} +% Works in the same way as \cmd{\ac}, but starts the long form with an +% upper case letter. Use case: when the acronym is used for the first +% time, at the beginning of a sentence. +% % \DescribeMacro{\acresetall} % The 'memory' of the macro \cmd{\ac} can be flushed by calling the macro % \cmd{\acresetall}. Afterwards, \cmd{\ac} will print the full name of any @@ -198,11 +211,20 @@ % If later in the text again the Full Name of the acronym should be % printed, use the command % \begin{quote} -% |\acf{|\meta{acronym}|}| +% |\acf[|\meta{linebreak penalty}|]{|\meta{acronym}|}| % \end{quote} % to access the acronym. It stands for ``full acronym'' and it -% always prints the full name -% and the acronym in brackets. +% always prints the full name and the acronym in brackets. +% +% When an full acronym is being used next to the end of the line, a line +% break between the full name of the acronym and the acronym in brackets +% can be encountered. The optional variable represents the penalty level +% of breaking the line at that place, taking integer values between 0 +% and 4. A higher number corresponds to a higher penalty. +% +% \DescribeMacro{\Acf} +% Works in the same way as \cmd{\acf}, but starts the long form with an +% upper case letter. % % \DescribeMacro{\acs} % To get the short version of the acronym, use the command @@ -217,13 +239,25 @@ % |\acl{|\meta{acronym}|}| % \end{quote} % +% \DescribeMacro{\Acl} +% Works in the same way as \cmd{\acl}, but starts with an upper case +% letter. +% % \DescribeMacro{\acp} % Works in the same way as \cmd{\ac}, but makes the short and/or -% long forms into plurals. +% long forms into plurals. +% +% \DescribeMacro{\Acp} +% Works in the same way as \cmd{\acp}, but starts the long form with an +% upper case letter. % % \DescribeMacro{\acfp} % Works in the same way as \cmd{\acf}, but makes the short and -% long forms into plurals. +% long forms into plurals. +% +% \DescribeMacro{\Acfp} +% Works in the same way as \cmd{\acfp}, but starts the long form with an +% upper case letter. % % \DescribeMacro{\acsp} % Works in the same way as \cmd{\acs}, but makes the short @@ -233,9 +267,18 @@ % Works in the same way as \cmd{\acl}, but makes the long form % into a plural. % +% \DescribeMacro{\Aclp} +% Works in the same way as \cmd{\aclp}, but starts with an upper case +% letter. +% % \DescribeMacro{\acfi} -% Prints the Full Name acronym (\cmd{\acl}) in italics and the abbreviated -% form (\cmd{\acs}) in upshaped form. +% Works in the same way as \cmd{\acf}, but prints the Full Name acronym +% (\cmd{\acl}) in italics and the abbreviated form (\cmd{\acs}) in +% upshaped form. +% +% \DescribeMacro{\Acfi} +% Works in the same way as \cmd{\acfi}, but starts the long form with an +% upper case letter. % % \DescribeMacro{\acused} % Marks an acronym as used, as if it had been called with \cmd{\ac}, @@ -248,6 +291,10 @@ % \DescribeMacro{\aclu} % Prints the long form of the acronym and marks it as used. % +% \DescribeMacro{\Aclu} +% Works in the same way as \cmd{\aclu}, but starts with an upper case +% letter. +% % Example: |\acl{lox}/\acl{lh2} (\acsu{lox}/\acsu{lh2})| % % \DescribeMacro{\iac} @@ -263,9 +310,10 @@ % that the acronym will not be marked as used. If you work with the 'onlyused' % option then macros which have only been used with starred commands will % not show up.\\ -% \cmd{\ac*}, \cmd{\acs*}, \cmd{\acl*}, \cmd{\acf*}, \cmd{\acp*}, -% \cmd{\acsp*}, \cmd{\aclp*}, \cmd{\acfp*}, \cmd{\acfi*}, \cmd{\acsu*}, -% \cmd{\aclu*}, \cmd{\iac*} and \cmd{\Iac*}. +% \cmd{\ac*}, \cmd{\Ac*}, \cmd{\acs*}, \cmd{\acl*}, \cmd{\Acl*}, \cmd{\acf*}, +% \cmd{\Acf*}, \cmd{\acp*}, \cmd{\Acp*}, \cmd{\acsp*}, \cmd{\aclp*}, \cmd{\Aclp*}, +% \cmd{\acfp*}, \cmd{\Acfp*}, \cmd{\acfi*}, \cmd{\Acfi*}, \cmd{\acsu*}, +% \cmd{\aclu*}, \cmd{\Aclu*}, \cmd{\iac*} and \cmd{\Iac*}. % % \subsection{Customization} % @@ -287,7 +335,7 @@ % handles the output of \cmd{\acf}, where the included acronym % goes through \DescribeMacro{\acfsfont}\cmd{\acfsfont} (and % \cmd{\acsfont}). -% The plural forms are treated accordingly. Usually the +% The plural and upper case forms are treated accordingly. Usually the % three macros do nothing. To give an example, the option |smaller| % makes \cmd{\acsfont} use the command \cmd{\textsmaller} from the % |relsize| package: @@ -496,7 +544,7 @@ % but please note the following: % \begin{itemize} % \item Do not use the general form (\cmd{\ac} or \cmd{\acp}) in -% sectional headers, because it will the uses the full name the first time, +% sectional headers, because it will uses the full name the first time, % that is in the table of contents, and the short form further on. % % \item The text of \meta{acronym} is used verbatim in bookmarks and @@ -509,7 +557,7 @@ % for example: % \begin{quote} % |\acro{Nx}[\ensuremath{N_{\chi}}]|\\ -% | {\texorpdfstring{$\chi$}{X}-faktor}| +% | {\texorpdfstring{$\chi$}{X}-factor}| % \end{quote} % which will then give % \begin{quote}\begin{tabbing} @@ -577,6 +625,10 @@ between the constant of Boltzmann and the \acl{NA}: \acl{lox}/\acl{lh2} (\acsu{lox}/\acsu{lh2}) +\Acp{LFVP} are processes in which the lepton number of the initial +and final states are different. An example for \iac{LFVP} is +neutrinoless double beta decay. + \subsection{Some testing fundamentals} When testing \acp{IC}, one typically wants to identify functional blocks to be tested separately. The latter are commonly indicated as @@ -589,6 +641,8 @@ blocks to be tested separately. The latter are commonly indicated as \acro{NA}[\ensuremath{N_{\mathrm A}}] {Number of Avogadro\acroextra{ (see \S\ref{Chem})}} \acro{NAD+}[NAD\textsuperscript{+}]{Nicotinamide Adenine Dinucleotide} + \acro{LFVP}{lepton flavor violating process} + \acroindefinite{LFVP}{an}{a} \acro{NUA}{Not Used Acronym} \acro{TDMA}{Time Division Multiple Access} \acro{UA}{Used Acronym} @@ -621,8 +675,8 @@ blocks to be tested separately. The latter are commonly indicated as % First we test that we got the right format and name the package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{acronym}[2015/03/21 - v1.41 +\ProvidesPackage{acronym}[2019/11/11 + v1.42 Support for acronyms (Tobias Oetiker)] \RequirePackage{suffix,xstring} % \end{macrocode} @@ -632,8 +686,9 @@ blocks to be tested separately. The latter are commonly indicated as % \subsection{Options} % % \begin{macro}{\ifAC@footnote} -% The option |footnote| leads to a redefinition of \cmd{\acf} and -% \cmd{\acfp}, making the full name appear as a footnote. +% The option |footnote| leads to a redefinition of \cmd{\acf}, +% \cmd{\Acf}, \cmd{\acfp}, and \cmd{\Acfp}, making the full name appear +% as a footnote. % \begin{macrocode} \newif\ifAC@footnote \AC@footnotefalse @@ -695,10 +750,10 @@ blocks to be tested separately. The latter are commonly indicated as % % \begin{macro}{\ifAC@dua} % The option |dua| stands for ``don't use acronyms''. -% It leads to a redefinition of \cmd{\ac} and -% \cmd{\acp}, making the full name appear all the time +% It leads to a redefinition of \cmd{\ac}, \cmd{\Ac}, \cmd{\acp}, +% and \cmd{\Acp}, making the full name appear all the time % and suppressing all acronyms but the explicity requested by -% \cmd{\acf} or \cmd{\acfp}. +% \cmd{\acf}, \cmd{\Acf}, \cmd{\acfp} or \cmd{\Acfp}. % \begin{macrocode} \newif\ifAC@dua \AC@duafalse @@ -715,6 +770,16 @@ blocks to be tested separately. The latter are commonly indicated as % \end{macrocode} % \end{macro} % +% \begin{macro}{\ifAC@nolinebreak} +% The option |nolinebreak| dictates whether to forbid, by defalt, a line break +% between the full name and the short name, when they are presented together. +% \begin{macrocode} +\newif\ifAC@nolinebreak +\AC@nolinebreakfalse +\DeclareOption{nolinebreak}{\AC@nolinebreaktrue} +% \end{macrocode} +% \end{macro} +% % Now we process the options. % \begin{macrocode} \ProcessOptions\relax @@ -751,6 +816,21 @@ blocks to be tested separately. The latter are commonly indicated as % \end{macro} % \end{macro} % +% \begin{macro}{\AC@linebreakpenalty} +% When the option |nolinebreak| is specified, the default penalty for a line break +% is being set to the maximum. Otherwise, the default penalty is one level below +% the maximum, meaning that most of the times, by default, the line will not get +% broken. +% +% \begin{macrocode} +\ifAC@nolinebreak + \def\AC@linebreakpenalty{4} +\else + \def\AC@linebreakpenalty{3} +\fi +% \end{macrocode} +% \end{macro} +% % \subsection{Hyperlinks and PDF support} % % \begin{macro}{\AC@hyperlink} @@ -814,17 +894,27 @@ blocks to be tested separately. The latter are commonly indicated as }% \def\acs#1{\AChy@call{#1}\AC@acs}% \def\acl#1{\AChy@call{#1}\@acl}% + \def\Acl#1{\AChy@call{#1}\@Acl}% \def\acf#1{\AChy@call{#1}\AChy@acf}% + \def\Acf#1{\AChy@call{#1}\AChy@Acf}% \def\ac#1{\AChy@call{#1}\@ac}% + \def\Ac#1{\AChy@call{#1}\@Ac}% \def\acsp#1{\AChy@call{#1}\@acsp}% \def\aclp#1{\AChy@call{#1}\@aclp}% + \def\Aclp#1{\AChy@call{#1}\@Aclp}% \def\acfp#1{\AChy@call{#1}\AChy@acfp}% + \def\Acfp#1{\AChy@call{#1}\AChy@Acfp}% \def\acp#1{\AChy@call{#1}\@acp}% + \def\Acp#1{\AChy@call{#1}\@Acp}% \def\acfi#1{\AChy@call{#1}\AChy@acf}% + \def\Acfi#1{\AChy@call{#1}\AChy@Acf}% \let\acsu\acs \let\aclu\acl + \let\Aclu\Acl \def\AChy@acf#1{\AC@acl{#1} (\AC@acs{#1})}% + \def\AChy@Acf#1{\AC@Acl{#1} (\AC@acs{#1})}% \def\AChy@acfp#1{\AC@aclp{#1} (\AC@acsp{#1})}% + \def\AChy@Acfp#1{\AC@Aclp{#1} (\AC@acsp{#1})}% }% } % \end{macrocode} @@ -856,7 +946,7 @@ blocks to be tested separately. The latter are commonly indicated as % \begin{macro}{\acresetall} % \begin{macro}{\AC@reset} % This macro resets the |AC@FN| - tag of each acronym, therefore |\ac| -% will use FullName (FN) next time it is called +% will use Full Name (FN) next time it is called % \begin{macrocode} \newcommand*\acresetall{\the\AC@clearlist\AC@clearlist={}} % \end{macrocode} @@ -928,6 +1018,17 @@ blocks to be tested separately. The latter are commonly indicated as % \end{macro} % \end{macro} % +% \begin{macro}{\@firstupper} +% Internal commands for making a first letter upper case. +% \begin{macrocode} +\newcommand{\@firstupper}[1]{% + \StrLeft{#1}{1}[\firstletter]% + \StrGobbleLeft{#1}{1}[\remainder]% + \MakeUppercase\firstletter\remainder% +} +% \end{macrocode} +% \end{macro} +% % % \subsection{Defining acronyms} % @@ -1086,8 +1187,8 @@ blocks to be tested separately. The latter are commonly indicated as full in text}% \else% \dotfill\pageref{acro:#1}% - \fi\\% - \fi% + \fi% + \fi\\% \fi% \else% \item[\protect\AC@hypertarget{#1}{\aclabelfont{#2}}] #3% @@ -1099,7 +1200,8 @@ blocks to be tested separately. The latter are commonly indicated as \protected@write\@auxout{}% {\string\newacro{#1}[\string\AC@hyperlink{#1}{#2}]{#3}}% \@esphack - \endgroup} + \endgroup + \ignorespaces} % \end{macrocode} % \end{macro} % \end{macro} @@ -1220,6 +1322,7 @@ blocks to be tested separately. The latter are commonly indicated as % % % \begin{macro}{\AC@aclp} +% \begin{macro}{\AC@Aclp} % \begin{macro}{\AC@acsp} % Deliver either standard or nonstandard plural form (long and short % respectively). @@ -1231,6 +1334,9 @@ blocks to be tested separately. The latter are commonly indicated as \AC@acl{#1}s% \fi } +\newcommand*\AC@Aclp[1]{% + \@firstupper{\AC@aclp{#1}}% +} \newcommand*\AC@acsp[1]{% \ifcsname fn@#1@PS\endcsname \csname fn@#1@PS\endcsname @@ -1241,7 +1347,7 @@ blocks to be tested separately. The latter are commonly indicated as % \end{macrocode} % \end{macro} % \end{macro} - +% \end{macro} % % \subsection{Using acronyms} % @@ -1277,6 +1383,7 @@ blocks to be tested separately. The latter are commonly indicated as % % \begin{macro}{\AC@acs} % \begin{macro}{\AC@acl} +% \begin{macro}{\AC@Acl} % The internal commands \cmd{\AC@acs} and \cmd{\AC@acl} returns % the (unformatted) short and the long forms of an acronym as % saved in \fnacro. Mbox to prevent hyphenation of short form. @@ -1288,6 +1395,12 @@ blocks to be tested separately. The latter are commonly indicated as \newcommand*\AC@acl[1]{% \expandafter\AC@get\csname fn@#1\endcsname\@secondoftwo{#1}} % \end{macrocode} +% \begin{macrocode} +\newcommand*\AC@Acl[1]{% + \@firstupper{\AC@acl{#1}}% +} +% \end{macrocode} +% \end{macro} % \end{macro} % \end{macro} % @@ -1319,6 +1432,8 @@ blocks to be tested separately. The latter are commonly indicated as % % \begin{macro}{\acl} % \begin{macro}{\@acl} +% \begin{macro}{\Acl} +% \begin{macro}{\@Acl} % The user macro \cmd{\acl} prints the full name of the % acronym. % \begin{macrocode} @@ -1326,10 +1441,21 @@ blocks to be tested separately. The latter are commonly indicated as \WithSuffix\newcommand\acl*{\AC@starredtrue\protect\@acl}% % \end{macrocode} % \begin{macrocode} +\newcommand*{\Acl}{\AC@starredfalse\protect\@Acl}% +\WithSuffix\newcommand\Acl*{\AC@starredtrue\protect\@Acl}% +% \end{macrocode} +% \begin{macrocode} \newcommand*{\@acl}[1]{% \AC@acl{#1}% \ifAC@starred\else\AC@logged{#1}\fi} % \end{macrocode} +% \begin{macrocode} +\newcommand*{\@Acl}[1]{% + \AC@Acl{#1}% + \ifAC@starred\else\AC@logged{#1}\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} % \end{macro} % \end{macro} % @@ -1425,6 +1551,9 @@ blocks to be tested separately. The latter are commonly indicated as % \begin{macro}{\acf} % \begin{macro}{\acfa} % \begin{macro}{\@acf} +% \begin{macro}{\Acf} +% \begin{macro}{\Acfa} +% \begin{macro}{\@Acf} % The user macro \cmd{\acf} always prints the full name with % the acronym. The format depends on \cmd{\acffont} and % \cmd{\acfsfont}, and on the option |footnote| handled below. @@ -1434,72 +1563,112 @@ blocks to be tested separately. The latter are commonly indicated as % % The option |footnote| leads to a redefinition of \cmd{\acf}, % making the full name appear as a footnote. There is then -% no need for \cmd{\acffont} and \cmd{\acfsfont}. +% no need for \cmd{\acffont} and \cmd{\acfsfont}. If the option +% |footnote| is not specified, the optional variable determines +% the penalty for a line break. % \begin{macrocode} \newcommand*{\acf}{\AC@starredfalse\protect\acfa}% \WithSuffix\newcommand\acf*{\AC@starredtrue\protect\acfa}% % \end{macrocode} % \begin{macrocode} -\newcommand*{\acfa}[1]{% - \texorpdfstring{\protect\@acf{#1}}{\AC@acl{#1} (#1)}} +\newcommand*{\Acf}{\AC@starredfalse\protect\Acfa}% +\WithSuffix\newcommand\Acf*{\AC@starredtrue\protect\Acfa}% +% \end{macrocode} +% \begin{macrocode} +\newcommand*{\acfa}[2][\AC@linebreakpenalty]{% + \texorpdfstring{\protect\@acf[#1]{#2}}{\AC@acl{#2} (#2)}} % \end{macrocode} % \begin{macrocode} -\newcommand*{\@acf}[1]{% +\newcommand*{\Acfa}[2][\AC@linebreakpenalty]{% + \texorpdfstring{\protect\@Acf[#1]{#2}}{\AC@Acl{#2} (#2)}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*{\@acf}[2][\AC@linebreakpenalty]{% \ifAC@footnote - \acsfont{\AC@acs{#1}}% - \footnote{\AC@placelabel{#1}\AC@acl{#1}{}}% + \acsfont{\AC@acs{#2}}% + \footnote{\AC@placelabel{#2}\AC@acl{#2}{}}% \else \acffont{% - \AC@placelabel{#1}\AC@acl{#1}% - \nolinebreak[3] % - \acfsfont{(\acsfont{\AC@acs{#1}})}% + \AC@placelabel{#2}\AC@acl{#2}% + \nolinebreak[#1] % + \acfsfont{(\acsfont{\AC@acs{#2}})}% }% \fi - \ifAC@starred\else\AC@logged{#1}\fi} + \ifAC@starred\else\AC@logged{#2}\fi} % \end{macrocode} +% \begin{macrocode} +\newcommand*{\@Acf}[2][\AC@linebreakpenalty]{% + \ifAC@footnote + \acsfont{\AC@acs{#2}}% + \footnote{\AC@placelabel{#2}\AC@Acl{#2}{}}% + \else + \acffont{% + \AC@placelabel{#2}\AC@Acl{#2}% + \nolinebreak[#1] % + \acfsfont{(\acsfont{\AC@acs{#2}})}% + }% + \fi + \ifAC@starred\else\AC@logged{#2}\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\ac} +% \begin{macro}{\@ac} +% \begin{macro}{\Ac} +% \begin{macro}{\@Ac} % The first time an acronym is accessed its Full Name (FN) is % printed. The next time just (FN). When the |footnote| option is -% used the short form (FN) is always used. +% used the short form (FN) is always used. The optional variable +% is being passed to \cmd{\acf}, in case it is used. % \begin{macrocode} \newcommand*{\ac}{\AC@starredfalse\protect\@ac}% \WithSuffix\newcommand\ac*{\AC@starredtrue\protect\@ac}% % \end{macrocode} % \begin{macrocode} -\newcommand{\@ac}[1]{% +\newcommand*{\Ac}{\AC@starredfalse\protect\@Ac}% +\WithSuffix\newcommand\Ac*{\AC@starredtrue\protect\@Ac}% +% \end{macrocode} +% \begin{macrocode} +\newcommand{\@ac}[2][\AC@linebreakpenalty]{% \ifAC@dua - \ifAC@starred\acl*{#1}\else\acl{#1}\fi% + \ifAC@starred\acl*{#2}\else\acl{#2}\fi% \else - \expandafter\ifx\csname AC@#1\endcsname\AC@used% - \ifAC@starred\acs*{#1}\else\acs{#1}\fi% + \expandafter\ifx\csname AC@#2\endcsname\AC@used% + \ifAC@starred\acs*{#2}\else\acs{#2}\fi% \else - \ifAC@starred\acf*{#1}\else\acf{#1}\fi% + \ifAC@starred\acf*[#1]{#2}\else\acf[#1]{#2}\fi% \fi \fi} % \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@firstupper} -% Internal commands for Indefinite article % \begin{macrocode} -\newcommand{\@firstupper}[1]{% - \StrLeft{#1}{1}[\firstletter]% - \StrGobbleLeft{#1}{1}[\remainder]% - \MakeUppercase\firstletter\remainder -} +\newcommand{\@Ac}[2][\AC@linebreakpenalty]{% + \ifAC@dua + \ifAC@starred\Acl*{#2}\else\Acl{#2}\fi% + \else + \expandafter\ifx\csname AC@#2\endcsname\AC@used% + \ifAC@starred\acs*{#2}\else\acs{#2}\fi% + \else + \ifAC@starred\Acf*[#1]{#2}\else\Acf[#1]{#2}\fi% + \fi + \fi} % \end{macrocode} % \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} % % \begin{macro}{\iac} % \begin{macro}{\@iac} % \begin{macro}{\@iaci} % \begin{macro}{\Iac} % \begin{macro}{\@Iac} -% Indefinite article correct expansion +% Indefinite article correct expansion. The optional variable +% is being passed to \cmd{\ac}. % \begin{macrocode} \newcommand*{\iac}{\AC@starredfalse\protect\@iac}% \WithSuffix\newcommand\iac*{\AC@starredtrue\protect\@iac}% @@ -1522,11 +1691,11 @@ blocks to be tested separately. The latter are commonly indicated as a% \fi } -\newcommand*{\@iac}[1]{% - \@iaci{#1} \ifAC@starred\ac*{#1}\else\ac{#1}\fi% +\newcommand*{\@iac}[2][\AC@linebreakpenalty]{% + \@iaci{#2} \ifAC@starred\ac*[#1]{#2}\else\ac[#1]{#2}\fi% } -\newcommand*{\@Iac}[1]{% - \@firstupper{\@iaci{#1}} \ifAC@starred\ac*{#1}\else\ac{#1}\fi% +\newcommand*{\@Iac}[2][\AC@linebreakpenalty]{% + \@firstupper{\@iaci{#2}} \ifAC@starred\ac*[#1]{#2}\else\ac[#1]{#2}\fi% } % \end{macrocode} % \end{macro} @@ -1562,6 +1731,8 @@ blocks to be tested separately. The latter are commonly indicated as % % \begin{macro}{\aclp} % \begin{macro}{\@aclp} +% \begin{macro}{\Aclp} +% \begin{macro}{\@Aclp} % The user macro \cmd{\aclp} prints the plural full name of the % acronym. % \begin{macrocode} @@ -1569,85 +1740,177 @@ blocks to be tested separately. The latter are commonly indicated as \WithSuffix\newcommand\aclp*{\AC@starredtrue\protect\@aclp}% % \end{macrocode} % \begin{macrocode} +\newcommand*{\Aclp}{\AC@starredfalse\protect\@Aclp}% +\WithSuffix\newcommand\Aclp*{\AC@starredtrue\protect\@Aclp}% +% \end{macrocode} +% \begin{macrocode} \newcommand*{\@aclp}[1]{% \AC@aclp{#1}% \ifAC@starred\else\AC@logged{#1}\fi} % \end{macrocode} +% \begin{macrocode} +\newcommand*{\@Aclp}[1]{% + \AC@Aclp{#1}% + \ifAC@starred\else\AC@logged{#1}\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\acfp} % \begin{macro}{\acfpa} % \begin{macro}{\@acfp} +% \begin{macro}{\Acfp} +% \begin{macro}{\Acfpa} +% \begin{macro}{\@Acfp} % The user macro \cmd{\acfp} always prints the plural full name with % the plural of the acronym. The format depends on \cmd{\acffont} and % \cmd{\acfsfont}, and on the option |footnote| handled below. % -% The option |footnote| leads to a redefinition of -% \cmd{\acfp}, making the full name appear as a footnote. -% There is then -% no need for \cmd{\acffont} and \cmd{\acfsfont}. +% The option |footnote| leads to a redefinition of \cmd{\acfp}, +% making the full name appear as a footnote. There is then no need +% for \cmd{\acffont} and \cmd{\acfsfont}. If the option |footnote| is +% not specified, the optional variable determines the penalty for a +% line break. % \begin{macrocode} \newcommand*{\acfp}{\AC@starredfalse\protect\acfpa}% \WithSuffix\newcommand\acfp*{\AC@starredtrue\protect\acfpa}% % \end{macrocode} % \begin{macrocode} -\newcommand*{\acfpa}[1]{% - \texorpdfstring{\protect\@acfp{#1}}{\AC@aclp{#1} (\AC@acsp{#1})}} +\newcommand*{\Acfp}{\AC@starredfalse\protect\Acfpa}% +\WithSuffix\newcommand\Acfp*{\AC@starredtrue\protect\Acfpa}% +% \end{macrocode} +% \begin{macrocode} +\newcommand*{\acfpa}[2][\AC@linebreakpenalty]{% + \texorpdfstring{\protect\@acfp[#1]{#2}}{\AC@aclp{#2} (\AC@acsp{#2})}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*{\Acfpa}[2][\AC@linebreakpenalty]{% + \texorpdfstring{\protect\@Acfp[#1]{#2}}{\AC@Aclp{#2} (\AC@acsp{#2})}} % \end{macrocode} % \begin{macrocode} -\newcommand*{\@acfp}[1]{% +\newcommand*{\@acfp}[2][\AC@linebreakpenalty]{% \ifAC@footnote - \acsfont{\AC@acsp{#1}}% - \footnote{\AC@placelabel{#1}\AC@aclp{#1}{}}% + \acsfont{\AC@acsp{#2}}% + \footnote{\AC@placelabel{#2}\AC@aclp{#2}{}}% \else \acffont{% - \AC@placelabel{#1}\AC@aclp{#1}% - \nolinebreak[3] % - \acfsfont{(\acsfont{\AC@acsp{#1}})}% + \AC@placelabel{#2}\AC@aclp{#2}% + \nolinebreak[#1] % + \acfsfont{(\acsfont{\AC@acsp{#2}})}% }% \fi - \ifAC@starred\else\AC@logged{#1}\fi} + \ifAC@starred\else\AC@logged{#2}\fi} % \end{macrocode} +% \begin{macrocode} +\newcommand*{\@Acfp}[2][\AC@linebreakpenalty]{% + \ifAC@footnote + \acsfont{\AC@acsp{#2}}% + \footnote{\AC@placelabel{#2}\AC@Aclp{#2}{}}% + \else + \acffont{% + \AC@placelabel{#2}\AC@Aclp{#2}% + \nolinebreak[#1] % + \acfsfont{(\acsfont{\AC@acsp{#2}})}% + }% + \fi + \ifAC@starred\else\AC@logged{#2}\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\acp} % \begin{macro}{\@acp} +% \begin{macro}{\Acp} +% \begin{macro}{\@Acp} % The first time an acronym is accessed Full Names (FNs) is -% printed. The next time just (FNs). +% printed. The next time just (FNs).The optional variable +% is being passed to \cmd{\acfp}, in case it is used. % \begin{macrocode} \newcommand*{\acp}{\AC@starredfalse\protect\@acp}% \WithSuffix\newcommand\acp*{\AC@starredtrue\protect\@acp}% % \end{macrocode} % \begin{macrocode} -\newcommand{\@acp}[1]{% +\newcommand*{\Acp}{\AC@starredfalse\protect\@Acp}% +\WithSuffix\newcommand\Acp*{\AC@starredtrue\protect\@Acp}% +% \end{macrocode} +% \begin{macrocode} +\newcommand{\@acp}[2][\AC@linebreakpenalty]{% + \ifAC@dua + \ifAC@starred\aclp*{#2}\else\aclp{#2}\fi% + \else + \expandafter\ifx\csname AC@#2\endcsname\AC@used + \ifAC@starred\acsp*{#2}\else\acsp{#2}\fi% + \else + \ifAC@starred\acfp*[#1]{#2}\else\acfp[#1]{#2}\fi% + \fi + \fi} +% \end{macrocode} +% \begin{macrocode} +\newcommand{\@Acp}[2][\AC@linebreakpenalty]{% \ifAC@dua - \ifAC@starred\aclp*{#1}\else\aclp{#1}\fi% + \ifAC@starred\Aclp*{#2}\else\Aclp{#2}\fi% \else - \expandafter\ifx\csname AC@#1\endcsname\AC@used - \ifAC@starred\acsp*{#1}\else\acsp{#1}\fi% + \expandafter\ifx\csname AC@#2\endcsname\AC@used + \ifAC@starred\acsp*{#2}\else\acsp{#2}\fi% \else - \ifAC@starred\acfp*{#1}\else\acfp{#1}\fi% + \ifAC@starred\Acfp*[#1]{#2}\else\Acfp[#1]{#2}\fi% \fi \fi} % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} % % % \begin{macro}{\acfi} % \begin{macro}{\acfia} +% \begin{macro}{\Acfi} +% \begin{macro}{\Acfia} % The Full Name is printed in italics and the abbreviated is printed in upshape. +% The optional variable determines the penalty for a line break. % \begin{macrocode} \newcommand*{\acfi}{\AC@starredfalse\protect\acfia}% \WithSuffix\newcommand\acfi*{\AC@starredtrue\protect\acfia}% % \end{macrocode} % \begin{macrocode} -\newcommand{\acfia}[1]{% - {\itshape \AC@acl{#1} \nolinebreak[3]} (\ifAC@starred\acs*{#1}\else\acs{#1}\fi)} +\newcommand*{\Acfi}{\AC@starredfalse\protect\Acfia}% +\WithSuffix\newcommand\Acfi*{\AC@starredtrue\protect\Acfia}% % \end{macrocode} +% \begin{macrocode} +\newcommand{\acfia}[2][\AC@linebreakpenalty]{% + \texorpdfstring{\protect\@acfi[#1]{#2}}{{\AC@acl{#2}} (#2)}} +% \end{macrocode} +% \begin{macrocode} +\newcommand{\Acfia}[2][\AC@linebreakpenalty]{% + \texorpdfstring{\protect\@Acfi[#1]{#2}}{{\AC@Acl{#2}} (#2)}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*{\@acfi}[2][\AC@linebreakpenalty]{% + \acffont{% + \AC@placelabel{#2}{\itshape\AC@acl{#2}}% + \nolinebreak[#1] % + \acfsfont{(\acsfont{\AC@acs{#2}})}% + }% + \ifAC@starred\else\AC@logged{#2}\fi} +% \end{macrocode} +% \begin{macrocode} +\newcommand*{\@Acfi}[2][\AC@linebreakpenalty]{% + \acffont{% + \AC@placelabel{#2}{\itshape\AC@Acl{#2}}% + \nolinebreak[#1] % + \acfsfont{(\acsfont{\AC@acs{#2}})}% + }% + \ifAC@starred\else\AC@logged{#2}\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} % \end{macro} % \end{macro} % @@ -1677,15 +1940,27 @@ blocks to be tested separately. The latter are commonly indicated as % % \begin{macro}{\aclu} % \begin{macro}{\aclua} +% \begin{macro}{\Aclu} +% \begin{macro}{\Aclua} % Print the long form of the acronym and mark it as used. % \begin{macrocode} \newcommand*{\aclu}{\AC@starredfalse\protect\aclua}% \WithSuffix\newcommand\aclu*{\AC@starredtrue\protect\aclua}% % \end{macrocode} % \begin{macrocode} +\newcommand*{\Aclu}{\AC@starredfalse\protect\Aclua}% +\WithSuffix\newcommand\Aclu*{\AC@starredtrue\protect\Aclua}% +% \end{macrocode} +% \begin{macrocode} \newcommand{\aclua}[1]{% \ifAC@starred\acl*{#1}\else\acl{#1}\fi\acused{#1}} % \end{macrocode} +% \begin{macrocode} +\newcommand{\Aclua}[1]{% + \ifAC@starred\Acl*{#1}\else\Acl{#1}\fi\acused{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} % \end{macro} % \end{macro} % diff --git a/macros/latex/contrib/acronym/acronym.pdf b/macros/latex/contrib/acronym/acronym.pdf Binary files differindex 40f98ef76f..109766fa15 100644 --- a/macros/latex/contrib/acronym/acronym.pdf +++ b/macros/latex/contrib/acronym/acronym.pdf diff --git a/macros/latex/contrib/algxpar/README.md b/macros/latex/contrib/algxpar/README.md new file mode 100644 index 0000000000..f69460d098 --- /dev/null +++ b/macros/latex/contrib/algxpar/README.md @@ -0,0 +1,20 @@ +# algxpar +This package extends the algorithmicx package (algpseudocode) to support multiline text. + +# Licence +Copyright (C) 2019 by Jander Moreira (moreira.jander@gmail.com) + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2005/12/01 or later. + +This work has the LPPL maintenance status `maintained'. + +The Current Maintainer of this work is Jander Moreira. + +This work consists of the files algxpar.dtx and algxpar.ins +and the derived file algxpar.sty. diff --git a/macros/latex/contrib/algxpar/algxpar.dtx b/macros/latex/contrib/algxpar/algxpar.dtx new file mode 100644 index 0000000000..bac74b7a35 --- /dev/null +++ b/macros/latex/contrib/algxpar/algxpar.dtx @@ -0,0 +1,1113 @@ +% \iffalse +%<*driver> +\ProvidesFile{algxpar.dtx} +\documentclass{ltxdoc} +\usepackage[english]{babel} + +\usepackage{xcolor} +\usepackage{fancyvrb} +\usepackage{tcolorbox} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\tcbuselibrary{listings, skins, xparse, breakable} +\newenvironment{commands}{ + \VerbatimEnvironment + \begin{tcolorbox}[ + bottomrule = 0pt, + toprule = 0pt, + leftrule = 0pt, + rightrule = 0pt, + titlerule = 0pt, + colframe = white, + colback = white, + sharp corners, + pad at break*=1pc, + enhanced jigsaw, + overlay first and middle={ + \coordinate (A1) at ($(interior.south east) + (-10pt,5pt)$); + \coordinate (C1) at ($(interior.south east) + (-6pt,7.5pt)$); + \draw[fill=tcbcol@frame] (A1) -- +(0,5pt) -- (C1) -- cycle; + }, + ]% + \begin{Verbatim}[gobble = 2, tabsize=4, commandchars = &\[\]]% +}{% + \end{Verbatim}% + \end{tcolorbox}% +} +\newtcolorbox{codigo}[1]{% + bottomrule = 0pt, + toprule = 0pt, + leftrule = 0pt, + rightrule = 0pt, + titlerule = 0pt, + sharp corners, + sidebyside, + sidebyside align = top, + #1 +} +\newcommand{\afile}[1]{\mbox{\texttt{#1}}} +\newcommand{\package}[1]{\mbox{\textsf{#1}}} +\newcommand{\inlinecommand}[1]{\mbox{\texttt{#1}}} + +\usetikzlibrary{calc} +\newenvironment{example}{ + \begingroup\tcbverbatimwrite{\jobname_code.tmp} +}{ + \endtcbverbatimwrite\endgroup% + \begin{tcolorbox}[ + bottomrule = 0pt, + toprule = 0pt, + leftrule = 0pt, + rightrule = 0pt, + titlerule = 0pt, + colframe = white, + segmentation style = {black!30, solid}, + colback = white, + sharp corners, + pad at break*=1pc, + enhanced jigsaw, + breakable, + overlay first and middle={ + \coordinate (A1) at ($(interior.south east) + (-10pt,5pt)$); + \coordinate (C1) at ($(interior.south east) + (-6pt,7.5pt)$); + \draw[fill=tcbcol@frame] (A1) -- +(0,5pt) -- (C1) -- cycle; + }, + ]% + \small\VerbatimInput[tabsize=4, gobble = 2]{\jobname_code.tmp} + \tcblower +% \begin{minipage}{0.85\linewidth} + \begin{algorithmic} + \input{\jobname_code.tmp} + \end{algorithmic} +% \end{minipage} + \end{tcolorbox} +} + +\usepackage[backref=page]{hyperref} +\hypersetup{ + colorlinks, + urlcolor = blue!20!black, + linkcolor = blue!10!black, + citecolor = black!80, +} + +\usepackage{algxpar} + +\usepackage{imakeidx} +\makeindex + +\EnableCrossrefs +% \CodelineIndex +% \PageIndex +\RecordChanges +\begin{document} + \sloppy + \DocInput{algxpar.dtx} +\end{document} +%</driver> +% \fi +% +% \let\DM\DescribeMacro +% \makeatletter +% \def\cstostr#1{% +% \expandafter\@gobble\detokenize\expandafter{\string#1}} +% \makeatother +% \renewcommand{\DescribeMacro}[1]{% +% \DM{#1}% +% } +% +% \CheckSum{0} +% +% \CharacterTable +% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% +% \changes{v0.9}{2019/10/23}{Initial version} +% +% \GetFileInfo{algxpar.sty} +% +% +% \DoNotIndex{\newcommand,\newenvironment,\renewcommand,\renewenvironment} +% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ } +% \DoNotIndex{\@ne} +% \DoNotIndex{\advance,\begingroup,\catcode,\closein} +% \DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\endgroup} +% \DoNotIndex{\def,\dimexpr,\parbox,\relax,\else,\fi,\hfill} +% \DoNotIndex{\setlength,\settowidth,\strut,\ifdim,\ifx} +% \DoNotIndex{\linewidth,\temp,\theALG@nested} +% \DoNotIndex{\\} +% \DoNotIndex{\RaggedRight} +% +% +% \title{The \package{algxpar} package\thanks{This document +% corresponds to \package{algxpar}~\fileversion, dated \filedate.}} +% \author{Jander Moreira\\\texttt{moreira.jander@gmail.com}} +% +% \maketitle +% % +% \begin{abstract} +% The \textsf{algxpar} packages is an extension of the \textsf{algorithmicx} package to handle multiline text with the proper indentation. +% \end{abstract} +% +% \tableofcontents +% +% \PrintChanges +% +% \section{Introduction} +% I teach algorithms and programming and adopted the \package{algorithmicx} package (\package{algpseudocode}) to typeset my code, as it provides a clean, easy to read pseudolanguage algorithms with a minimum effort to write. +% +% As part of the teaching process, I use very verbose commands in my algorithms before the students start to use more sintetic text. For example, I use ``\textit{Iniciate a counter $c$ with the value $0$}'', what will become ``${c \gets 0}$'' later. This leads to sentences that often span the text for multiple lines, specially in two-column documents with nested structures. +% +% Unfortunatelly, \package{algorithmicx} has no support for multiline statements natively, but it can adapted to use |\parbox|es to achive this goal. +% +% This package, therefore, extends macros to handle multiple lines in a seamlessly way. Some new commands and features are also added. +% +% \section{Instalation} +% The package \package{algxpar} is provided by the files \afile{algxpar.ins} and \afile{algxpar.dtx}. +% +% If the \afile{.sty} file is not available, it can be generated by running the following at a command line prompt. +% +% \begin{commands} +% latex algxpar.ins +% \end{commands} +% +% Then the generated \afile{algxpar.sty} must be copied to a directory searched by \LaTeX. Package dependencies can be checked in section~\ref{sec:implementation}. +% +% +% \section{Usage} +% The package must be loaded using +% \begin{commands} +% \usepackage&oarg[options]{algxpar} +% \end{commands} +% +% The only option to the package is |brazilian|, which sets the pseudocode ``reserved words'' to Brazilian Portuguese, so |\While| is rendered \textbf{enquanto} instead of \textbf{while}, for example. No other language is supported so far, but a translation can be easily achieved (see section~\ref{sec:customization}). +% +% +% \section{Writing pseudocode} +% The algorithms must be written using the |algorithmic| environment and use basically the same set of macros defined by \package{algpseudcode}. +% +% \begin{commands} +% \begin{algorithmic} +% &ensuremath[&langle]&textrm[&textit[contents]]&ensuremath[&rangle] +% \end{algorithmic} +% \end{commands} +% +% \subsubsection*{Example} +% Consider the following code. +% +% \begin{commands} +% \begin{algorithmic} +% \Function{Max}{$a, b$} +% \If{$a > b$} +% \Statep{\Return $a$} +% \Else +% \Statep{\Return $b$} +% \EndIf +% \EndFunction +% \end{algorithmic} +% \end{commands} +% +% The corresponding typeset is shown below. +% +% \begin{algorithmic} +% \Function{Max}{$a, b$} +% \If{$a > b$} +% \Statep{\Return $a$} +% \Else +% \Statep{\Return $b$} +% \EndIf +% \EndFunction +% \end{algorithmic} +% +% +% \subsection{Header} +% A header for the algorithm is proposed so the algorithm can provide a description, its inputs and outputs, as well as the preconditions and post-conditions Therefore, new macros are defined. +% +% \DescribeMacro{\Description} +% A description can be provided for the sake of code documentation. The macro |\Description| is used to provide such a text. +% \DescribeMacro{\Input} +% \DescribeMacro{\Output} +% The input requirements for the algorithm uses the clause |\Input| and the produced by the code should be expressed with |\Output|. +% \DescribeMacro{\Require} +% \DescribeMacro{\Ensure} +% Also, the possibility to use |\Require| and |\Ensure| remains. +% +% \subsubsection*{Examples} +% +% \begin{example} +% \Description Evaluates and prints the factorial of $n$ +% \Input A non-negative integer number $n$ +% \Output The value of the factorial $n$\end{example} +% +% \begin{example} +% \Require $n \in \{1, 2, \ldots, 10\}$ +% \Ensure $k = \max(1, 2, \ldots, 10)$\end{example} +% +% +% \subsection{Constants and identifiers} +% \DescribeMacro{\True} +% \DescribeMacro{\False} +% \DescribeMacro{\Nil} +% Some additional macros were added: |\True|, |\False|, and |\Nil|, producing \True, \False, and \Nil, respectively. +% +% \DescribeMacro{\Id} +% The macro |\Id|\marg{id} was included to support long variable names, such as \Id{maxval} or \Id{count}, for example. This macro handles better ligatures and accented characters than the regular math mode. |$offered$| results in $offered$ and |\Id{offered}| produces \Id{offered}. With accented characters, |$magnético$| and |\Id{magnético}| result in $magnético$ and \Id{magnético}, respectively. +% +% \DescribeMacro{\TextString} +% For literal constants, usually represented quoted in programs and algorithms, the macro |\TextString|\marg{text} is provided, so |\TextString{Error}| produces \TextString{Error}. +% +% \DescribeMacro{\VisibleSpace} +% An additional macro called |\VisibleSpace| is also provided to produce \VisibleSpace. Sometimes the number of spaces is relevant in text strings, so one can write |\TextString{a\VisibleSpace\VisibleSpace\VisibleSpace b}| to get \TextString{a\VisibleSpace\VisibleSpace\VisibleSpace b}. +% +% The macros |\Id| and |\TextString| work in text and math modes. +% +% \subsection{Assignment, reading and writing} +% \DescribeMacro{\gets} +% The default symbol for assigning values to variables is $\gets$, provided by |\gets|. This is a clearer option, once the equal sign is left just for comparisons. +% +% \DescribeMacro{\Read} +% \DescribeMacro{\Write} +% Although not common in algorithms published in scientific journals, explicit reading and writing is necessary for basic algorithms. Therefore |\Read| and |\Write| fulfills this need. +% +% \begin{example} +% \Statep{\Read\ $a, b$} +% \Statep{$s \gets a + b$} +% \Statep{\Write\ $s$}\end{example} +% +% \subsection{Comments} +% Comments use the symbol \makeatletter\axp@commentleftsymbol\makeatother\ preceding the commented text and stay close to the left margin. Comment macros are intended to be used with |\State| or |\Statex|, when no multiline handling is done. Comments with multiline control are considered starting at section~\ref{sec:statements}. +% +% \DescribeMacro{\Comment} +% The macro |\Comment|\marg{text} puts \meta{text} at the end of the line. +% +% \DescribeMacro{\Commentl} +% A variant, |\Commentl|\marg{text}, places the commented text without moving it to the left margin. It is a ``local'' comment. +% +% \DescribeMacro{\CommentIn} +% A third option is |\CommentIn|\marg{text}, that places the comment locally, but finishes it with \makeatletter\axp@commentrightsymbol\makeatother. Yes, that is really ugly. +% +% \begin{example} +% \State\Commentl{Simple counter} +% \State $c \gets 1$\Comment{initialize conter} +% \State $n \gets \Call{FirstInstance}{}$ +% \While{$n < 0$} +% \State $c \gets c + 1$\Comment{counts one more} +% \State $n \gets \mbox{\CommentIn{all new} } \Call{NewInstance}{}$ +% \EndWhile +% \end{example} +% +% \subsection{Statements}\label{sec:statements}% +% \DescribeMacro{\Statep} +% \DescribeMacro{\State} +% \DescribeMacro{\Statex} +% The statements should use |\Statep|\marg{text}, which defines a hang indent for continued lines. The \package{algorithmicx}'s |\State| and |\Statex| can be used as well. +% +% In opposition to |\State| and |\Statex|, which uses justified text, |\Statep| aligns only to the left, what is aesthetically better than justification in my opinion. +% +% Since |\Statep| uses a |\parbox| to span the text over multiple lines, no room is left for a comment. When needed a comment can be added through the optional argument: |\Statep|\oarg{comment}\marg{text}. +% +% \subsubsection*{Example} +% \begin{example} +% \Statep{Calculate the value of $x$ using $k$ and $m$, +% considering the stochastic distribution} +% \Statep[$k \neq 0$, $m > k$]{Calculate the value of $x$ +% using $k$ and $m$, considering the stochastic distribution}\end{example} +% +% \subsection{Conditionals} +% The traditional \textbf{if}-\textbf{then}-\textbf{else} structure is suported, handling nested commands as well. +% An \textbf{else~if} construction avoids nesting \textbf{if}s and getting too much indentation. The macros are: |\If|, |\Else|, and |\ElsIf|. +% +% \DescribeMacro{\If} +% \DescribeMacro{\Else} +% |\If|\oarg{comment}\marg{condition} is used for conditional execution and is ended with a |\EndIf|. The optional \meta{comment} is typeset to the left and the \meta{condition} is put in a |\parbox|. Regular |\Comment| and |\Commentl| can be used after |\Else|. +% +% \DescribeMacro{\ElsIf} +% The \textbf{else~if} clause is specified by |\ElsIf|\oarg{comment}\marg{condition}. +% +% \DescribeMacro{\Switch} +% \DescribeMacro{\EndSwitch} +% \DescribeMacro{\Case} +% \DescribeMacro{\EndCase} +% \DescribeMacro{\Otherwise} +% \DescribeMacro{\EndOtherwise} +% Flow control using a selection structure are provided by the macro |\Switch|\oarg{comment}\marg{selector}, ended with |\EndSwitch|. Each matching clause uses |\Case|\oarg{comment}\marg{value} and |\EndCase|. The default uses |\Otherwise| and |\EndOtherwise|. +% +% To specify ranges, the macro |\Range|\oarg{step}\marg{start}\marg{end} can be used. For example, |\Range{1}{10}| outputs \Range{1}{10} and |\Range[2]{0}{10}| prints \Range[2]{0}{10}. +% +% \subsubsection*{Examples} +% +% \begin{example} +% \If{$a < 0$} +% \Statep{$a \gets 0$} +% \EndIf\end{example} +% +% \begin{example} +% \If[closing doors]{the building is empty and the +% security system is active} +% \Statep{$\Id{status} \gets \TextString{ok}$} +% \Else +% \Statep{$\Id{status} \gets \TextString{not ok}$} +% \EndIf\end{example} +% +% \begin{example} +% \If[desired status]{$n \geq 0.8$} +% \Statep{$\Id{status} \gets \TextString{excelent}$} +% \ElsIf{$n \geq 0.7$} +% \Statep{$\Id{status} \gets \TextString{great}$} +% \ElsIf{$n \geq 0.5$} +% \Statep{$\Id{status} \gets \TextString{good}$} +% \ElsIf{$n \geq 0.2$} +% \Statep{$\Id{status} \gets \TextString{not so good}$} +% \Else\Comment{minimum not achieved} +% \Statep{$\Id{status} \gets \TextString{call for help}$} +% \EndIf\end{example} +% +% \begin{example} +% \Switch[$1 \leq \Id{month} \leq 12$]{\Id{month}} +% \Case{2} +% \If{\Call{IsLeapYear}{\Id{year}}} +% \Statep{$n_{days} \gets 29$} +% \Else +% \Statep{$n_{days} \gets 28$} +% \EndIf +% \EndCase +% \Case{4, 6, 9, 11} +% \Statep{$n_{days} \gets 30$} +% \EndCase +% \Otherwise\Comment{1, 3, 5, 7, 8, 10, 12} +% \Statep{$n_{days} \gets 31$} +% \EndOtherwise +% \EndSwitch\end{example} +% +% \subsection{Loops} +% Loops uses \textbf{while}, \textbf{repeat~until}, and \textbf{for} flow control. +% +% \DescribeMacro{\While} +% \DescribeMacro{\EndWhile} +% Loops with condition on top uses |\While|\oarg{comment}\marg{condition} and are ended with |\EndWhile|. +% +% \DescribeMacro{\Repeat} +% \DescribeMacro{\Until} +% When loops have their termination condition tested at the bottom, the macros |\Repeat| and |\Until|\oarg{comment}\marg{condition} are used. +% +% \DescribeMacro{\For} +% \DescribeMacro{\ForAll} +% \DescribeMacro{\ForEach} +% The \textbf{for} loop starts with |\For|\oarg{comment}\marg{condition} and ends with |\EndFor|. To make things more versatile, |\For| can be replaced by |\ForAll| or |\ForEach|. +% +% \DescribeMacro{\To} +% \DescribeMacro{\DownTo} +% \DescribeMacro{\Step} +% Some macros for supporting loops are also provided: |\To|, |\DownTo|, and |\Step|, which defaults to \To, \DownTo, and \Step, repectively. +% +% \subsection*{Examples} +% \begin{example} +% \While{there is data in the input stream and no +% termination signal was received} +% \Statep{Get element $e$ from the input stream} +% \Statep{\Call{Process}{$e$}} +% \EndWhile\end{example} +% +% \begin{example} +% \Statep[$n_1, n_2 > 0$]{Let $n_1$ and $n_2$ +% be the two integers in order to find the greatest +% number that divides both} +% \Repeat +% \Statep[$n_1 \bmod n_2$]{Set \Id{rest} as the +% rest of the integer +% division of $n_1$ by $n_2$} +% \Statep{Redefine $n_1$ with the value of $n_2$} +% \Statep{Redefine $n_2$ with the value of \Id{rest}} +% \Until[terminates]{$\Id{rest} = 0$} +% \Statep[greatest common divisor]{Set $m$ to the value of $n_1$}\end{example} +% +% \begin{example} +% \For{$i \gets n-1$ \DownTo\ $0$} +% \Statep{$s \gets s + i$} +% \EndFor\end{example} +% +% \begin{example} +% \ForEach[main transactions]{transaction $t$ in the flow +% of transactions for month $m$} +% \Statep{\Call{ProcessTransaction}{$t$}} +% \EndFor\end{example} +% +% \begin{example} +% \ForAll{$e$ in set $M$} +% \Statep{\Call{ProcessElement}{$e$}} +% \EndFor\end{example} +% +% \subsection{Procedures and functions} +% \DescribeMacro{\Procedure} +% \DescribeMacro{\EndProcedure} +% \DescribeMacro{\Function} +% \DescribeMacro{\EndFunction} +% \DescribeMacro{\Return} +% Procedure and functions are supported with |\Procedure|\marg{name}\marg{arguments} and |\EndProcedure| and |\Function|\marg{name}\marg{arguments} and |\EndFunction|. The return value for functions use |\Return|. +% +% \subsection*{Examples} +% \begin{example} +% \Procedure{PrintError}{$code$} +% \Switch{$code$} +% \Case{1} +% \Statep{\Write\ \TextString{Not found}} +% \EndCase +% \Case{2} +% \Statep{\Write\ \TextString{Access denied}} +% \EndCase +% \Case{3} +% \Statep{\Write\ \TextString{Blocked}} +% \EndCase +% \Otherwise +% \Statep{\Write\ \TextString{Unknown}} +% \EndOtherwise +% \EndSwitch +% \EndProcedure\end{example} +% +% \begin{example} +% \Function{CelsiusToFahrenheit}{$t$} +% \Statep{\Return $\dfrac{9}{5}t + 32$} +% \EndFunction\end{example} +% +% \begin{example} +% \Function[many parameters]{MyFunction} +% {$a$, $b$, $c$, $d$, $e$, $f$, $g$, $h$, $i$, $j$, $k$, $l$} +% \Statep{\Return $\dfrac{a+b+c+d}{f+g+hi^{j}}kl$} +% \EndFunction\end{example} +% % +% \section{Extras} +% Sometimes just letting the |\parbox| handle the line breaks is not enough. +% \DescribeMacro{\NewLine} +% The macro |\NewLine| can be used to manually break lines. +% +% \DescribeEnv{DefineCode} +% \DescribeMacro{\UseCode} +% \DescribeMacro{\ShowCode} +% It is possible to define pieces of code for later use. Using the environment |DefineCode| with a \meta{name}, a part of the pseudocode can be specified and used with |\UseCode|\marg{name}. The \meta{name} provided should be unique; when repeated the code is overwritten. The macro |\ShowCode|\oarg{options}\marg{name} displays the saved code \textit{verbatim}. Any option for |\VerbatimInput| from \package{fancyvrb} can be specified in \meta{options}. All chuncks of code are written to temporary files. +% +% +% \subsection*{Examples} +% +% \begin{example} +% \If{$h > 0$ and\NewLine +% ($n_1 \neq 0$ or $n_2 < n_1$) and \NewLine +% $p \neq \Nil$} +% \Statep{\Call{DoSomething}{}} +% \Else +% \Statep{\Call{DoSomethingElse}{}} +% \EndIf +% \end{example} +% +% \begin{DefineCode}{half_in_out} +% \Input A number $n$ +% \Output Half of $n$ (i.e., $n/2$) +% \end{DefineCode} +% \begin{DefineCode}{half_code} +% \Statep[in]{Get $n$} +% \Statep[out]{Print $n/2$} +% \end{DefineCode} +% +% \begin{minipage}{\linewidth} +% \small +% \begin{Verbatim}[gobble = 2, tabsize = 4] +% \begin{DefineCode}{half_in_out} +% \Input A number $n$ +% \Output Half of $n$ (i.e., $n/2$) +% \end{DefineCode} +% \begin{DefineCode}{half_code} +% \Statep[in]{Get $n$} +% \Statep[out]{Print $n/2$} +% \end{DefineCode} +% \end{Verbatim} +% \end{minipage} +% +% \vspace{\baselineskip}Inside |algorithmic| one can use the following definitions. +% \begin{example} +% \UseCode{half_in_out} +% \Statep{\Commentl{Code}} +% \UseCode{half_code} +% \end{example} +% +% The source is shown by |\ShowCode{half_code}|. +% \ShowCode[gobble = 2]{half_code} +% +% \StopEventually{} +% +% +% \section{Implementation}\label{sec:implementation}% +% This package is \package{algxpar}~\fileversion~--~\LaTeXe. +% \vspace{\baselineskip} +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e}[2005/12/01] +\ProvidesPackage{algxpar} + [2019/10/24 v0.9 Algorithms with multiline/paragraph support] +% \end{macrocode} + +% \iffalse +%% Package options +% \fi +% \begin{macrocode} +\newif\ifaxp@brazilian\axp@brazilianfalse +\DeclareOption{brazilian}{\axp@braziliantrue} +\DeclareOption*{\PackageWarning{algxpar}{Unknown ‘\CurrentOption’}} +\ProcessOptions\relax +% \end{macrocode} + +% \iffalse +%% Required packages +% \fi +% \package{ragged2e}: for |\RaggedRight|\par +% \package{listings}: to get accented characters in verbatim mode (pt\_BR)\par +% \package{amsmath}, amssymb: for |\triangleright| and |\triangleleft|\par +% \package{xcolor}: gray color for |\VisibleSpace|\par +% \package{tcolorbox}: verbatim save to file\par +% \package{fancyvrb}: verbatim read from file with tabs\par +% \begin{macrocode} +\RequirePackage{algorithmicx} +\RequirePackage{algpseudocode} +\RequirePackage{ragged2e} +\RequirePackage{listings} +\RequirePackage{amsmath, amssymb} +\RequirePackage{xcolor} +\RequirePackage{tcolorbox} % to save verbatim +\RequirePackage{fancyvrb} % to load verbatim preserving tabs +% \end{macrocode} + +% \iffalse +%% Constants and identifiers +% \fi +% \begin{macro}{\True} +% \begin{macro}{\False} +% \begin{macro}{\Nil} +% \begin{macro}{\Id} +% \begin{macro}{\TextString} +% \begin{macro}{\VisibleSpace} +% \begin{macrocode} +\algnewcommand\algorithmictrue{\textsc{True}} +\algnewcommand\algorithmicfalse{\textsc{False}} +\algnewcommand\algorithmicnil{\textsc{Nil}} +\algnewcommand\True{\mbox{\algorithmictrue}} +\algnewcommand\False{\mbox{\algorithmicfalse}} +\algnewcommand\Nil{\mbox{\algorithmicnil}} +\newcommand{\Id}[1]{\mbox{\textit{\rmfamily #1}}} +\newcommand{\TextString}[1]{\textrm{\normalfont``{\ttfamily\mbox{#1}}''}} +\algnewcommand{\VisibleSpace}{\textrm{\color{black!70}\textvisiblespace}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} + +% \iffalse +%% Headings +% \fi +% \begin{macro}{\Description} +% \begin{macro}{\Input} +% \begin{macro}{\Output} +% \begin{macro}{\Ensure} +% \begin{macro}{\Require} +% \begin{macrocode} +\algnewcommand\algorithmicdescription{\textbf{Description}} +\algnewcommand\algorithmicinput{\textbf{Input}} +\algnewcommand\algorithmicoutput{\textbf{Output}} +\algrenewcommand\algorithmicensure{\textbf{Ensure}} +\algrenewcommand\algorithmicrequire{\textbf{Require}} +\algnewcommand\Description{\item[\algorithmicdescription:]} +\algnewcommand\Input{\item[\algorithmicinput:]} +\algnewcommand\Output{\item[\algorithmicoutput:]} +\algrenewcommand\Ensure{\item[\algorithmicensure:]} +\algrenewcommand\Require{\item[\algorithmicrequire:]} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} + +% \iffalse +%% Read, write +% \fi +% \begin{macro}{\Read} +% \begin{macro}{\Write} +% \begin{macrocode} +\algnewcommand{\algorithmicread}{\textbf{read}} +\algnewcommand{\algorithmicwrite}{\textbf{write}} +\algnewcommand{\Read}{\algorithmicread} +\algnewcommand{\Write}{\algorithmicwrite} +% \end{macrocode} +% \end{macro} +% \end{macro} + +% \iffalse +%% Comments +% \fi +% \begin{macro}{\Comment} +% \begin{macro}{\Commentl} +% \begin{macro}{\CommentIn} +% \begin{macrocode} +\newcommand{\axp@commentleftsymbol}{$\triangleright$} +\newcommand{\axp@commentrightsymbol}{$\triangleleft$} +\algnewcommand{\CommentIn}[1]{\axp@commentleftsymbol~% + \textsl{#1}~\axp@commentrightsymbol} +\algnewcommand{\Commentl}[1]{\axp@commentleftsymbol~\textsl{#1}} +\algrenewcommand{\algorithmiccomment}[1]{% + \def\tmp{#1}% + \ifx\tmp\empty\else% + \hfill\Commentl{#1}% + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% + +% \iffalse +%% Statep +% \fi +% \begin{macro}{\Statep} +% \begin{macrocode} +\newlength{\axp@stateindent} +\setlength{\axp@stateindent}{\dimexpr\algorithmicindent/2\relax} +\algnewcommand{\Statep}[2][]{\State\algparbox[#1]{#2}{\axp@stateindent}} +% \end{macrocode} +%\end{macro} + +% \iffalse +%% While +% \fi +% \begin{macro}{\While} +% \begin{macro}{\EndWhile} +% \begin{macrocode} +\newlength{\axp@whilewidth} +\algblockdefx{While}{EndWhile}% + [2][]{% + \settowidth{\axp@whilewidth}{\algorithmicwhile\ }% + \algparbox[#1]{\algorithmicwhile\ #2~\algorithmicdo}{\axp@whilewidth}% + }% + {\algorithmicend\ \algorithmicwhile} +% \end{macrocode} +% \end{macro} +% \end{macro} + +% \iffalse +%% Repeat +% \fi +% \begin{macro}{\Repeat} +% \begin{macro}{\Until} +% \begin{macrocode} +\newlength{\axp@untilwidth} +\algblockdefx{Repeat}{Until}% + {\algorithmicrepeat}% + [2][]{% + \settowidth{\axp@untilwidth}{\algorithmicuntil\ }% + \axp@algparbox{#1}{\algorithmicuntil\ #2}{\axp@untilwidth}{0}% + } +% \end{macrocode} +% \end{macro} +% \end{macro} + +% \iffalse +%% If, else if, else +% \fi +% \begin{macro}{\If} +% \begin{macro}{\Else} +% \begin{macro}{\ElsIf} +% \begin{macro}{\EndIf} +% \begin{macrocode} +\newlength{\axp@ifwidth} +\newlength{\axp@elseifwidth} +\algblockdefx[If]{If}{EndIf}% + [2][]{% + \settowidth{\axp@ifwidth}{\algorithmicif\ }% + \algparbox[#1]{\algorithmicif\ #2~\algorithmicthen}{\axp@ifwidth}% + } + {\algorithmicend\ \algorithmicif} +\algcblockx[If]{If}{ElsIf}{EndIf} + [2][]{% + \settowidth{\axp@elseifwidth}{\algorithmicelse\ \algorithmicif\ }% + \algparbox[#1]{\algorithmicelse~\algorithmicif\ #2~\algorithmicthen}{\axp@elseifwidth}% + } + {\algorithmicend\ \algorithmicif} +\algcblockx{If}{Else}{EndIf} + {\textbf{\algorithmicelse}} + {\textbf{\algorithmicend~\algorithmicif}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} + +% \iffalse +%% Switch, case, otherwise +% \fi +% \begin{macro}{\Switch} +% \begin{macro}{\EndSwitch} +% \begin{macro}{\Case} +% \begin{macro}{\EndCase} +% \begin{macro}{\Otherwise} +% \begin{macro}{\EndOtherwise} +% \begin{macro}{\Range} +% \begin{macrocode} +\algnewcommand{\algorithmicswitch}{\textbf{switch}} +\algnewcommand{\algorithmicof}{\textbf{of}} +\algnewcommand{\algorithmiccase}{\textbf{case}} +\algnewcommand{\algorithmicotherwise}{\textbf{otherwise}} +\newlength{\axp@switchwidth} +\algblockdefx{Switch}{EndSwitch}% + [2][]{% + \settowidth{\axp@switchwidth}{\algorithmicswitch\ }% + \algparbox[#1]{\algorithmicswitch\ #2~\algorithmicof}{\axp@switchwidth}% + } + {\algorithmicend~\algorithmicswitch} +\newlength{\axp@casewidth} +\algblockdefx{Case}{EndCase}% + [2][]{% + \settowidth{\axp@casewidth}{\algorithmiccase\ }% + \algparbox[#1]{\algorithmiccase\ #2~\algorithmicdo}{\axp@casewidth}% + } + {\algorithmicend~\algorithmiccase} +\algblockdefx{Otherwise}{EndOtherwise}% + {\algorithmicotherwise~\algorithmicdo}% + {\textbf{\algorithmicend\ \algorithmicotherwise}} +\newcommand{\Range}[3][]{% + \ensuremath{% + #2% + \def\temp{#1}% + \mathcal{\ldotp\ldotp}#3 + \ifx\temp\empty\relax\else{\ensuremath{\mathcal{:}#1}}\fi% + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} + +% \iffalse +%% For, for each, for all +% \fi +% \begin{macro}{\For} +% \begin{macro}{\ForEch} +% \begin{macro}{\ForAll} +% \begin{macro}{\EndFor} +% \begin{macro}{\To} +% \begin{macro}{\DownTo} +% \begin{macro}{\Step} +% \begin{macrocode} +\algnewcommand{\To}{\textbf{to}} +\algnewcommand{\DownTo}{\textbf{downto}} +\algnewcommand{\Step}{\textbf{step}} +\newlength{\axp@forwidth} +\algblockdefx{For}{EndFor}% + [2][]{% + \settowidth{\axp@forwidth}{\algorithmicfor\ }% + \algparbox[#1]{\algorithmicfor\ #2~\algorithmicdo}{\axp@forwidth}% + } + {\algorithmicend\ \algorithmicfor} +\algnewcommand{\algorithmicforeach}{\textbf{for~each}} +\newlength{\axp@foreachwidth} +\algblockdefx{ForEach}{EndFor}% + [2][]{% + \settowidth{\axp@foreachwidth}{\algorithmicforeach\ }% + \algparbox[#1]{\algorithmicforeach\ #2~\algorithmicdo}{\axp@foreachwidth}% + } + {\algorithmicend\~\algorithmicfor} +\newlength{\axp@forallwidth} +\algblockdefx{ForAll}{EndFor}% + [2][]{% + \settowidth{\axp@forallwidth}{\algorithmicforall\ }% + \algparbox[#1]{\algorithmicforall\ #2~\algorithmicdo}{\axp@forallwidth}% + }% + {\algorithmicend\ \algorithmicfor} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} + +% \iffalse +%% Procedure, function, calls +% \fi +% \begin{macro}{\Procedure} +% \begin{macro}{\EndProcedure} +% \begin{macro}{\Function} +% \begin{macro}{\EndFunction} +% \begin{macro}{\Call} +% \begin{macrocode} +\newlength{\axp@procedurewidth} +\newlength{\axp@namewidth} +\algblockdefx{Procedure}{EndProcedure}% + [3][]{% + \settowidth{\axp@procedurewidth}{\algorithmicprocedure~}% + \settowidth{\axp@namewidth}{\textsc{#2}(}% + \addtolength{\axp@procedurewidth}{0.6\axp@namewidth}% + \algparbox[#1]{\algorithmicprocedure\ \textsc{#2}(#3)}{\axp@procedurewidth} + }% + {\algorithmicend\ \algorithmicprocedure} +\newlength{\axp@functionwidth} +\algblockdefx{Function}{EndFunction}% + [3][]{% + \settowidth{\axp@functionwidth}{\algorithmicfunction~}% + \settowidth{\axp@namewidth}{\textsc{#2}(}% + \addtolength{\axp@functionwidth}{0.6\axp@namewidth}% + \algparbox[#1]{\algorithmicfunction\ \textsc{#2}(#3)}{\axp@functionwidth} + }% + {\algorithmicend\ \algorithmicfunction} +\algrenewcommand\Call[2]{% + \def\argstmp{#2}% + \textsc{#1}\ifx\argstmp\empty\mbox{(\hskip0.5ex)}\else(#2)\fi% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} + +% \iffalse +%% NewLine +% \fi +% \begin{macro}{\NewLine} +% \begin{macrocode} +\newcommand{\NewLine}{\\} +% \end{macrocode} +% \end{macro} + +% \iffalse +%% DefineCode, UseCode, \ShowCode +% \fi +% \begin{environment}{DefineCode} +% \begin{macro}{\UseCode} +% \begin{macro}{\ShowCode} +% \begin{macrocode} +\newenvironment{DefineCode}[1] +{\begingroup\tcbverbatimwrite{\jobname_code_#1.tmp}} +{\endtcbverbatimwrite\endgroup} +\newcommand{\UseCode}[1]{\input{\jobname_code_#1.tmp}} +\newcommand{\ShowCode}[2][]{{\small\VerbatimInput[tabsize=4, #1]% + {\jobname_code_#2.tmp}}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{environment} + +% \begin{macro}{\alglinenumber} +% \begin{macrocode} +\algrenewcommand{\alglinenumber}[1]% + {\hspace{-1em}\color{black!35}{\scriptsize#1}{\tiny$\blacktriangleright$}} +% \end{macrocode} +% \end{macro} + +% \iffalse +%% axp@algparbox +% \fi +% \begin{macro}{\axp@algparbox} +% \begin{macrocode} +\newlength{\axp@commentwidth} +\setlength{\axp@commentwidth}{0pt} +\newcommand{\algparbox}[3][]{\axp@algparbox{#1}{#2}{#3}{1}} + +\newlength{\axp@largestcommentwidth} +\setlength{\axp@largestcommentwidth}{0.3\linewidth} +\newcommand{\axp@algparbox}[4]{% + \def\temp{#1}% + \ifx\temp\empty% + \setlength{\axp@commentwidth}{-2em}% + \else% + \settowidth{\axp@commentwidth}{\axp@commentleftsymbol\ #1}% + \ifdim\axp@commentwidth>\axp@largestcommentwidth\relax% + \setlength{\axp@commentwidth}{\axp@largestcommentwidth}% + \fi% + \fi% + \renewcommand{\NewLine}{\\\hspace{#3}}% + \parbox[t]{\dimexpr\linewidth-\axp@commentwidth-% + (\algorithmicindent)*(\theALG@nested - #4)-2em}% + {\RaggedRight\setlength{\hangindent}{#3}#2\strut}% + \ifx\temp\empty\else% + \hfill\axp@commentleftsymbol\hspace{0.5em}% + \parbox[t]{\axp@commentwidth}{\slshape\RaggedRight#1}% + \fi% + \renewcommand{\NewLine}{\\}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\lstset{ + literate= + {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 + {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 + {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 + {À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 + {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 + {ã}{{\~a}}1 {õ}{{\~o}}1 + {Ã}{{\~A}}1 {Õ}{{\~O}}1 + {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 + {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 + {Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1 + {ç}{{\c c}}1 {Ç}{{\c C}}1 + {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1 + {œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 + {ß}{{\ss}}1 + {ű}{{\H{u}}}1 {Ű}{{\H{U}}}1 {ő}{{\H{o}}}1 {Ő}{{\H{O}}}1 + {£}{{\pounds}}1 + {«}{{\guillemotleft}}1 + {»}{{\guillemotright}}1 + {ñ}{{\~n}}1 {Ñ}{{\~N}}1 {¿}{{?`}}1 +} +% \end{macrocode} + +% +% \section{Customization}\label{sec:customization}% +% By default, the longest width for a comment at the right margin is +%|0.3\linewidth|. This can be changed using something like the code below. +% +% \begin{commands} +% \makeatletter +% \setlength{\axp@largestcommentwidth}{&meta[new length]} +% \makeatother +% \end{commands} +% +% The assignment sign can be changed from $\gets$ to anything else, as well as the symbols used in comments. +% +% \begin{commands} +% \renewcommand{\gets}{\mathop{::=}} +% \renewcommand{\axp@commentleftsymbol}{\texttt{//}} +% \renewcommand{\axp@commentrightsymbol}{\texttt{*/}} +% \end{commands} +% +% The translation to Brazilian Portugues is straight forward. +% +% \begin{macrocode} +\ifaxp@brazilian +\RequirePackage{icomma} % comma as decimal separator +\algrenewcommand\algorithmicdescription{\textbf{Descrição}} +\algrenewcommand\algorithmicinput{\textbf{Entrada}} +\algrenewcommand\algorithmicoutput{\textbf{Saída}} +\algrenewcommand\algorithmicrequire{\textbf{Pré}} +\algrenewcommand\algorithmicensure{\textbf{Pós}} +\algrenewcommand{\algorithmicend}{\textbf{fim}} +\algrenewcommand{\algorithmicif}{\textbf{se}} +\algrenewcommand{\algorithmicthen}{\textbf{então}} +\algrenewcommand{\algorithmicelse}{\textbf{senão}} +\algrenewcommand{\algorithmicswitch}{\textbf{escolha}} +\algrenewcommand{\algorithmicof}{\textbf{de}} +\algrenewcommand{\algorithmiccase}{\textbf{caso}} +\algrenewcommand{\algorithmicotherwise}{\textbf{caso~contrário}} +\algrenewcommand{\algorithmicfor}{\textbf{para}} +\algrenewcommand{\algorithmicdo}{\textbf{faça}} +\algrenewcommand{\algorithmicwhile}{\textbf{enquanto}} +\algrenewcommand{\algorithmicforall}{\textbf{para cada}} +\algrenewcommand{\algorithmicrepeat}{\textbf{repita}} +\algrenewcommand{\algorithmicuntil}{\textbf{até que}} +\algrenewcommand{\algorithmicloop}{\textbf{repita}} +\algrenewcommand{\algorithmicforeach}{\textbf{para~cada}} +\algrenewcommand{\algorithmicforall}{\textbf{para~todo}} +\algrenewcommand{\algorithmicfunction}{\textbf{função}} +\algrenewcommand{\algorithmicprocedure}{\textbf{procedimento}} +\algrenewcommand{\algorithmicreturn}{\textbf{retorne}} +\algrenewcommand\algorithmictrue{\textsc{Verdadeiro}} +\algrenewcommand\algorithmicfalse{\textsc{Falso}} +\algrenewcommand\algorithmicnil{\textsc{Nulo}} +\algrenewcommand{\algorithmicread}{\textbf{leia}} +\algrenewcommand{\algorithmicwrite}{\textbf{escreva}} +\algrenewcommand{\To}{\textbf{até}} +\algrenewcommand{\DownTo}{\textbf{decrescente~até}} +\algrenewcommand{\Step}{\textbf{passo}} +\fi +% \end{macrocode} +% +% \section{To do\ldots} +% There are lots of improvements to make in the code. I recognize it! +% +% \section*{Appendix} +% \appendix +%\section{An example} +% \newcommand*{\Leaf}{\mbox{\textsc{Leaf}}} +% \newcommand*{\Internal}{\mbox{\textsc{Internal}}} +% \newcommand*{\InvalidItem}{\mbox{\textsc{InvalidItem}}} +% +% \begin{example} +% \Description Inserts a new item in the B-tree structure, +% handling only the root node +% \Input The \Id{item} to be inserted +% \Output Returns \True\ in case of success, \False\ in +% case of failure (i.e., duplicated keys) +% \Function{Insert}{\Id{item}} +% \If{\Id{tree.root address} is \Nil} +% \Statep{\Commentl{Create first node}} +% \Statep[\Nil\ = new node]{$\Id{new root node} +% \gets \Call{GetNode}{\Nil}$} +% \Statep[only item]{Insert \Id{item} in \Id{new +% root node} and set both its left and right +% childs to \Nil; also set \Id{new root +% node.count} to 1} +% \Statep[first node is always a leaf]{Set \Id{new +% root node.type} to \Leaf} +% \Statep[flag that node must be updated in file] +% {Set \Id{new root node.modified} to \True} +% \Statep{\Call{WriteNode}{\Id{new root node}}} +% \Statep{$\Id{tree.root address} \gets +% \Id{new root node.address}$} +% \Statep[update root address in file] +% {\Call{WriteRootAddress}{}} +% \Statep{\Return \True} +% \Else +% \Statep{\Commentl{Insert in existing tree}} +% \Statep[]{$\Id{success}$, +% $\Id{promoted item}$, $\Id{new node address} \gets +% \Call{SearchInsert}{\Id{tree.root address}, +% \Id{item}}$} +% \If[root has splitted]{\Id{success} and +% ${\Id{new node address}\neq\Nil}$} +% \Statep[new root]{$\Id{new root node} \gets +% \Call{GetNode}{\Nil}$} +% \Statep{Insert \Id{promoted item} in \Id{new +% root node} and set \Id{new root node.count} +% to 1} +% \Statep[tree height grows]{Set \Id{item}'s +% left child to \Id{tree.root +% address} and right child to \Id{new +% node address}} +% \Statep[not a leaf]{Set \Id{new root +% node.type} to \Internal} +% \Statep{Set \Id{new root node.modified} +% to \True} +% \Statep{\Call{WriteNode}{\Id{new root +% node}}} +% \Statep{$\Id{tree.root address} \gets +% \Id{new root node.address}$} +% \Statep[update root address in +% file]{\Call{WriteRootAddress}{}} +% \EndIf +% \Statep[insertion status]{\Return \Id{success}} +% \EndIf +% \EndFunction +% \end{example} +% +% \clearpage\PrintIndex +% +% \Finale +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/algxpar/algxpar.ins b/macros/latex/contrib/algxpar/algxpar.ins new file mode 100644 index 0000000000..289551de47 --- /dev/null +++ b/macros/latex/contrib/algxpar/algxpar.ins @@ -0,0 +1,34 @@ +%% +%% Copyright (C) 2019 by Jander Moreira +%% +%% This is an extension of the algorithmicx package to handle +%% multiline contents. +%% + +\input docstrip.tex +\keepsilent +\usedir{tex/latex/algxpar} + +\preamble + + +Copyright (C) 2019 by Jander Moreira (moreira.jander@gmail.com) + +\endpreamble + +\generate{ + \file{algxpar.sty}{ + \from{algxpar.dtx}{algxpar} + } +} + +\obeyspaces +\Msg{**********************************************************} +\Msg{* The algxpar.sty file was generated} +\Msg{*} +\Msg{* To install it, move or copy it to a directory} +\Msg{* searched by LaTeX.} +\Msg{*} +\Msg{**********************************************************} + +\endbatchfile
\ No newline at end of file diff --git a/macros/latex/contrib/algxpar/algxpar.pdf b/macros/latex/contrib/algxpar/algxpar.pdf Binary files differnew file mode 100644 index 0000000000..e5deed1d8f --- /dev/null +++ b/macros/latex/contrib/algxpar/algxpar.pdf diff --git a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.dtx b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.dtx index 8409c539c2..ec37cb4dc1 100644 --- a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.dtx +++ b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.dtx @@ -25,14 +25,14 @@ % \iffalse %<*driver> \documentclass[11pt]{ltxdoc} +\CheckSum{3849} - -\usepackage{alltt} -\usepackage{hologo} -\usepackage{graphicx} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fontspec} + +\usepackage{hologo} +\usepackage{graphicx} \usepackage{multicol} \usepackage[dvipsnames]{xcolor} \usepackage[english]{babel} @@ -91,7 +91,6 @@ hyperindex=false% \renewcommand*{\aclabelfont}[1]{{\acsfont{#1}}} -%%\CheckSum{692} \renewcommand*{\usage}[1]{\hyperpage{#1}} \renewcommand*{\main}[1]{\hyperpage{#1}} @@ -151,9 +150,10 @@ top=3.25cm,bottom=3cm]{geometry} % %\MakeShortVerb{"} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Restyled the documentation. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % %\title{{\rmfamily\normalfont\spacedallcaps{% @@ -164,9 +164,9 @@ top=3.25cm,bottom=3cm]{geometry} % \url{r.andrej@gmail.com} % \and % \spacedlowsmallcaps{Nicola L. C. Talbot} \\ -% \spacedlowsmallcaps{(inactive)} +% {\textsf{(inactive)}} %} -%\date{{\sffamily\scshape 2019-11-07 (v2.0)}} +%\date{{\sffamily\scshape 2019-11-11 (v2.0.1)}} %\maketitle % % \renewcommand{\abstractname}{\normalfont\normalsize\spacedlowsmallcaps{Abstract}} @@ -186,9 +186,10 @@ top=3.25cm,bottom=3cm]{geometry} % style will be changed by \cs{date}\meta{language}. %\end{abstract} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a proper introduction. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \noindent % As of version 2.0, there is support for both Ekavian and Ijekavian @@ -231,9 +232,10 @@ top=3.25cm,bottom=3cm]{geometry} % % \section{The Documentation} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added installation guide. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \subsection{Installation} % Extract the language definition files first: @@ -308,9 +310,10 @@ top=3.25cm,bottom=3cm]{geometry} %\end{document} %\end{verbatim} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions and documented their use. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \subsection{Regions and scripts}\label{sub:regions} % % Serbian language is a rare example of synchronic digraphia --- a situation @@ -343,22 +346,24 @@ top=3.25cm,bottom=3cm]{geometry} % % % \subsection{Settings (Serbian-related)} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added documentation for new settings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % These settings can be changed using \sty{\\DTMlangsetup}. % Here's an example showing how to set both multiple--choice and boolean % settings. %\begin{verbatim} -% \DTMlangsetup[serbian]{pronunciation=ijekavian, monthi} +%\DTMlangsetup[serbian]{pronunciation=ijekavian, monthi} %\end{verbatim} % % % \subsubsectionopt{pronunciation}\label{sub:pronu} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch between Ekavian and Ijekavian pronunciation. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % May take values "ekavian" and "ijekavian", which denote the two most % frequently used pronunciations in Serbian language. % The only difference is in the way weekdays are written. @@ -366,66 +371,82 @@ top=3.25cm,bottom=3cm]{geometry} % The default value is Ekavian by default for "serbian", "serbianc", "sr-*-RS" % and Ijekavian for the rest of the regions. % -% \smallskip +% \changes{2.0.1}{2019-11-11}{Fixed paragraph indentation.} +% \bigskip +% \noindent % ponedeljak, 4. novembar 2019. \hfill \emph{Ekavian pronunciation} \\ % ponedjeljak, 4. novembar 2019. \hfill \emph{Ijekavian pronunciation} % % % \subsubsectionopt{monthi} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch June, July alternate spellings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % This is a boolean key. % If "false" (the default), the months June and July are spelled as \emph{Jun} % and \emph{Jul}. % If "true", the months June and July are spelled as \emph{Juni} and % \emph{Juli}. % -% \smallskip +% \changes{2.0.1}{2019-11-11}{Fixed paragraph indentation.} +% \bigskip +% \noindent % 15. juni 1389. \hfill "monthi=true" \\ % 15. jun 1389. \hfill "monthi=false" % % \subsubsectionopt{leadingzero}\label{sub:leadingzero} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch for toggling leading zeroes in day and month ordinals. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % This is a boolean key. % If "false" (the default), there is no leading zero for hours, days or months. % If "true", there is. % -% \smallskip +% \changes{2.0.1}{2019-11-11}{Fixed paragraph indentation.} +% \bigskip +% \noindent % уторак, 2. 4. 2019. 8.03 CET \hfill "leadingzero=false" \\ % уторак, 02. 04. 2019. 08.03 CET \hfill "leadingzero=true" % % \subsubsectionopt{monthord} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch between multiple numeric month ordinal formats used in % Serbian. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Changed colon \rightarrow{} period.} % This key defines the way the month ordinal is written in Serbian "*-numeric" % formats. +% This key defines the way the month ordinal is written in Serbian "*-numeric" % It takes values "arabic" (the default), "roman" and "romanlsc". % The "arabic" setting results in an arabic numeral (subject to -% \nameref{sub:leadingzero}) followed by a colon. -% The "roman" setting results in an uppercase Roman numeral without a colon +% \nameref{sub:leadingzero}) followed by a period. +% +% The "roman" setting results in an uppercase Roman numeral without a period % suffix. % The "romansc" setting results in a lowercase small caps Roman numeral without -% a colon suffix (this looks better than regular uppercase when usign old style -% figures). +% a period suffix (this looks better than regular uppercase when usign old +% style figures). % -% \smallskip +% \changes{2.0.1}{2019-11-11}{Fixed paragraph indentation.} +% \changes{2.0.1}{2019-11-11}{Fixed wrong example.} +% \bigskip +% \noindent % уторак, 2. 4. 2019. 8.03 CET \hfill "monthord=arabic" \\ % \liningnums{уторак, 2. IV 2019. 8.03 CET} \hfill "monthord=roman" with % "\liningnums" \\ -% \oldstylenums{уторак, 02. \textsc{iv} 2019. 08.03 CET} \hfill +% \oldstylenums{уторак, 2. \textsc{iv} 2019. 8.03 CET} \hfill % "monthord=romanlsc" with "\oldstylenums" % % \subsection{Other features and settings} % % \subsubsection{Showing the weekday} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % All language modules shipped with \sty{datetime2-serbian} support showing the % weekday. % To enable this feature, pass the \opt{showdow} option to the \sty{datetime2} @@ -518,20 +539,21 @@ top=3.25cm,bottom=3cm]{geometry} %\fi %\subsection{Base package localization strings} % +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraphs.} % This file contains the code common to all the Serbian regional % variations. -% % The localization strings are later imported with the appropriate encoding. % %\changes{1.0}{2015-03-31}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Separated the base package from the regionless style. % The base package now only declares common localization strings and includes % adequately encoded localization strings from their respective packages. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} -\ProvidesDateTimeModule{serbian-base}[2019/11/07 v2.0] +\ProvidesDateTimeModule{serbian-base}[2019/11/11 v2.0.1] % \end{macrocode} % % @@ -603,8 +625,7 @@ top=3.25cm,bottom=3cm]{geometry} } % \end{macrocode} %\end{macro} -% -% +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % We will now include the appropriate localization data. % % Packages \sty{ifxetex} and \sty{ifluatex} provide a way to determine if the @@ -648,13 +669,14 @@ top=3.25cm,bottom=3cm]{geometry} % This file is loaded if \hologo{XeLaTeX} or \hologo{LuaLaTeX} are used. % %\changes{1.0}{2015-03-31}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings are now declared within the Python build script % and both the \acs{utf-8} and \acs{licr} encoded strings are generated from % said files on build, before uploading to CTAN. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} -\ProvidesDateTimeModule{serbian-base-utf8}[2019/11/07 v2.0] +\ProvidesDateTimeModule{serbian-base-utf8}[2019/11/11 v2.0.1] % \end{macrocode} % %\subsubsection{Latin month names} @@ -1090,14 +1112,15 @@ top=3.25cm,bottom=3cm]{geometry} % quite insane. % %\changes{1.0}{2015-03-31}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings are now declared within the Python build script % and both the \acs{utf-8} and \acs{licr} encoded strings are generated from % said files on build, before uploading to CTAN. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} -\ProvidesDateTimeModule{serbian-base-ascii}[2019/11/07 v2.0] +\ProvidesDateTimeModule{serbian-base-ascii}[2019/11/11 v2.0.1] % \end{macrocode} % %%\subsubsection{Latin month names} @@ -1527,24 +1550,29 @@ top=3.25cm,bottom=3cm]{geometry} %\subsection{Serbian \sty{serbian} Code % (\texttt{datetime2-serbian.ldf})} %\changes{1.0}{2015-03-24}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions, all settings made available to regions so all changes can be % region-specific. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} -\ProvidesDateTimeModule{serbian}[2019/11/07 v2.0] +\ProvidesDateTimeModule{serbian}[2019/11/11 v2.0.1] % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings loaded from base module. %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % Load base Serbian module. % \begin{macrocode} \RequireDateTimeModule{serbian-base} % \end{macrocode} % +% +% %\subsubsection{Defining the \sty{serbian} style} % +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Fixed region name error.} % Allow the user a way of configuring the "serbian" and % "serbian-numeric" styles by providing macros for various format % elements. @@ -1552,7 +1580,6 @@ top=3.25cm,bottom=3cm]{geometry} % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in % case other date formats are also required. % -% %\begin{macro}{\DTMserbiandowdaysep} % The separator between weekday and day. % \begin{macrocode} @@ -1627,9 +1654,10 @@ top=3.25cm,bottom=3cm]{geometry} % %\subsubsection{Switches and settings} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} %\begin{macro}{\DTMserbianweekdayname} % Define the weekday name, lowercase. % \begin{macrocode} @@ -1647,9 +1675,10 @@ top=3.25cm,bottom=3cm]{geometry} %\end{macro} % % Provide a way to switch between Ekavian and Ijekavian pronunciation. -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch between Ekavian and Ijekavian pronunciation. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} \DTMdefchoicekey{serbian}% @@ -1667,10 +1696,11 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch June, July alternate spellings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that can switch between (jun, jul) and (juni, juli) % month spellings. % \begin{macrocode} @@ -1680,10 +1710,11 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{serbian}{monthi}{false} % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch for adding leading zeroes in day and month ordinals. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day and month ordinals should % have leading zeroes. % \begin{macrocode} @@ -1694,8 +1725,6 @@ top=3.25cm,bottom=3cm]{geometry} \DTMsetbool{serbian}{leadingzero}{false} % \end{macrocode} % -% -% %\begin{macro}{\DTMserbiandayordinal} % Define the day ordinal format to be used by this style. % \begin{macrocode} @@ -1713,13 +1742,13 @@ top=3.25cm,bottom=3cm]{geometry} \number#1\DTMserbiandatesep}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Removed the option to switch between writing systems, since that is % accomplished by using different regions or regionless styles ("serbian" and % "serbianc" for example). %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define the month names. % %\begin{macro}{\DTMserbiannoimonthname} @@ -1745,7 +1774,7 @@ top=3.25cm,bottom=3cm]{geometry} \newcommand*{\DTMserbianiMonthname}{\DTMserbianlatiMonthname} % \end{macrocode} %\end{macro} -% +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} @@ -1755,7 +1784,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{serbian}{mapzone}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} @@ -1765,7 +1794,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{serbian}{showdayofmonth}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} @@ -1775,9 +1804,10 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{serbian}{showyear}{true} % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \DTMnewstyle% {serbian}% label @@ -1883,11 +1913,12 @@ top=3.25cm,bottom=3cm]{geometry} \DTMifbool{serbian}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch between multiple numeric month ordinal formats used in % Serbian. %} +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a setting to switch between Arabic, uppercase Roman and lowercase % smallcaps Roman month format for the "serbian-numeric" style. % \begin{macrocode} @@ -1908,13 +1939,15 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Fixed the (previously entirely wrong) numeric date style. %} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define numeric style. % \begin{macrocode} \DTMnewstyle% @@ -1997,6 +2030,7 @@ top=3.25cm,bottom=3cm]{geometry} % The time zone mappings are set through this command, which can be % redefined if extra mappings are required or mappings need to be % removed. +%\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.} % \begin{macrocode} \newcommand*{\DTMserbianzonemaps}{% \DTMdefzonemap{01}{00}{CET}% @@ -2004,7 +2038,6 @@ top=3.25cm,bottom=3cm]{geometry} } % \end{macrocode} %\end{macro} - % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional% @@ -2012,14 +2045,14 @@ top=3.25cm,bottom=3cm]{geometry} {\DTMsetstyle{serbian}}% {\DTMsetstyle{serbian-numeric}}% % \end{macrocode} -% % Redefine \cs{dateserbian} (or \cs{date}\meta{dialect}) to prevent % \sty{babel} from resetting \cs{today}. (For this to work, % \sty{babel} must already have been loaded if it's required.) %\changes{1.1}{2019-09-14}{removed spurious space} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% @@ -2039,6 +2072,9 @@ top=3.25cm,bottom=3cm]{geometry} \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional% {}% do nothing +% \end{macrocode} +%\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.} +% \begin{macrocode} {\DTMsetstyle{serbian}}% {\DTMsetstyle{serbian-numeric}}% }% @@ -2060,32 +2096,36 @@ top=3.25cm,bottom=3cm]{geometry} %\subsection{Serbian \sty{sr-Latn} Code % (\texttt{datetime2-sr-Latn.ldf})} %\changes{1.0}{2015-03-24}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions, all settings made available to regions so all changes can be % region-specific. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} -\ProvidesDateTimeModule{sr-Latn}[2019/11/07 v2.0] +\ProvidesDateTimeModule{sr-Latn}[2019/11/11 v2.0.1] % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings loaded from base module. %} -% -% Load base Serbian module. +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% Load appropriate regionless Serbian module. % \begin{macrocode} -\RequireDateTimeModule{serbian-base} +\RequireDateTimeModule{serbian} % \end{macrocode} % +% +% %\subsubsection{Defining the \sty{sr-Latn} style} % -% Allow the user a way of configuring the "srLatn" and -% "srLatn-numeric" styles by providing macros for various format +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Fixed region name error.} +% Allow the user a way of configuring the "sr-Latn" and +% "sr-Latn-numeric" styles by providing macros for various format % elements. % % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in % case other date formats are also required. % -% %\begin{macro}{\DTMsrLatndowdaysep} % The separator between weekday and day. % \begin{macrocode} @@ -2160,9 +2200,10 @@ top=3.25cm,bottom=3cm]{geometry} % %\subsubsection{Switches and settings} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} %\begin{macro}{\DTMsrLatnweekdayname} % Define the weekday name, lowercase. % \begin{macrocode} @@ -2180,9 +2221,10 @@ top=3.25cm,bottom=3cm]{geometry} %\end{macro} % % Provide a way to switch between Ekavian and Ijekavian pronunciation. -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch between Ekavian and Ijekavian pronunciation. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} \DTMdefchoicekey{sr-Latn}% @@ -2200,10 +2242,11 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch June, July alternate spellings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that can switch between (jun, jul) and (juni, juli) % month spellings. % \begin{macrocode} @@ -2213,10 +2256,11 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn}{monthi}{false} % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch for adding leading zeroes in day and month ordinals. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day and month ordinals should % have leading zeroes. % \begin{macrocode} @@ -2227,8 +2271,6 @@ top=3.25cm,bottom=3cm]{geometry} \DTMsetbool{sr-Latn}{leadingzero}{false} % \end{macrocode} % -% -% %\begin{macro}{\DTMsrLatndayordinal} % Define the day ordinal format to be used by this style. % \begin{macrocode} @@ -2246,13 +2288,13 @@ top=3.25cm,bottom=3cm]{geometry} \number#1\DTMsrLatndatesep}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Removed the option to switch between writing systems, since that is % accomplished by using different regions or regionless styles ("serbian" and % "serbianc" for example). %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define the month names. % %\begin{macro}{\DTMsrLatnnoimonthname} @@ -2278,7 +2320,7 @@ top=3.25cm,bottom=3cm]{geometry} \newcommand*{\DTMsrLatniMonthname}{\DTMserbianlatiMonthname} % \end{macrocode} %\end{macro} -% +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} @@ -2288,7 +2330,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn}{mapzone}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} @@ -2298,7 +2340,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn}{showdayofmonth}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} @@ -2308,9 +2350,10 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn}{showyear}{true} % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \DTMnewstyle% {sr-Latn}% label @@ -2416,11 +2459,12 @@ top=3.25cm,bottom=3cm]{geometry} \DTMifbool{sr-Latn}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch between multiple numeric month ordinal formats used in % Serbian. %} +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a setting to switch between Arabic, uppercase Roman and lowercase % smallcaps Roman month format for the "srLatn-numeric" style. % \begin{macrocode} @@ -2441,13 +2485,15 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Fixed the (previously entirely wrong) numeric date style. %} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define numeric style. % \begin{macrocode} \DTMnewstyle% @@ -2530,14 +2576,14 @@ top=3.25cm,bottom=3cm]{geometry} % The time zone mappings are set through this command, which can be % redefined if extra mappings are required or mappings need to be % removed. +%\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.} % \begin{macrocode} -\newcommand*{\DTMsr-Latnzonemaps}{% +\newcommand*{\DTMsrLatnzonemaps}{% \DTMdefzonemap{01}{00}{CET}% \DTMdefzonemap{02}{00}{CEST}% } % \end{macrocode} %\end{macro} - % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional% @@ -2545,14 +2591,14 @@ top=3.25cm,bottom=3cm]{geometry} {\DTMsetstyle{sr-Latn}}% {\DTMsetstyle{sr-Latn-numeric}}% % \end{macrocode} -% % Redefine \cs{dateserbian} (or \cs{date}\meta{dialect}) to prevent % \sty{babel} from resetting \cs{today}. (For this to work, % \sty{babel} must already have been loaded if it's required.) %\changes{1.1}{2019-09-14}{removed spurious space} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% @@ -2572,8 +2618,11 @@ top=3.25cm,bottom=3cm]{geometry} \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional% {}% do nothing - {\DTMsetstyle{sr-Latn}}% - {\DTMsetstyle{sr-Latn-numeric}}% +% \end{macrocode} +%\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.} +% \begin{macrocode} + {\DTMsetstyle{serbian}}% + {\DTMsetstyle{serbian-numeric}}% }% }% % \end{macrocode} @@ -2593,32 +2642,36 @@ top=3.25cm,bottom=3cm]{geometry} %\subsection{Serbian \sty{sr-Latn-RS} Code % (\texttt{datetime2-sr-Latn-RS.ldf})} %\changes{1.0}{2015-03-24}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions, all settings made available to regions so all changes can be % region-specific. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} -\ProvidesDateTimeModule{sr-Latn-RS}[2019/11/07 v2.0] +\ProvidesDateTimeModule{sr-Latn-RS}[2019/11/11 v2.0.1] % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings loaded from base module. %} -% -% Load base Serbian module. +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% Load appropriate regionless Serbian module. % \begin{macrocode} -\RequireDateTimeModule{serbian-base} +\RequireDateTimeModule{serbian} % \end{macrocode} % +% +% %\subsubsection{Defining the \sty{sr-Latn-RS} style} % -% Allow the user a way of configuring the "srLatnRS" and -% "srLatnRS-numeric" styles by providing macros for various format +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Fixed region name error.} +% Allow the user a way of configuring the "sr-Latn-RS" and +% "sr-Latn-RS-numeric" styles by providing macros for various format % elements. % % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in % case other date formats are also required. % -% %\begin{macro}{\DTMsrLatnRSdowdaysep} % The separator between weekday and day. % \begin{macrocode} @@ -2693,9 +2746,10 @@ top=3.25cm,bottom=3cm]{geometry} % %\subsubsection{Switches and settings} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} %\begin{macro}{\DTMsrLatnRSweekdayname} % Define the weekday name, lowercase. % \begin{macrocode} @@ -2713,9 +2767,10 @@ top=3.25cm,bottom=3cm]{geometry} %\end{macro} % % Provide a way to switch between Ekavian and Ijekavian pronunciation. -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch between Ekavian and Ijekavian pronunciation. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} \DTMdefchoicekey{sr-Latn-RS}% @@ -2733,10 +2788,11 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch June, July alternate spellings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that can switch between (jun, jul) and (juni, juli) % month spellings. % \begin{macrocode} @@ -2746,10 +2802,11 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-RS}{monthi}{false} % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch for adding leading zeroes in day and month ordinals. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day and month ordinals should % have leading zeroes. % \begin{macrocode} @@ -2760,8 +2817,6 @@ top=3.25cm,bottom=3cm]{geometry} \DTMsetbool{sr-Latn-RS}{leadingzero}{false} % \end{macrocode} % -% -% %\begin{macro}{\DTMsrLatnRSdayordinal} % Define the day ordinal format to be used by this style. % \begin{macrocode} @@ -2779,13 +2834,13 @@ top=3.25cm,bottom=3cm]{geometry} \number#1\DTMsrLatnRSdatesep}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Removed the option to switch between writing systems, since that is % accomplished by using different regions or regionless styles ("serbian" and % "serbianc" for example). %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define the month names. % %\begin{macro}{\DTMsrLatnRSnoimonthname} @@ -2811,7 +2866,7 @@ top=3.25cm,bottom=3cm]{geometry} \newcommand*{\DTMsrLatnRSiMonthname}{\DTMserbianlatiMonthname} % \end{macrocode} %\end{macro} -% +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} @@ -2821,7 +2876,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-RS}{mapzone}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} @@ -2831,7 +2886,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-RS}{showdayofmonth}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} @@ -2841,9 +2896,10 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-RS}{showyear}{true} % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \DTMnewstyle% {sr-Latn-RS}% label @@ -2949,11 +3005,12 @@ top=3.25cm,bottom=3cm]{geometry} \DTMifbool{sr-Latn-RS}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch between multiple numeric month ordinal formats used in % Serbian. %} +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a setting to switch between Arabic, uppercase Roman and lowercase % smallcaps Roman month format for the "srLatnRS-numeric" style. % \begin{macrocode} @@ -2974,13 +3031,15 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Fixed the (previously entirely wrong) numeric date style. %} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define numeric style. % \begin{macrocode} \DTMnewstyle% @@ -3063,14 +3122,14 @@ top=3.25cm,bottom=3cm]{geometry} % The time zone mappings are set through this command, which can be % redefined if extra mappings are required or mappings need to be % removed. +%\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.} % \begin{macrocode} -\newcommand*{\DTMsr-Latn-RSzonemaps}{% +\newcommand*{\DTMsrLatnRSzonemaps}{% \DTMdefzonemap{01}{00}{CET}% \DTMdefzonemap{02}{00}{CEST}% } % \end{macrocode} %\end{macro} - % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional% @@ -3078,14 +3137,14 @@ top=3.25cm,bottom=3cm]{geometry} {\DTMsetstyle{sr-Latn-RS}}% {\DTMsetstyle{sr-Latn-RS-numeric}}% % \end{macrocode} -% % Redefine \cs{dateserbian} (or \cs{date}\meta{dialect}) to prevent % \sty{babel} from resetting \cs{today}. (For this to work, % \sty{babel} must already have been loaded if it's required.) %\changes{1.1}{2019-09-14}{removed spurious space} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% @@ -3105,8 +3164,11 @@ top=3.25cm,bottom=3cm]{geometry} \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional% {}% do nothing - {\DTMsetstyle{sr-Latn-RS}}% - {\DTMsetstyle{sr-Latn-RS-numeric}}% +% \end{macrocode} +%\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.} +% \begin{macrocode} + {\DTMsetstyle{serbian}}% + {\DTMsetstyle{serbian-numeric}}% }% }% % \end{macrocode} @@ -3126,32 +3188,36 @@ top=3.25cm,bottom=3cm]{geometry} %\subsection{Serbian \sty{sr-Latn-ME} Code % (\texttt{datetime2-sr-Latn-ME.ldf})} %\changes{1.0}{2015-03-24}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions, all settings made available to regions so all changes can be % region-specific. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} -\ProvidesDateTimeModule{sr-Latn-ME}[2019/11/07 v2.0] +\ProvidesDateTimeModule{sr-Latn-ME}[2019/11/11 v2.0.1] % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings loaded from base module. %} -% -% Load base Serbian module. +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% Load appropriate regionless Serbian module. % \begin{macrocode} -\RequireDateTimeModule{serbian-base} +\RequireDateTimeModule{serbian} % \end{macrocode} % +% +% %\subsubsection{Defining the \sty{sr-Latn-ME} style} % -% Allow the user a way of configuring the "srLatnME" and -% "srLatnME-numeric" styles by providing macros for various format +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Fixed region name error.} +% Allow the user a way of configuring the "sr-Latn-ME" and +% "sr-Latn-ME-numeric" styles by providing macros for various format % elements. % % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in % case other date formats are also required. % -% %\begin{macro}{\DTMsrLatnMEdowdaysep} % The separator between weekday and day. % \begin{macrocode} @@ -3226,9 +3292,10 @@ top=3.25cm,bottom=3cm]{geometry} % %\subsubsection{Switches and settings} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} %\begin{macro}{\DTMsrLatnMEweekdayname} % Define the weekday name, lowercase. % \begin{macrocode} @@ -3246,9 +3313,10 @@ top=3.25cm,bottom=3cm]{geometry} %\end{macro} % % Provide a way to switch between Ekavian and Ijekavian pronunciation. -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch between Ekavian and Ijekavian pronunciation. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} \DTMdefchoicekey{sr-Latn-ME}% @@ -3266,10 +3334,11 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch June, July alternate spellings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that can switch between (jun, jul) and (juni, juli) % month spellings. % \begin{macrocode} @@ -3279,10 +3348,11 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-ME}{monthi}{false} % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch for adding leading zeroes in day and month ordinals. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day and month ordinals should % have leading zeroes. % \begin{macrocode} @@ -3293,8 +3363,6 @@ top=3.25cm,bottom=3cm]{geometry} \DTMsetbool{sr-Latn-ME}{leadingzero}{false} % \end{macrocode} % -% -% %\begin{macro}{\DTMsrLatnMEdayordinal} % Define the day ordinal format to be used by this style. % \begin{macrocode} @@ -3312,13 +3380,13 @@ top=3.25cm,bottom=3cm]{geometry} \number#1\DTMsrLatnMEdatesep}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Removed the option to switch between writing systems, since that is % accomplished by using different regions or regionless styles ("serbian" and % "serbianc" for example). %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define the month names. % %\begin{macro}{\DTMsrLatnMEnoimonthname} @@ -3344,7 +3412,7 @@ top=3.25cm,bottom=3cm]{geometry} \newcommand*{\DTMsrLatnMEiMonthname}{\DTMserbianlatiMonthname} % \end{macrocode} %\end{macro} -% +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} @@ -3354,7 +3422,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-ME}{mapzone}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} @@ -3364,7 +3432,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-ME}{showdayofmonth}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} @@ -3374,9 +3442,10 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-ME}{showyear}{true} % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \DTMnewstyle% {sr-Latn-ME}% label @@ -3482,11 +3551,12 @@ top=3.25cm,bottom=3cm]{geometry} \DTMifbool{sr-Latn-ME}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch between multiple numeric month ordinal formats used in % Serbian. %} +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a setting to switch between Arabic, uppercase Roman and lowercase % smallcaps Roman month format for the "srLatnME-numeric" style. % \begin{macrocode} @@ -3507,13 +3577,15 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Fixed the (previously entirely wrong) numeric date style. %} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define numeric style. % \begin{macrocode} \DTMnewstyle% @@ -3596,14 +3668,14 @@ top=3.25cm,bottom=3cm]{geometry} % The time zone mappings are set through this command, which can be % redefined if extra mappings are required or mappings need to be % removed. +%\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.} % \begin{macrocode} -\newcommand*{\DTMsr-Latn-MEzonemaps}{% +\newcommand*{\DTMsrLatnMEzonemaps}{% \DTMdefzonemap{01}{00}{CET}% \DTMdefzonemap{02}{00}{CEST}% } % \end{macrocode} %\end{macro} - % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional% @@ -3611,14 +3683,14 @@ top=3.25cm,bottom=3cm]{geometry} {\DTMsetstyle{sr-Latn-ME}}% {\DTMsetstyle{sr-Latn-ME-numeric}}% % \end{macrocode} -% % Redefine \cs{dateserbian} (or \cs{date}\meta{dialect}) to prevent % \sty{babel} from resetting \cs{today}. (For this to work, % \sty{babel} must already have been loaded if it's required.) %\changes{1.1}{2019-09-14}{removed spurious space} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% @@ -3638,8 +3710,11 @@ top=3.25cm,bottom=3cm]{geometry} \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional% {}% do nothing - {\DTMsetstyle{sr-Latn-ME}}% - {\DTMsetstyle{sr-Latn-ME-numeric}}% +% \end{macrocode} +%\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.} +% \begin{macrocode} + {\DTMsetstyle{serbian}}% + {\DTMsetstyle{serbian-numeric}}% }% }% % \end{macrocode} @@ -3659,32 +3734,36 @@ top=3.25cm,bottom=3cm]{geometry} %\subsection{Serbian \sty{sr-Latn-BA} Code % (\texttt{datetime2-sr-Latn-BA.ldf})} %\changes{1.0}{2015-03-24}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions, all settings made available to regions so all changes can be % region-specific. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} -\ProvidesDateTimeModule{sr-Latn-BA}[2019/11/07 v2.0] +\ProvidesDateTimeModule{sr-Latn-BA}[2019/11/11 v2.0.1] % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings loaded from base module. %} -% -% Load base Serbian module. +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% Load appropriate regionless Serbian module. % \begin{macrocode} -\RequireDateTimeModule{serbian-base} +\RequireDateTimeModule{serbian} % \end{macrocode} % +% +% %\subsubsection{Defining the \sty{sr-Latn-BA} style} % -% Allow the user a way of configuring the "srLatnBA" and -% "srLatnBA-numeric" styles by providing macros for various format +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Fixed region name error.} +% Allow the user a way of configuring the "sr-Latn-BA" and +% "sr-Latn-BA-numeric" styles by providing macros for various format % elements. % % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in % case other date formats are also required. % -% %\begin{macro}{\DTMsrLatnBAdowdaysep} % The separator between weekday and day. % \begin{macrocode} @@ -3759,9 +3838,10 @@ top=3.25cm,bottom=3cm]{geometry} % %\subsubsection{Switches and settings} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} %\begin{macro}{\DTMsrLatnBAweekdayname} % Define the weekday name, lowercase. % \begin{macrocode} @@ -3779,9 +3859,10 @@ top=3.25cm,bottom=3cm]{geometry} %\end{macro} % % Provide a way to switch between Ekavian and Ijekavian pronunciation. -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch between Ekavian and Ijekavian pronunciation. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} \DTMdefchoicekey{sr-Latn-BA}% @@ -3799,10 +3880,11 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch June, July alternate spellings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that can switch between (jun, jul) and (juni, juli) % month spellings. % \begin{macrocode} @@ -3812,10 +3894,11 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-BA}{monthi}{false} % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch for adding leading zeroes in day and month ordinals. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day and month ordinals should % have leading zeroes. % \begin{macrocode} @@ -3826,8 +3909,6 @@ top=3.25cm,bottom=3cm]{geometry} \DTMsetbool{sr-Latn-BA}{leadingzero}{false} % \end{macrocode} % -% -% %\begin{macro}{\DTMsrLatnBAdayordinal} % Define the day ordinal format to be used by this style. % \begin{macrocode} @@ -3845,13 +3926,13 @@ top=3.25cm,bottom=3cm]{geometry} \number#1\DTMsrLatnBAdatesep}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Removed the option to switch between writing systems, since that is % accomplished by using different regions or regionless styles ("serbian" and % "serbianc" for example). %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define the month names. % %\begin{macro}{\DTMsrLatnBAnoimonthname} @@ -3877,7 +3958,7 @@ top=3.25cm,bottom=3cm]{geometry} \newcommand*{\DTMsrLatnBAiMonthname}{\DTMserbianlatiMonthname} % \end{macrocode} %\end{macro} -% +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} @@ -3887,7 +3968,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-BA}{mapzone}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} @@ -3897,7 +3978,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-BA}{showdayofmonth}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} @@ -3907,9 +3988,10 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Latn-BA}{showyear}{true} % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \DTMnewstyle% {sr-Latn-BA}% label @@ -4015,11 +4097,12 @@ top=3.25cm,bottom=3cm]{geometry} \DTMifbool{sr-Latn-BA}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch between multiple numeric month ordinal formats used in % Serbian. %} +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a setting to switch between Arabic, uppercase Roman and lowercase % smallcaps Roman month format for the "srLatnBA-numeric" style. % \begin{macrocode} @@ -4040,13 +4123,15 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Fixed the (previously entirely wrong) numeric date style. %} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define numeric style. % \begin{macrocode} \DTMnewstyle% @@ -4129,14 +4214,14 @@ top=3.25cm,bottom=3cm]{geometry} % The time zone mappings are set through this command, which can be % redefined if extra mappings are required or mappings need to be % removed. +%\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.} % \begin{macrocode} -\newcommand*{\DTMsr-Latn-BAzonemaps}{% +\newcommand*{\DTMsrLatnBAzonemaps}{% \DTMdefzonemap{01}{00}{CET}% \DTMdefzonemap{02}{00}{CEST}% } % \end{macrocode} %\end{macro} - % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional% @@ -4144,14 +4229,14 @@ top=3.25cm,bottom=3cm]{geometry} {\DTMsetstyle{sr-Latn-BA}}% {\DTMsetstyle{sr-Latn-BA-numeric}}% % \end{macrocode} -% % Redefine \cs{dateserbian} (or \cs{date}\meta{dialect}) to prevent % \sty{babel} from resetting \cs{today}. (For this to work, % \sty{babel} must already have been loaded if it's required.) %\changes{1.1}{2019-09-14}{removed spurious space} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% @@ -4171,8 +4256,11 @@ top=3.25cm,bottom=3cm]{geometry} \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional% {}% do nothing - {\DTMsetstyle{sr-Latn-BA}}% - {\DTMsetstyle{sr-Latn-BA-numeric}}% +% \end{macrocode} +%\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.} +% \begin{macrocode} + {\DTMsetstyle{serbian}}% + {\DTMsetstyle{serbian-numeric}}% }% }% % \end{macrocode} @@ -4192,24 +4280,29 @@ top=3.25cm,bottom=3cm]{geometry} %\subsection{Serbian \sty{serbianc} Code % (\texttt{datetime2-serbianc.ldf})} %\changes{1.0}{2015-03-24}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions, all settings made available to regions so all changes can be % region-specific. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} -\ProvidesDateTimeModule{serbianc}[2019/11/07 v2.0] +\ProvidesDateTimeModule{serbianc}[2019/11/11 v2.0.1] % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings loaded from base module. %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % Load base Serbian module. % \begin{macrocode} \RequireDateTimeModule{serbian-base} % \end{macrocode} % +% +% %\subsubsection{Defining the \sty{serbianc} style} % +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Fixed region name error.} % Allow the user a way of configuring the "serbianc" and % "serbianc-numeric" styles by providing macros for various format % elements. @@ -4217,7 +4310,6 @@ top=3.25cm,bottom=3cm]{geometry} % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in % case other date formats are also required. % -% %\begin{macro}{\DTMserbiancdowdaysep} % The separator between weekday and day. % \begin{macrocode} @@ -4292,9 +4384,10 @@ top=3.25cm,bottom=3cm]{geometry} % %\subsubsection{Switches and settings} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} %\begin{macro}{\DTMserbiancweekdayname} % Define the weekday name, lowercase. % \begin{macrocode} @@ -4312,9 +4405,10 @@ top=3.25cm,bottom=3cm]{geometry} %\end{macro} % % Provide a way to switch between Ekavian and Ijekavian pronunciation. -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch between Ekavian and Ijekavian pronunciation. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} \DTMdefchoicekey{serbianc}% @@ -4332,10 +4426,11 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch June, July alternate spellings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that can switch between (jun, jul) and (juni, juli) % month spellings. % \begin{macrocode} @@ -4345,10 +4440,11 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{serbianc}{monthi}{false} % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch for adding leading zeroes in day and month ordinals. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day and month ordinals should % have leading zeroes. % \begin{macrocode} @@ -4359,8 +4455,6 @@ top=3.25cm,bottom=3cm]{geometry} \DTMsetbool{serbianc}{leadingzero}{false} % \end{macrocode} % -% -% %\begin{macro}{\DTMserbiancdayordinal} % Define the day ordinal format to be used by this style. % \begin{macrocode} @@ -4378,13 +4472,13 @@ top=3.25cm,bottom=3cm]{geometry} \number#1\DTMserbiancdatesep}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Removed the option to switch between writing systems, since that is % accomplished by using different regions or regionless styles ("serbian" and % "serbianc" for example). %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define the month names. % %\begin{macro}{\DTMserbiancnoimonthname} @@ -4410,7 +4504,7 @@ top=3.25cm,bottom=3cm]{geometry} \newcommand*{\DTMserbianciMonthname}{\DTMserbiancyriMonthname} % \end{macrocode} %\end{macro} -% +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} @@ -4420,7 +4514,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{serbianc}{mapzone}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} @@ -4430,7 +4524,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{serbianc}{showdayofmonth}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} @@ -4440,9 +4534,10 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{serbianc}{showyear}{true} % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \DTMnewstyle% {serbianc}% label @@ -4548,11 +4643,12 @@ top=3.25cm,bottom=3cm]{geometry} \DTMifbool{serbianc}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch between multiple numeric month ordinal formats used in % Serbian. %} +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a setting to switch between Arabic, uppercase Roman and lowercase % smallcaps Roman month format for the "serbianc-numeric" style. % \begin{macrocode} @@ -4573,13 +4669,15 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Fixed the (previously entirely wrong) numeric date style. %} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define numeric style. % \begin{macrocode} \DTMnewstyle% @@ -4662,6 +4760,7 @@ top=3.25cm,bottom=3cm]{geometry} % The time zone mappings are set through this command, which can be % redefined if extra mappings are required or mappings need to be % removed. +%\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.} % \begin{macrocode} \newcommand*{\DTMserbianczonemaps}{% \DTMdefzonemap{01}{00}{CET}% @@ -4669,7 +4768,6 @@ top=3.25cm,bottom=3cm]{geometry} } % \end{macrocode} %\end{macro} - % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional% @@ -4677,14 +4775,14 @@ top=3.25cm,bottom=3cm]{geometry} {\DTMsetstyle{serbianc}}% {\DTMsetstyle{serbianc-numeric}}% % \end{macrocode} -% % Redefine \cs{dateserbianc} (or \cs{date}\meta{dialect}) to prevent % \sty{babel} from resetting \cs{today}. (For this to work, % \sty{babel} must already have been loaded if it's required.) %\changes{1.1}{2019-09-14}{removed spurious space} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% @@ -4704,6 +4802,9 @@ top=3.25cm,bottom=3cm]{geometry} \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional% {}% do nothing +% \end{macrocode} +%\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.} +% \begin{macrocode} {\DTMsetstyle{serbianc}}% {\DTMsetstyle{serbianc-numeric}}% }% @@ -4725,32 +4826,36 @@ top=3.25cm,bottom=3cm]{geometry} %\subsection{Serbian \sty{sr-Cyrl} Code % (\texttt{datetime2-sr-Cyrl.ldf})} %\changes{1.0}{2015-03-24}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions, all settings made available to regions so all changes can be % region-specific. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} -\ProvidesDateTimeModule{sr-Cyrl}[2019/11/07 v2.0] +\ProvidesDateTimeModule{sr-Cyrl}[2019/11/11 v2.0.1] % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings loaded from base module. %} -% -% Load base Serbian module. +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% Load appropriate regionless Serbian module. % \begin{macrocode} -\RequireDateTimeModule{serbian-base} +\RequireDateTimeModule{serbianc} % \end{macrocode} % +% +% %\subsubsection{Defining the \sty{sr-Cyrl} style} % -% Allow the user a way of configuring the "srCyrl" and -% "srCyrl-numeric" styles by providing macros for various format +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Fixed region name error.} +% Allow the user a way of configuring the "sr-Cyrl" and +% "sr-Cyrl-numeric" styles by providing macros for various format % elements. % % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in % case other date formats are also required. % -% %\begin{macro}{\DTMsrCyrldowdaysep} % The separator between weekday and day. % \begin{macrocode} @@ -4825,9 +4930,10 @@ top=3.25cm,bottom=3cm]{geometry} % %\subsubsection{Switches and settings} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} %\begin{macro}{\DTMsrCyrlweekdayname} % Define the weekday name, lowercase. % \begin{macrocode} @@ -4845,9 +4951,10 @@ top=3.25cm,bottom=3cm]{geometry} %\end{macro} % % Provide a way to switch between Ekavian and Ijekavian pronunciation. -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch between Ekavian and Ijekavian pronunciation. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} \DTMdefchoicekey{sr-Cyrl}% @@ -4865,10 +4972,11 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch June, July alternate spellings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that can switch between (jun, jul) and (juni, juli) % month spellings. % \begin{macrocode} @@ -4878,10 +4986,11 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl}{monthi}{false} % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch for adding leading zeroes in day and month ordinals. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day and month ordinals should % have leading zeroes. % \begin{macrocode} @@ -4892,8 +5001,6 @@ top=3.25cm,bottom=3cm]{geometry} \DTMsetbool{sr-Cyrl}{leadingzero}{false} % \end{macrocode} % -% -% %\begin{macro}{\DTMsrCyrldayordinal} % Define the day ordinal format to be used by this style. % \begin{macrocode} @@ -4911,13 +5018,13 @@ top=3.25cm,bottom=3cm]{geometry} \number#1\DTMsrCyrldatesep}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Removed the option to switch between writing systems, since that is % accomplished by using different regions or regionless styles ("serbian" and % "serbianc" for example). %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define the month names. % %\begin{macro}{\DTMsrCyrlnoimonthname} @@ -4943,7 +5050,7 @@ top=3.25cm,bottom=3cm]{geometry} \newcommand*{\DTMsrCyrliMonthname}{\DTMserbiancyriMonthname} % \end{macrocode} %\end{macro} -% +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} @@ -4953,7 +5060,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl}{mapzone}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} @@ -4963,7 +5070,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl}{showdayofmonth}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} @@ -4973,9 +5080,10 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl}{showyear}{true} % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \DTMnewstyle% {sr-Cyrl}% label @@ -5081,11 +5189,12 @@ top=3.25cm,bottom=3cm]{geometry} \DTMifbool{sr-Cyrl}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch between multiple numeric month ordinal formats used in % Serbian. %} +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a setting to switch between Arabic, uppercase Roman and lowercase % smallcaps Roman month format for the "srCyrl-numeric" style. % \begin{macrocode} @@ -5106,13 +5215,15 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Fixed the (previously entirely wrong) numeric date style. %} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define numeric style. % \begin{macrocode} \DTMnewstyle% @@ -5195,14 +5306,14 @@ top=3.25cm,bottom=3cm]{geometry} % The time zone mappings are set through this command, which can be % redefined if extra mappings are required or mappings need to be % removed. +%\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.} % \begin{macrocode} -\newcommand*{\DTMsr-Cyrlzonemaps}{% +\newcommand*{\DTMsrCyrlzonemaps}{% \DTMdefzonemap{01}{00}{CET}% \DTMdefzonemap{02}{00}{CEST}% } % \end{macrocode} %\end{macro} - % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional% @@ -5210,14 +5321,14 @@ top=3.25cm,bottom=3cm]{geometry} {\DTMsetstyle{sr-Cyrl}}% {\DTMsetstyle{sr-Cyrl-numeric}}% % \end{macrocode} -% % Redefine \cs{dateserbianc} (or \cs{date}\meta{dialect}) to prevent % \sty{babel} from resetting \cs{today}. (For this to work, % \sty{babel} must already have been loaded if it's required.) %\changes{1.1}{2019-09-14}{removed spurious space} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% @@ -5237,8 +5348,11 @@ top=3.25cm,bottom=3cm]{geometry} \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional% {}% do nothing - {\DTMsetstyle{sr-Cyrl}}% - {\DTMsetstyle{sr-Cyrl-numeric}}% +% \end{macrocode} +%\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.} +% \begin{macrocode} + {\DTMsetstyle{serbianc}}% + {\DTMsetstyle{serbianc-numeric}}% }% }% % \end{macrocode} @@ -5258,32 +5372,36 @@ top=3.25cm,bottom=3cm]{geometry} %\subsection{Serbian \sty{sr-Cyrl-RS} Code % (\texttt{datetime2-sr-Cyrl-RS.ldf})} %\changes{1.0}{2015-03-24}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions, all settings made available to regions so all changes can be % region-specific. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} -\ProvidesDateTimeModule{sr-Cyrl-RS}[2019/11/07 v2.0] +\ProvidesDateTimeModule{sr-Cyrl-RS}[2019/11/11 v2.0.1] % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings loaded from base module. %} -% -% Load base Serbian module. +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% Load appropriate regionless Serbian module. % \begin{macrocode} -\RequireDateTimeModule{serbian-base} +\RequireDateTimeModule{serbianc} % \end{macrocode} % +% +% %\subsubsection{Defining the \sty{sr-Cyrl-RS} style} % -% Allow the user a way of configuring the "srCyrlRS" and -% "srCyrlRS-numeric" styles by providing macros for various format +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Fixed region name error.} +% Allow the user a way of configuring the "sr-Cyrl-RS" and +% "sr-Cyrl-RS-numeric" styles by providing macros for various format % elements. % % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in % case other date formats are also required. % -% %\begin{macro}{\DTMsrCyrlRSdowdaysep} % The separator between weekday and day. % \begin{macrocode} @@ -5358,9 +5476,10 @@ top=3.25cm,bottom=3cm]{geometry} % %\subsubsection{Switches and settings} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} %\begin{macro}{\DTMsrCyrlRSweekdayname} % Define the weekday name, lowercase. % \begin{macrocode} @@ -5378,9 +5497,10 @@ top=3.25cm,bottom=3cm]{geometry} %\end{macro} % % Provide a way to switch between Ekavian and Ijekavian pronunciation. -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch between Ekavian and Ijekavian pronunciation. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} \DTMdefchoicekey{sr-Cyrl-RS}% @@ -5398,10 +5518,11 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch June, July alternate spellings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that can switch between (jun, jul) and (juni, juli) % month spellings. % \begin{macrocode} @@ -5411,10 +5532,11 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-RS}{monthi}{false} % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch for adding leading zeroes in day and month ordinals. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day and month ordinals should % have leading zeroes. % \begin{macrocode} @@ -5425,8 +5547,6 @@ top=3.25cm,bottom=3cm]{geometry} \DTMsetbool{sr-Cyrl-RS}{leadingzero}{false} % \end{macrocode} % -% -% %\begin{macro}{\DTMsrCyrlRSdayordinal} % Define the day ordinal format to be used by this style. % \begin{macrocode} @@ -5444,13 +5564,13 @@ top=3.25cm,bottom=3cm]{geometry} \number#1\DTMsrCyrlRSdatesep}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Removed the option to switch between writing systems, since that is % accomplished by using different regions or regionless styles ("serbian" and % "serbianc" for example). %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define the month names. % %\begin{macro}{\DTMsrCyrlRSnoimonthname} @@ -5476,7 +5596,7 @@ top=3.25cm,bottom=3cm]{geometry} \newcommand*{\DTMsrCyrlRSiMonthname}{\DTMserbiancyriMonthname} % \end{macrocode} %\end{macro} -% +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} @@ -5486,7 +5606,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-RS}{mapzone}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} @@ -5496,7 +5616,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-RS}{showdayofmonth}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} @@ -5506,9 +5626,10 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-RS}{showyear}{true} % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \DTMnewstyle% {sr-Cyrl-RS}% label @@ -5614,11 +5735,12 @@ top=3.25cm,bottom=3cm]{geometry} \DTMifbool{sr-Cyrl-RS}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch between multiple numeric month ordinal formats used in % Serbian. %} +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a setting to switch between Arabic, uppercase Roman and lowercase % smallcaps Roman month format for the "srCyrlRS-numeric" style. % \begin{macrocode} @@ -5639,13 +5761,15 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Fixed the (previously entirely wrong) numeric date style. %} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define numeric style. % \begin{macrocode} \DTMnewstyle% @@ -5728,14 +5852,14 @@ top=3.25cm,bottom=3cm]{geometry} % The time zone mappings are set through this command, which can be % redefined if extra mappings are required or mappings need to be % removed. +%\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.} % \begin{macrocode} -\newcommand*{\DTMsr-Cyrl-RSzonemaps}{% +\newcommand*{\DTMsrCyrlRSzonemaps}{% \DTMdefzonemap{01}{00}{CET}% \DTMdefzonemap{02}{00}{CEST}% } % \end{macrocode} %\end{macro} - % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional% @@ -5743,14 +5867,14 @@ top=3.25cm,bottom=3cm]{geometry} {\DTMsetstyle{sr-Cyrl-RS}}% {\DTMsetstyle{sr-Cyrl-RS-numeric}}% % \end{macrocode} -% % Redefine \cs{dateserbianc} (or \cs{date}\meta{dialect}) to prevent % \sty{babel} from resetting \cs{today}. (For this to work, % \sty{babel} must already have been loaded if it's required.) %\changes{1.1}{2019-09-14}{removed spurious space} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% @@ -5770,8 +5894,11 @@ top=3.25cm,bottom=3cm]{geometry} \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional% {}% do nothing - {\DTMsetstyle{sr-Cyrl-RS}}% - {\DTMsetstyle{sr-Cyrl-RS-numeric}}% +% \end{macrocode} +%\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.} +% \begin{macrocode} + {\DTMsetstyle{serbianc}}% + {\DTMsetstyle{serbianc-numeric}}% }% }% % \end{macrocode} @@ -5791,32 +5918,36 @@ top=3.25cm,bottom=3cm]{geometry} %\subsection{Serbian \sty{sr-Cyrl-ME} Code % (\texttt{datetime2-sr-Cyrl-ME.ldf})} %\changes{1.0}{2015-03-24}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions, all settings made available to regions so all changes can be % region-specific. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} -\ProvidesDateTimeModule{sr-Cyrl-ME}[2019/11/07 v2.0] +\ProvidesDateTimeModule{sr-Cyrl-ME}[2019/11/11 v2.0.1] % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings loaded from base module. %} -% -% Load base Serbian module. +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% Load appropriate regionless Serbian module. % \begin{macrocode} -\RequireDateTimeModule{serbian-base} +\RequireDateTimeModule{serbianc} % \end{macrocode} % +% +% %\subsubsection{Defining the \sty{sr-Cyrl-ME} style} % -% Allow the user a way of configuring the "srCyrlME" and -% "srCyrlME-numeric" styles by providing macros for various format +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Fixed region name error.} +% Allow the user a way of configuring the "sr-Cyrl-ME" and +% "sr-Cyrl-ME-numeric" styles by providing macros for various format % elements. % % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in % case other date formats are also required. % -% %\begin{macro}{\DTMsrCyrlMEdowdaysep} % The separator between weekday and day. % \begin{macrocode} @@ -5891,9 +6022,10 @@ top=3.25cm,bottom=3cm]{geometry} % %\subsubsection{Switches and settings} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} %\begin{macro}{\DTMsrCyrlMEweekdayname} % Define the weekday name, lowercase. % \begin{macrocode} @@ -5911,9 +6043,10 @@ top=3.25cm,bottom=3cm]{geometry} %\end{macro} % % Provide a way to switch between Ekavian and Ijekavian pronunciation. -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch between Ekavian and Ijekavian pronunciation. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} \DTMdefchoicekey{sr-Cyrl-ME}% @@ -5931,10 +6064,11 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch June, July alternate spellings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that can switch between (jun, jul) and (juni, juli) % month spellings. % \begin{macrocode} @@ -5944,10 +6078,11 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-ME}{monthi}{false} % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch for adding leading zeroes in day and month ordinals. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day and month ordinals should % have leading zeroes. % \begin{macrocode} @@ -5958,8 +6093,6 @@ top=3.25cm,bottom=3cm]{geometry} \DTMsetbool{sr-Cyrl-ME}{leadingzero}{false} % \end{macrocode} % -% -% %\begin{macro}{\DTMsrCyrlMEdayordinal} % Define the day ordinal format to be used by this style. % \begin{macrocode} @@ -5977,13 +6110,13 @@ top=3.25cm,bottom=3cm]{geometry} \number#1\DTMsrCyrlMEdatesep}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Removed the option to switch between writing systems, since that is % accomplished by using different regions or regionless styles ("serbian" and % "serbianc" for example). %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define the month names. % %\begin{macro}{\DTMsrCyrlMEnoimonthname} @@ -6009,7 +6142,7 @@ top=3.25cm,bottom=3cm]{geometry} \newcommand*{\DTMsrCyrlMEiMonthname}{\DTMserbiancyriMonthname} % \end{macrocode} %\end{macro} -% +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} @@ -6019,7 +6152,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-ME}{mapzone}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} @@ -6029,7 +6162,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-ME}{showdayofmonth}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} @@ -6039,9 +6172,10 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-ME}{showyear}{true} % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \DTMnewstyle% {sr-Cyrl-ME}% label @@ -6147,11 +6281,12 @@ top=3.25cm,bottom=3cm]{geometry} \DTMifbool{sr-Cyrl-ME}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch between multiple numeric month ordinal formats used in % Serbian. %} +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a setting to switch between Arabic, uppercase Roman and lowercase % smallcaps Roman month format for the "srCyrlME-numeric" style. % \begin{macrocode} @@ -6172,13 +6307,15 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Fixed the (previously entirely wrong) numeric date style. %} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define numeric style. % \begin{macrocode} \DTMnewstyle% @@ -6261,14 +6398,14 @@ top=3.25cm,bottom=3cm]{geometry} % The time zone mappings are set through this command, which can be % redefined if extra mappings are required or mappings need to be % removed. +%\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.} % \begin{macrocode} -\newcommand*{\DTMsr-Cyrl-MEzonemaps}{% +\newcommand*{\DTMsrCyrlMEzonemaps}{% \DTMdefzonemap{01}{00}{CET}% \DTMdefzonemap{02}{00}{CEST}% } % \end{macrocode} %\end{macro} - % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional% @@ -6276,14 +6413,14 @@ top=3.25cm,bottom=3cm]{geometry} {\DTMsetstyle{sr-Cyrl-ME}}% {\DTMsetstyle{sr-Cyrl-ME-numeric}}% % \end{macrocode} -% % Redefine \cs{dateserbianc} (or \cs{date}\meta{dialect}) to prevent % \sty{babel} from resetting \cs{today}. (For this to work, % \sty{babel} must already have been loaded if it's required.) %\changes{1.1}{2019-09-14}{removed spurious space} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% @@ -6303,8 +6440,11 @@ top=3.25cm,bottom=3cm]{geometry} \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional% {}% do nothing - {\DTMsetstyle{sr-Cyrl-ME}}% - {\DTMsetstyle{sr-Cyrl-ME-numeric}}% +% \end{macrocode} +%\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.} +% \begin{macrocode} + {\DTMsetstyle{serbianc}}% + {\DTMsetstyle{serbianc-numeric}}% }% }% % \end{macrocode} @@ -6324,32 +6464,36 @@ top=3.25cm,bottom=3cm]{geometry} %\subsection{Serbian \sty{sr-Cyrl-BA} Code % (\texttt{datetime2-sr-Cyrl-BA.ldf})} %\changes{1.0}{2015-03-24}{Initial release} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions, all settings made available to regions so all changes can be % region-specific. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} -\ProvidesDateTimeModule{sr-Cyrl-BA}[2019/11/07 v2.0] +\ProvidesDateTimeModule{sr-Cyrl-BA}[2019/11/11 v2.0.1] % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % All localization strings loaded from base module. %} -% -% Load base Serbian module. +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% Load appropriate regionless Serbian module. % \begin{macrocode} -\RequireDateTimeModule{serbian-base} +\RequireDateTimeModule{serbianc} % \end{macrocode} % +% +% %\subsubsection{Defining the \sty{sr-Cyrl-BA} style} % -% Allow the user a way of configuring the "srCyrlBA" and -% "srCyrlBA-numeric" styles by providing macros for various format +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Fixed region name error.} +% Allow the user a way of configuring the "sr-Cyrl-BA" and +% "sr-Cyrl-BA-numeric" styles by providing macros for various format % elements. % % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in % case other date formats are also required. % -% %\begin{macro}{\DTMsrCyrlBAdowdaysep} % The separator between weekday and day. % \begin{macrocode} @@ -6424,9 +6568,10 @@ top=3.25cm,bottom=3cm]{geometry} % %\subsubsection{Switches and settings} % -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} %\begin{macro}{\DTMsrCyrlBAweekdayname} % Define the weekday name, lowercase. % \begin{macrocode} @@ -6444,9 +6589,10 @@ top=3.25cm,bottom=3cm]{geometry} %\end{macro} % % Provide a way to switch between Ekavian and Ijekavian pronunciation. -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch between Ekavian and Ijekavian pronunciation. %} + %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % % \begin{macrocode} \DTMdefchoicekey{sr-Cyrl-BA}% @@ -6464,10 +6610,11 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a way to switch June, July alternate spellings. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that can switch between (jun, jul) and (juni, juli) % month spellings. % \begin{macrocode} @@ -6477,10 +6624,11 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-BA}{monthi}{false} % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch for adding leading zeroes in day and month ordinals. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day and month ordinals should % have leading zeroes. % \begin{macrocode} @@ -6491,8 +6639,6 @@ top=3.25cm,bottom=3cm]{geometry} \DTMsetbool{sr-Cyrl-BA}{leadingzero}{false} % \end{macrocode} % -% -% %\begin{macro}{\DTMsrCyrlBAdayordinal} % Define the day ordinal format to be used by this style. % \begin{macrocode} @@ -6510,13 +6656,13 @@ top=3.25cm,bottom=3cm]{geometry} \number#1\DTMsrCyrlBAdatesep}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Removed the option to switch between writing systems, since that is % accomplished by using different regions or regionless styles ("serbian" and % "serbianc" for example). %} -% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define the month names. % %\begin{macro}{\DTMsrCyrlBAnoimonthname} @@ -6542,7 +6688,7 @@ top=3.25cm,bottom=3cm]{geometry} \newcommand*{\DTMsrCyrlBAiMonthname}{\DTMserbiancyriMonthname} % \end{macrocode} %\end{macro} -% +%\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} @@ -6552,7 +6698,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-BA}{mapzone}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} @@ -6562,7 +6708,7 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-BA}{showdayofmonth}{true} % \end{macrocode} -% +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} @@ -6572,9 +6718,10 @@ top=3.25cm,bottom=3cm]{geometry} % \begin{macrocode} \DTMsetbool{sr-Cyrl-BA}{showyear}{true} % \end{macrocode} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \DTMnewstyle% {sr-Cyrl-BA}% label @@ -6680,11 +6827,12 @@ top=3.25cm,bottom=3cm]{geometry} \DTMifbool{sr-Cyrl-BA}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}% % \end{macrocode} %\end{macro} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added a switch between multiple numeric month ordinal formats used in % Serbian. %} +% \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define a setting to switch between Arabic, uppercase Roman and lowercase % smallcaps Roman month format for the "srCyrlBA-numeric" style. % \begin{macrocode} @@ -6705,13 +6853,15 @@ top=3.25cm,bottom=3cm]{geometry} \fi } % \end{macrocode} -% -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Fixed the (previously entirely wrong) numeric date style. %} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +%\changes{2.0.0}{2019-11-07}{% % Added weekday names. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} +% \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.} % Define numeric style. % \begin{macrocode} \DTMnewstyle% @@ -6794,14 +6944,14 @@ top=3.25cm,bottom=3cm]{geometry} % The time zone mappings are set through this command, which can be % redefined if extra mappings are required or mappings need to be % removed. +%\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.} % \begin{macrocode} -\newcommand*{\DTMsr-Cyrl-BAzonemaps}{% +\newcommand*{\DTMsrCyrlBAzonemaps}{% \DTMdefzonemap{01}{00}{CET}% \DTMdefzonemap{02}{00}{CEST}% } % \end{macrocode} %\end{macro} - % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional% @@ -6809,14 +6959,14 @@ top=3.25cm,bottom=3cm]{geometry} {\DTMsetstyle{sr-Cyrl-BA}}% {\DTMsetstyle{sr-Cyrl-BA-numeric}}% % \end{macrocode} -% % Redefine \cs{dateserbianc} (or \cs{date}\meta{dialect}) to prevent % \sty{babel} from resetting \cs{today}. (For this to work, % \sty{babel} must already have been loaded if it's required.) %\changes{1.1}{2019-09-14}{removed spurious space} -%\changes{2.0}{2019-11-07}{% +%\changes{2.0.0}{2019-11-07}{% % Added regions. %} +%\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% @@ -6836,8 +6986,11 @@ top=3.25cm,bottom=3cm]{geometry} \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional% {}% do nothing - {\DTMsetstyle{sr-Cyrl-BA}}% - {\DTMsetstyle{sr-Cyrl-BA-numeric}}% +% \end{macrocode} +%\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.} +% \begin{macrocode} + {\DTMsetstyle{serbianc}}% + {\DTMsetstyle{serbianc-numeric}}% }% }% % \end{macrocode} diff --git a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.pdf b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.pdf Binary files differindex 3f1b8c2768..22091a637a 100644 --- a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.pdf +++ b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.pdf diff --git a/macros/latex/contrib/datetime2/CHANGES b/macros/latex/contrib/datetime2/CHANGES index e25ea54492..a357d7f4af 100644 --- a/macros/latex/contrib/datetime2/CHANGES +++ b/macros/latex/contrib/datetime2/CHANGES @@ -1,3 +1,9 @@ +1.5.5 (2019-11-11): + + * added check for \TrackIfKnownLanguage (provided by tracklang v1.3.9) + + * added \DTMfinaldot and starred versions of \DTMdate and \DTMDate + 1.5.4 (2019-10-21): * renamed scratch variables to avoid conflict diff --git a/macros/latex/contrib/datetime2/README b/macros/latex/contrib/datetime2/README index 6e9b85f4f1..bb49d1d676 100644 --- a/macros/latex/contrib/datetime2/README +++ b/macros/latex/contrib/datetime2/README @@ -1,6 +1,6 @@ -LaTeX Package : datetime2 v1.5.4 +LaTeX Package : datetime2 v1.5.5 -Last Modified : 2019-10-21 +Last Modified : 2019-11-11 Author : Nicola Talbot diff --git a/macros/latex/contrib/datetime2/datetime2.dtx b/macros/latex/contrib/datetime2/datetime2.dtx index 401236b8d0..75c965671f 100644 --- a/macros/latex/contrib/datetime2/datetime2.dtx +++ b/macros/latex/contrib/datetime2/datetime2.dtx @@ -1,13 +1,13 @@ %\iffalse % datetime2.dtx generated using makedtx version 1.2 (c) Nicola Talbot % Command line args: -% -src "datetime2.sty\Z=>datetime2.sty" -% -src "datetime2-calc.sty\Z=>datetime2-calc.sty" +% -author "Nicola Talbot" % -doc "datetime2-manual.tex" % -section "chapter" -% -author "Nicola Talbot" +% -src "datetime2.sty\Z=>datetime2.sty" +% -src "datetime2-calc.sty\Z=>datetime2-calc.sty" % datetime2 -% Created on 2019/10/21 11:37 +% Created on 2019/11/11 18:31 %\fi %\iffalse %<*package> @@ -47,7 +47,7 @@ pdfauthor={Nicola L.C. Talbot}, pdftitle={datetime2: date and time formats}]{hyperref} -\CheckSum{2622} +\CheckSum{2658} \RecordChanges \DisableCrossrefs @@ -91,11 +91,11 @@ % %\MakeShortVerb{"} % -%\title{datetime2 v1.5.4: +%\title{datetime2 v1.5.5: %date and time formats} %\author{Nicola L. C. Talbot\\\url{http://www.dickimaw-books.com/}} % -%\date{2019-10-21} +%\date{2019-11-11} %\maketitle % %\begin{abstract} @@ -399,6 +399,12 @@ %this is to first save the date and then use it (see %\sectionref{sec:store}). % +%Some regional styles may end the date with a period (full stop). +%This can cause a problem if the date occurs at the end of a +%sentence. If the style has used \cs{DTMfinaldot} then you can use +%\cs{DTMdate*} to suppress the terminating period if required. (See +%below.) +% %Examples (with the \pkgopt{showdow} package option set): %\begin{itemize} %\item Ignore day of week: @@ -531,7 +537,30 @@ %\begin{definition}[\DescribeMacro\DTMDate] %\cs{DTMDate}\marg{date} %\end{definition} -%In these cases the date should be provided as +%As from v1.5.5 there are also starred versions of these commands: +%\begin{definition}[\DescribeMacro{\DTMdate*}] +%\cs{DTMdate*}\marg{date} +%\end{definition} +%which essentially behaves like: +%\begin{display} +%\string{\cs{let}\cs{DTMfinaldot}\cs{empty}\cs{DTMdate}\marg{date}\string} +%\end{display} +%and +%\begin{definition}[\DescribeMacro{\DTMDate*}] +%\cs{DTMDate*}\marg{date} +%\end{definition} +%which essentially behaves like: +%\begin{display} +%\string{\cs{let}\cs{DTMfinaldot}\cs{empty}\cs{DTMDate}\marg{date}\string} +%\end{display} +%These commands are provided for date styles that use +%\cs{DTMfinaldot} to produce a period (full stop) at the end of the date. These +%two star-commands may be used at the end of a sentence to prevent +%a double period. Note that there is no equivalent starred form of +%\cs{DTMdisplaydate} or \cs{DTMDisplaydate}. (It would break their +%ability to fully expand, which was their principle design feature.) +% +%In these cases (starred and unstarred) the date should be provided as %\meta{YYYY}\texttt{-}\meta{MM}\texttt{-}\meta{DD} in the argument %\meta{date}. For example: %\begin{verbatim} @@ -1300,7 +1329,17 @@ %\end{definition} %This defines a \term{partial style} that should only modify %\cs{DTMdisplaydate} and \cs{DTMDisplaydate}. The redefinition of -%these commands should be placed in \meta{definition}. +%these commands should be placed in \meta{definition}. If the date +%should end with a period (full stop) use: +%\begin{definition}[\DescribeMacro\DTMfinaldot] +%\cs{DTMfinaldot} +%\end{definition} +%at the end of the definitions of \cs{DTMdisplaydate} and +%\cs{DTMDisplaydate}. +% +%This command is simply defined as ``\texttt{.}'' but it's locally +%redefined to do nothing by the starred versions of \cs{DTMdate} and +%\cs{DTMDate} allowing the dot to be discarded. % %A new \term{time style} can be defined using: %\begin{definition}[\DescribeMacro\DTMnewtimestyle] @@ -1608,6 +1647,14 @@ %the currently selected date style. %\end{important} % +%The document languages are detected using \sty{tracklang}'s +%interface. This has limitations. In particular, it can't detect the +%region with \sty{polyglossia} nor can it detect languages specified +%after \sty{tracklang} has been loaded, and it can't pick up \sty{babel}'s new +%\cs{babelprovide} command. See the \sty{tracklang} documentation for +%further details. Please check that you have an up-to-date version of +%\sty{tracklang}. +% %Each language module defines a textual style (where the month is %displayed as a word) for that language or region %which can be used in the argument of \cs{DTMsetstyle}, @@ -1675,7 +1722,7 @@ %\usepackage[en-GB,en-CA]{datetime2} %\begin{document} %\DTMsetstyle{en-GB}\today. -%\DTMsetstyle{en-CA}\today +%\DTMsetstyle{en-CA}\today. %\end{document} %\end{verbatim} % @@ -5686,7 +5733,7 @@ %\changes{1.0}{2015-03-24}{Initial release} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datetime2}[2019/10/21 v1.5.4 (NLCT) date and time formats] +\ProvidesPackage{datetime2}[2019/11/11 v1.5.5 (NLCT) date and time formats] % \end{macrocode} % Use \sty{tracklang} to find out what languages have been loaded. % \begin{macrocode} @@ -6100,16 +6147,33 @@ % This will automatically switch the "useregional" setting to % \texttt{text}. %\changes{1.3}{2016-01-22}{added predefined dialect test} +%\changes{1.5.5}{2019-11-11}{add check for \cs{TrackIfKnownLanguage}} % \begin{macrocode} \DeclareOptionX*{% \ifcsundef{@tracklang@add@\CurrentOption}% {% - \PackageError{datetime2}{`\CurrentOption' is not a recognised dialect. - \MessageBreak Perhaps you have misspelt it or the - \MessageBreak named dialect may be unsupported or - \MessageBreak perhaps you forgot to use the `style' key}% - {Any options that aren't described in the manual are assumed - \MessageBreak to be language or dialect names.}% + \ifundef\TrackIfKnownLanguage + {% + \PackageError{datetime2}{Unrecognised dialect `\CurrentOption'. + If you are using a valid ISO language code + please update tracklang.sty to at least v1.3.9}% + {Any options that aren't described in the manual are assumed + \MessageBreak to be language or dialect names.}% + }% + {% + \TrackIfKnownLanguage{\CurrentOption}% + {\renewcommand*{\DTMifcaseregional}[3]{#2}}% + {% + \PackageError{datetime2}{`\CurrentOption' is not a recognised dialect + \MessageBreak and doesn't contain a known language code. + \MessageBreak Perhaps you have misspelt it or the + \MessageBreak named dialect may be unsupported or + \MessageBreak perhaps you forgot the `<key>=' part + \MessageBreak for example, `style=\CurrentOption'}% + {Any options that aren't described in the manual are assumed + \MessageBreak to be language or dialect names.}% + }% + }% }% {% \TrackPredefinedDialect{\CurrentOption}% @@ -6585,29 +6649,83 @@ % \end{macrocode} %\end{macro} % +%\begin{macro}{\DTMfinaldot} +%\changes{1.5.5}{2019-11-11}{new} +%Some date styles require the date to end with a period (full stop). +%These styles should use \cs{DTLfinaldot} for the terminating +%period. This allows the starred version of \cs{DTMdate} to +%locally redefine this command to do nothing when the date is +%required at the end of a sentence. +% \begin{macrocode} +\newcommand*{\DTMfinaldot}{.} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTMdate} % Display date where date is specified in the format %\meta{yyyy}-\meta{mm}-\meta{dd}. Use \cs{expandafter} in case %argument is a control sequence containing the date. -% This command isn't expandable +%This command isn't expandable. This now has a starred version that +%locally redefines \cs{DTMfinaldot} to do nothing. +%\changes{1.5.5}{2019-11-11}{added starred version} +% \begin{macrocode} +\newrobustcmd*{\DTMdate}{\@ifstar\@sDTMdate\@DTMdate} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@DTMdate} +%\changes{1.5.5}{2019-11-11}{new} % \begin{macrocode} -\newrobustcmd*{\DTMdate}[1]{% +\newcommand*{\@DTMdate}[1]{% \expandafter\@dtm@parsedate#1\@dtm@endparsedate \DTMdisplaydate{\@dtm@year}{\@dtm@month}{\@dtm@day}{\@dtm@dow}% } % \end{macrocode} %\end{macro} % +%\begin{macro}{\@sDTMdate} +%\changes{1.5.5}{2019-11-11}{new} +% \begin{macrocode} +\newcommand*{\@sDTMdate}[1]{% + {% + \let\DTMfinaldot\empty + \@DTMdate{#1}% + }% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTMDate} -% Upper case version. +% Upper case version. This now has a starred version that +%locally redefines \cs{DTMfinaldot} to do nothing. +%\changes{1.5.5}{2019-11-11}{added starred version} +% \begin{macrocode} +\newrobustcmd*{\DTMDate}{\@ifstar\@sDTMDate\@DTMDate} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@sDTMDate} +%\changes{1.5.5}{2019-11-11}{new} % \begin{macrocode} -\newrobustcmd*{\DTMDate}[1]{% +\newcommand*{\@DTMDate}[1]{% \expandafter\@dtm@parsedate#1\@dtm@endparsedate \DTMDisplaydate{\@dtm@year}{\@dtm@month}{\@dtm@day}{\@dtm@dow}% } % \end{macrocode} %\end{macro} % +%\begin{macro}{\@sDTMDate} +%\changes{1.5.5}{2019-11-11}{new} +% \begin{macrocode} +\newcommand*{\@sDTMDate}[1]{% + {% + \let\DTMfinaldot\empty + \@DTMDate{#1}% + }% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTMcurrenttime} % Display the current time. % \begin{macrocode} @@ -8862,7 +8980,7 @@ %\section{datetime2-calc.sty code} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datetime2-calc}[2019/10/21 v1.5.4 (NLCT)] +\ProvidesPackage{datetime2-calc}[2019/11/11 v1.5.5 (NLCT)] % \end{macrocode} % Load other required packages % \begin{macrocode} diff --git a/macros/latex/contrib/datetime2/datetime2.ins b/macros/latex/contrib/datetime2/datetime2.ins index d839777cd7..b7c5abb20c 100644 --- a/macros/latex/contrib/datetime2/datetime2.ins +++ b/macros/latex/contrib/datetime2/datetime2.ins @@ -1,4 +1,4 @@ -% datetime2.ins generated using makedtx version 1.2 2019/10/21 11:37 +% datetime2.ins generated using makedtx version 1.2 2019/11/11 18:31 \input docstrip \preamble diff --git a/macros/latex/contrib/datetime2/datetime2.pdf b/macros/latex/contrib/datetime2/datetime2.pdf Binary files differindex e356981288..15d428a37e 100644 --- a/macros/latex/contrib/datetime2/datetime2.pdf +++ b/macros/latex/contrib/datetime2/datetime2.pdf diff --git a/macros/latex/contrib/datetime2/samples/datetime2-sample-babel.pdf b/macros/latex/contrib/datetime2/samples/datetime2-sample-babel.pdf Binary files differindex f0c400e808..bbddda8f9f 100644 --- a/macros/latex/contrib/datetime2/samples/datetime2-sample-babel.pdf +++ b/macros/latex/contrib/datetime2/samples/datetime2-sample-babel.pdf diff --git a/macros/latex/contrib/datetime2/samples/datetime2-sample-calc.pdf b/macros/latex/contrib/datetime2/samples/datetime2-sample-calc.pdf Binary files differindex 2fb24bf61e..e6cf98dc88 100644 --- a/macros/latex/contrib/datetime2/samples/datetime2-sample-calc.pdf +++ b/macros/latex/contrib/datetime2/samples/datetime2-sample-calc.pdf diff --git a/macros/latex/contrib/datetime2/samples/datetime2-sample-filedate.pdf b/macros/latex/contrib/datetime2/samples/datetime2-sample-filedate.pdf Binary files differindex d4c34cdf2f..269dff73fa 100644 --- a/macros/latex/contrib/datetime2/samples/datetime2-sample-filedate.pdf +++ b/macros/latex/contrib/datetime2/samples/datetime2-sample-filedate.pdf diff --git a/macros/latex/contrib/datetime2/samples/datetime2-sample-hyperref.pdf b/macros/latex/contrib/datetime2/samples/datetime2-sample-hyperref.pdf Binary files differindex 1236d2fc42..afbbe3c743 100644 --- a/macros/latex/contrib/datetime2/samples/datetime2-sample-hyperref.pdf +++ b/macros/latex/contrib/datetime2/samples/datetime2-sample-hyperref.pdf diff --git a/macros/latex/contrib/datetime2/samples/datetime2-sample-journal.pdf b/macros/latex/contrib/datetime2/samples/datetime2-sample-journal.pdf Binary files differindex be21e3c7ac..4c01455430 100644 --- a/macros/latex/contrib/datetime2/samples/datetime2-sample-journal.pdf +++ b/macros/latex/contrib/datetime2/samples/datetime2-sample-journal.pdf diff --git a/macros/latex/contrib/datetime2/samples/datetime2-sample-styles.pdf b/macros/latex/contrib/datetime2/samples/datetime2-sample-styles.pdf Binary files differindex 3ed5e296f3..cac832cd51 100644 --- a/macros/latex/contrib/datetime2/samples/datetime2-sample-styles.pdf +++ b/macros/latex/contrib/datetime2/samples/datetime2-sample-styles.pdf diff --git a/macros/latex/contrib/datetime2/samples/datetime2-sample-xe.pdf b/macros/latex/contrib/datetime2/samples/datetime2-sample-xe.pdf Binary files differindex 2e485f20ca..7a78c01c36 100644 --- a/macros/latex/contrib/datetime2/samples/datetime2-sample-xe.pdf +++ b/macros/latex/contrib/datetime2/samples/datetime2-sample-xe.pdf diff --git a/macros/latex/contrib/grffile/README.md b/macros/latex/contrib/grffile/README.md index 07bb144047..0bc4f41623 100644 --- a/macros/latex/contrib/grffile/README.md +++ b/macros/latex/contrib/grffile/README.md @@ -15,4 +15,4 @@ to use the original version of this package (grffile-2017-06-30.sty). tex grffile.dtx -will extract graphics.sty and grffile-2017-06-30.sty
\ No newline at end of file +will extract grffile.sty and grffile-2017-06-30.sty
\ No newline at end of file diff --git a/macros/latex/contrib/grffile/grffile.dtx b/macros/latex/contrib/grffile/grffile.dtx index d2cb7da671..a9016f41dc 100644 --- a/macros/latex/contrib/grffile/grffile.dtx +++ b/macros/latex/contrib/grffile/grffile.dtx @@ -136,7 +136,7 @@ and the derived files \Msg{*} \Msg{* grffile.sty} \Msg{*} -\Msg{* To produce the documentation run the file `grffile.drv'} +\Msg{* To produce the documentation run the file `grffile.dtx'} \Msg{* through LaTeX.} \Msg{*} \Msg{* Happy TeXing!} @@ -410,10 +410,12 @@ and the derived files % \begin{macrocode} %<*new> \DeclareRelease{v1}{2017-06-30}{grffile-2017-06-30.sty} -\DeclareCurrentRelease{}{2019-11-03} +\DeclareCurrentRelease{}{2019-11-11} \ProvidesPackage{grffile}% - [2019/11/03 v2.0 Extended file name support for graphics (legacy)]% + [2019/11/11 v2.1 Extended file name support for graphics (legacy)]% \PackageInfo{grffile}{This package is an empty stub for compatibility} +\DeclareOption*{} +\ProcessOptions \RequirePackage{graphicx} %</new> % \end{macrocode} diff --git a/macros/latex/contrib/grffile/grffile.pdf b/macros/latex/contrib/grffile/grffile.pdf Binary files differindex 7a7dae93b9..6bd169733c 100644 --- a/macros/latex/contrib/grffile/grffile.pdf +++ b/macros/latex/contrib/grffile/grffile.pdf diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf Binary files differindex d86a56a2c5..a9c1b2a350 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex index c9980ab829..12d403c379 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.tex +++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex @@ -1192,9 +1192,9 @@ $\begin{pNiceMatrix} \section{Les matrices par blocs} Dans les environnements de \pkg{nicematrix}, on peut utiliser la commande |\Block| pour placer un élément au centre -d'un rectangle de cellules fusionnées. +d'un rectangle de cases fusionnées. -La commande |\Block| doit être utilisée dans la cellule supérieure gauche du bloc avec deux arguments. Le premier +La commande |\Block| doit être utilisée dans la case supérieure gauche du bloc avec deux arguments. Le premier argument est la taille de ce bloc avec la syntaxe $i$-$j$ où $i$ est le nombre de rangées et $j$ le nombre de colonnes du bloc. Le deuxième argument, est, sans surprise, le contenu du bloc (en mode mathématique). @@ -1303,9 +1303,10 @@ En fait, l'option |small| correspond aux réglages suivants : \section{Les compteurs iRow et jCol} Dans les cases du tableau, il est possible d'utiliser les compteurs LaTeX |iRow| et |jCol| qui représentent le -numéro de la rangée courante et le numéro de la colonne courante\footnote{On rappelle que la «permière rangée» (si - elle existe) est $0$ et que le numéro de la «première colonne» (si elle existe) est $0$ également.}. Bien entendu, -l'utilisateur ne doit pas modifier les valeurs de ces compteurs qui sont utilisés en interne par \pkg{nicematrix}. +numéro de la rangée courante et le numéro de la colonne courante\footnote{On rappelle que le numéro de la «première + rangée» (si elle existe) est $0$ et que le numéro de la «première colonne» (si elle existe) est $0$ également.}. +Bien entendu, l'utilisateur ne doit pas modifier les valeurs de ces compteurs qui sont utilisés en interne par +\pkg{nicematrix}. \medskip \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -1336,6 +1337,23 @@ Si des compteurs LaTeX nommés |iRow| ou |jCol| sont créés dans le document pa \pkg{nicematrix}. +\bigskip +L'extension \pkg{nicematrix} propose aussi des commandes pour composer automatiquement des matrices à partir d'un +motif général. Ces commandes sont nommées |\pAutoNiceMatrix|, |\bAutoNiceMatrix|, |\vAutoNiceMatrix|, +|\VAutoNiceMatrix| et |\BAutoNiceMatrix|. + +Chacune de ces commandes prend deux arguments obligatoires : le premier est la taille de la matrice, sous la forme +$n$-$p$, où $n$ est le nombre de lignes et $p$ est le nombre de colonnes et le deuxième est le motif (c'est-à-dire +simplement des tokens qui seront insérés dans chaque case de la matrice, exceptées celles des éventuelles lignes et +colonnes extérieures). + +\medskip +\begin{Verbatim} +$C = ~emphase#\pAutoNiceMatrix@{3-3}{C_{\arabic{iRow},\arabic{jCol}}}$ +\end{Verbatim} + + +$C = \pAutoNiceMatrix{3-3}{C_{\arabic{iRow},\arabic{jCol}}}$ \section{L'option hlines} diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx index 4f3effcd14..5aa6211092 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.dtx +++ b/macros/latex/contrib/nicematrix/nicematrix.dtx @@ -15,8 +15,8 @@ % % \fi % \iffalse -\def\myfileversion{3.6} -\def\myfiledate{2019/10/29} +\def\myfileversion{3.7} +\def\myfiledate{2019/11/11} % % %<*batchfile> @@ -1362,11 +1362,11 @@ c & c & b & a & e % \section{The counters iRow and jCol} % % In the cells of the array, it's possible to use the LaTeX counters |iRow| and -% |jCol| which represents the number of the current row and the number of the +% |jCol| which represent the number of the current row and the number of the % current col\footnote{We recall that the first row (if it exists) has the -% number~$0$ and that the first col (if it exists) has also the number~$0$).}. Of -% course, the user must not change the value of the these counters which are -% used internally by \pkg{nicematrix}. +% number~$0$ and that the first col (if it exists) has also the number~$0$).}. +% Of course, the user must not change the value of these counters which are used +% internally by \pkg{nicematrix}. % % \medskip % \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -1391,10 +1391,30 @@ c & c & b & a & e % & 9 & 10 & 11 & 12 % \end{pNiceMatrix}$ % -% \smallskip +% \medskip % If LaTeX counters called |iRow| and |jCol| are defined in the document by % extensions other than \pkg{nicematrix} (or by the user), they are shadowed in -% the environements of \pkg{nicematrix}. +% the environments of \pkg{nicematrix}. +% +% \bigskip +% The extension \pkg{nicematrix} also provides commands in order to compose +% automatically matrices from a general pattern. These commands are +% |\pAutoNiceMatrix|, |\bAutoNiceMatrix|, |\vAutoNiceMatrix|, +% |\VAutoNiceMatrix| and |\BAutoNiceMatrix|. +% +% These commands take two mandatory arguments. The first is the format of the +% matrix, with the syntax $n$-$p$ where $n$ is the number of rows and $p$ the +% number of columns. The second argument is the pattern (it's a list of tokens +% which are inserted in each cell of the constructed matrix, excepted in the +% cells of the eventual exterior rows and columns). +% +% \medskip +% \begin{Verbatim} +% $C = ~emphase#\pAutoNiceMatrix@{3-3}{C_{\arabic{iRow},\arabic{jCol}}}$ +% \end{Verbatim} +% +% +% $C = \pAutoNiceMatrix{3-3}{C_{\arabic{iRow},\arabic{jCol}}}$ % % \section{The option hlines} % @@ -2615,7 +2635,8 @@ c & c & b & a & e % \end{macrocode} % % \bigskip -% The name of the current environment (will be used only in the error messages). +% The name of the current environment or the current command (will be used only +% in the error messages). % \begin{macrocode} \str_new:N \g_@@_type_env_str % \end{macrocode} @@ -3004,11 +3025,11 @@ c & c & b & a & e columns-width .value_required:n = true , name .code:n = \unless \ifmeasuring@ - \str_set:Nn \l_tmpa_str { #1 } - \seq_if_in:NVTF \g_@@_names_seq \l_tmpa_str - { \@@_error:nn { Duplicate~name } { #1 } } - { \seq_gput_left:NV \g_@@_names_seq \l_tmpa_str } - \str_set_eq:NN \l_@@_name_str \l_tmpa_str + \str_set:Nn \l_tmpa_str { #1 } + \seq_if_in:NVTF \g_@@_names_seq \l_tmpa_str + { \@@_error:nn { Duplicate~name } { #1 } } + { \seq_gput_left:NV \g_@@_names_seq \l_tmpa_str } + \str_set_eq:NN \l_@@_name_str \l_tmpa_str \fi , name .value_required:n = true , code-after .tl_gset:N = \g_@@_code_after_tl , @@ -3815,7 +3836,10 @@ c & c & b & a & e \NewDocumentEnvironment { NiceArrayWithDelims } { m m O { } m ! O { } } { \str_if_empty:NT \g_@@_type_env_str - { \str_gset:Nn \g_@@_type_env_str { NiceArrayWithDelims } } + { + \str_gset:Nn \g_@@_type_env_str + { environment ~ { NiceArrayWithDelims } } + } \@@_adapt_S_column: \@@_test_if_math_mode: \bool_if:NT \l_@@_in_env_bool { \@@_fatal:n { Yet~in~env } } @@ -4231,7 +4255,21 @@ c & c & b & a & e \hbox_set:Nw \l_tmpa_box \c_math_toggle_token \bool_if:NT \l_@@_small_bool \scriptstyle - \int_compare:nNnT \c@iRow > \c_zero_int \l_@@_code_for_first_col_tl +% \end{macrocode} +% We insert |\l_@@_code_for_first_col_tl|... but we don't insert it in the +% potential ``first row'' and in the potential ``last row''. +% \begin{macrocode} + \bool_if:nT + { + \int_compare_p:nNn \c@iRow > \c_zero_int + && + ( + \int_compare_p:nNn \l_@@_last_row_int < 0 + || + \int_compare_p:nNn \c@iRow < \l_@@_last_row_int + ) + } + { \l_@@_code_for_first_col_tl } } l < @@ -4314,7 +4352,21 @@ c & c & b & a & e \hbox_set:Nw \l_tmpa_box \c_math_toggle_token \bool_if:NT \l_@@_small_bool \scriptstyle - \l_@@_code_for_last_col_tl +% \end{macrocode} +% We insert |\l_@@_code_for_last_col_tl|... but we don't insert it in the +% potential ``first row'' and in the potential ``last row''. +% \begin{macrocode} + \bool_if:nT + { + \int_compare_p:nNn \c@iRow > \c_zero_int + && + ( + \int_compare_p:nNn \l_@@_last_row_int < 0 + || + \int_compare_p:nNn \c@iRow < \l_@@_last_row_int + ) + } + { \l_@@_code_for_last_col_tl } } l < @@ -4385,7 +4437,7 @@ c & c & b & a & e { \bool_set_true:N \l_@@_NiceArray_bool \str_if_empty:NT \g_@@_type_env_str - { \str_gset:Nn \g_@@_type_env_str { NiceArray } } + { \str_gset:Nn \g_@@_type_env_str { environment ~ { NiceArray } } } % \end{macrocode} % We put . and . for the delimiters but, in fact, that doesn't matter because % these arguments won't be used in |{NiceArrayWithDelims}| (because the flag @@ -4405,7 +4457,7 @@ c & c & b & a & e \NewDocumentEnvironment { pNiceArray } { } { \str_if_empty:NT \g_@@_type_env_str - { \str_gset:Nn \g_@@_type_env_str { pNiceArray } } + { \str_gset:Nn \g_@@_type_env_str { environment ~ { pNiceArray } } } \@@_test_if_math_mode: \NiceArrayWithDelims ( ) } @@ -4416,7 +4468,7 @@ c & c & b & a & e \NewDocumentEnvironment { bNiceArray } { } { \str_if_empty:NT \g_@@_type_env_str - { \str_gset:Nn \g_@@_type_env_str { NiceArray } } + { \str_gset:Nn \g_@@_type_env_str { environment ~ { bNiceArray } } } \@@_test_if_math_mode: \NiceArrayWithDelims [ ] } @@ -4427,18 +4479,18 @@ c & c & b & a & e \NewDocumentEnvironment { BNiceArray } { } { \str_if_empty:NT \g_@@_type_env_str - { \str_gset:Nn \g_@@_type_env_str { BNiceArray } } + { \str_gset:Nn \g_@@_type_env_str { environment ~ { BNiceArray } } } \@@_test_if_math_mode: \NiceArrayWithDelims \{ \} } { \endNiceArrayWithDelims } -% \end{macrocode} +% \end{macrocode} % % \begin{macrocode} \NewDocumentEnvironment { vNiceArray } { } { \str_if_empty:NT \g_@@_type_env_str - { \str_gset:Nn \g_@@_type_env_str { vNiceArray } } + { \str_gset:Nn \g_@@_type_env_str { environment ~ { vNiceArray } } } \@@_test_if_math_mode: \NiceArrayWithDelims | | } @@ -4449,7 +4501,7 @@ c & c & b & a & e \NewDocumentEnvironment { VNiceArray } { } { \str_if_empty:NT \g_@@_type_env_str - { \str_gset:Nn \g_@@_type_env_str { VNiceArray } } + { \str_gset:Nn \g_@@_type_env_str { environment ~ { VNiceArray } } } \@@_test_if_math_mode: \NiceArrayWithDelims \| \| } @@ -4464,7 +4516,7 @@ c & c & b & a & e { \NewDocumentEnvironment { #1 NiceMatrix } { ! O { } } { - \str_gset:Nn \g_@@_type_env_str { #1 NiceMatrix } + \str_gset:Nn \g_@@_type_env_str { environment ~ { #1 NiceMatrix } } \keys_set:nn { NiceMatrix / NiceMatrix } { ##1 } \begin { #1 NiceArray } { @@ -5742,8 +5794,37 @@ c & c & b & a & e % In the |code-after|, the command |\@@_line:nn| will be linked to |\line|. This % command takes two arguments which are the specification of two cells in the % array (in the format $i$-$j$) and draws a dotted line between these cells. +% +% \medskip +% First, we write a command with an argument of the format $i$-$j$ and applies +% the command |\int_eval:n| to $i$ and~$j$ ; this must \emph{not} be protected +% (and is, of course fully expandable).\footnote{Indeed, we want that the user +% may use the command |\line| in |code-after| with LaTeX counters in the +% arguments --- with the command |\value|.} +% \begin{macrocode} +\cs_new:Npn \@@_double_int_eval:n #1-#2 \q_stop + { \int_eval:n { #1 } - \int_eval:n { #2 } } +% \end{macrocode} +% +% \medskip +% With the following construction, the command |\@@_double_int_eval:n| is +% applied to both arguments before the application of |\@@_line_i:nn| (the +% construction uses the fact the |\@@_line_i:nn| is protected and that +% |\@@_double_int_eval:n| is fully expandable). % \begin{macrocode} -\cs_new_protected:Nn \@@_line:nn +\cs_new_protected:Npn \@@_line:nn #1 #2 + { + \use:x + { + \@@_line_i:nn + { \@@_double_int_eval:n #1 \q_stop } + { \@@_double_int_eval:n #2 \q_stop } + } + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new_protected:Nn \@@_line_i:nn { \bool_if:NF \c_@@_draft_bool { @@ -5761,13 +5842,13 @@ c & c & b & a & e } { \begin { tikzpicture } - \path~(#1)~--~(#2)~node[at~start]~(i)~{}~node[at~end]~(f)~{} ; - \tikz@parse@node \pgfutil@firstofone ( i ) - \dim_gset:Nn \g_@@_x_initial_dim \pgf@x - \dim_gset:Nn \g_@@_y_initial_dim \pgf@y - \tikz@parse@node \pgfutil@firstofone ( f ) - \dim_gset:Nn \g_@@_x_final_dim \pgf@x - \dim_gset:Nn \g_@@_y_final_dim \pgf@y + \path~(#1)~--~(#2)~node[at~start]~(i)~{}~node[at~end]~(f)~{} ; + \tikz@parse@node \pgfutil@firstofone ( i ) + \dim_gset:Nn \g_@@_x_initial_dim \pgf@x + \dim_gset:Nn \g_@@_y_initial_dim \pgf@y + \tikz@parse@node \pgfutil@firstofone ( f ) + \dim_gset:Nn \g_@@_x_final_dim \pgf@x + \dim_gset:Nn \g_@@_y_final_dim \pgf@y \end { tikzpicture } \@@_draw_tikz_line: } @@ -6403,9 +6484,7 @@ c & c & b & a & e % command |\multicolumn|. % \begin{macrocode} \NewExpandableDocumentCommand \@@_Block: { m D < > { } m } - { - \@@_Block_i #1 \q_stop { #2 } { #3 } - } + { \@@_Block_i #1 \q_stop { #2 } { #3 } } % \end{macrocode} % % \medskip @@ -6413,10 +6492,7 @@ c & c & b & a & e % It must be of the form $i$|-|$j$ where $i$ and $j$ are the size (in rows and % columns) of the block. % \begin{macrocode} -\cs_new:Npn \@@_Block_i #1-#2 \q_stop - { - \@@_Block_ii:nnnn { #1 } { #2 } - } +\cs_new:Npn \@@_Block_i #1-#2 \q_stop { \@@_Block_ii:nnnn { #1 } { #2 } } % \end{macrocode} % % \medskip @@ -6520,7 +6596,7 @@ c & c & b & a & e } % \end{macrocode} % -% % \subsection{How to draw the dotted lines transparently} +% \subsection{How to draw the dotted lines transparently} % \begin{macrocode} \cs_set_protected:Npn \@@_renew_matrix: { @@ -6543,7 +6619,75 @@ c & c & b & a & e % \end{macrocode} % % +% \medskip +% \subsection{Automatic arrays} +% +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_set_size:n #1-#2 \q_stop + { + \int_set:Nn \l_@@_nb_rows_int { #1 } + \int_set:Nn \l_@@_nb_cols_int { #2 } + } +% \end{macrocode} +% % +% \begin{macrocode} +\NewDocumentCommand \AutoNiceMatrixWithDelims { m m O { } m O { } m ! O { } } + { + \int_zero_new:N \l_@@_nb_rows_int + \int_zero_new:N \l_@@_nb_cols_int + \@@_set_size:n #4 \q_stop + \begin { NiceArrayWithDelims } { #1 } { #2 } + { * { \l_@@_nb_cols_int } { C } } [ #3 , #5 , #7 ] + \int_compare:nNnT \l_@@_first_row_int = \c_zero_int + { + \int_compare:nNnT \l_@@_first_col_int = \c_zero_int { & } + \prg_replicate:nn { \l_@@_nb_cols_int - 1 } { & } + \int_compare:nNnT \l_@@_last_col_int > { -1 } { & } \\ + } + \prg_replicate:nn \l_@@_nb_rows_int + { + \int_compare:nNnT \l_@@_first_col_int = \c_zero_int { & } +% \end{macrocode} +% You put |{ }| before |#6| to avoid a hasty expansion of an eventual +% |\arabic{iRow}| at the beginning of the row which would result in an incorrect +% value of that |iRow| (since |iRow| is incremented in the first cell of the row +% of the |\halign|). +% \begin{macrocode} + \prg_replicate:nn { \l_@@_nb_cols_int - 1 } { { } #6 & } #6 + \int_compare:nNnT \l_@@_last_col_int > { -1 } { & } \\ + } + \int_compare:nNnT \l_@@_last_row_int > { -2 } + { + \int_compare:nNnT \l_@@_first_col_int = \c_zero_int { & } + \prg_replicate:nn { \l_@@_nb_cols_int - 1 } { & } + \int_compare:nNnT \l_@@_last_col_int > { -1 } { & } \\ + } + \end { NiceArrayWithDelims } + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_set_protected:Npn \@@_define_com:nnn #1 #2 #3 + { + \cs_set_protected:cpn { #1 AutoNiceMatrix } + { + \str_gset:Nx \g_@@_type_env_str + { command ~ \c_backslash_str #1 AutoNiceMatrix } + \AutoNiceMatrixWithDelims { #2 } { #3 } + } + } +% \end{document} +% \begin{macrocode} +\@@_define_com:nnn p ( ) +\@@_define_com:nnn b [ ] +\@@_define_com:nnn v | | +\@@_define_com:nnn V \| \| +\@@_define_com:nnn B \{ \} +% \end{macrocode} +% +% \medskip % \subsection{We process the options} % % We process the options when the package is loaded (with |\usepackage|) but we @@ -6584,9 +6728,8 @@ c & c & b & a & e % \begin{macrocode} \@@_msg_new:nn { last-col~non~empty~for~NiceArray } { - In~the~environment~\{\g_@@_type_env_str\},~you~must~use~the~option~ - 'last-col'~without~value~(the~number~of~columns~is~known~by~the~ - preamble~of~the~environment).\\ + In~the~\g_@@_type_env_str,~you~must~use~the~option~ + 'last-col'~without~value.\\ However,~you~can~go~on~for~this~time~ (the~value~'\l_keys_value_tl'~will~be~ignored). } @@ -6595,7 +6738,7 @@ c & c & b & a & e % \begin{macrocode} \@@_msg_new:nn { last-col~empty~for~NiceMatrix } { - In~the~environment~\{\g_@@_type_env_str\}~you~can't~use~the~option~ + In~the~\g_@@_type_env_str, you~can't~use~the~option~ 'last-col'~without~value.~You~must~give~the~number~of~that~last~column.\\ If~you~go~on~this~option~will~be~ignored. } @@ -6606,7 +6749,7 @@ c & c & b & a & e { You~try~to~draw~a~block~in~the~cell~#1-#2~of~your~matrix~but~the~matrix~is~ too~small~for~that~block.\\ - If~you~go~on,~this~command~line~will~be~ignored. + If~you~go~on,~this~command~will~be~ignored. } % \end{macrocode} % @@ -6623,10 +6766,10 @@ c & c & b & a & e % \begin{macrocode} \@@_msg_new:nn { Wrong~last~row } { - You~have~used~'last-row=\int_use:N \l_@@_last_row_int'~but~your~environment~ - \{\g_@@_type_env_str\}~seems~to~have~\int_use:N \c@iRow - rows.~If~you~go~on,~the~value~of~\int_use:N \c@iRow - will~be~used~for~last~row.~You~can~avoid~this~problem~by~using~'last-row'~ + You~have~used~'last-row=\int_use:N \l_@@_last_row_int'~but~your~ + \g_@@_type_env_str\ seems~to~have~\int_use:N \c@iRow \ rows.~ + If~you~go~on,~the~value~of~\int_use:N \c@iRow \ will~be~used~for~ + last~row.~You~can~avoid~this~problem~by~using~'last-row'~ without~value~(more~compilations~might~be~necessary). } % \end{macrocode} @@ -6643,7 +6786,7 @@ c & c & b & a & e % \begin{macrocode} \@@_msg_new:nn { Outside~math~mode } { - The~environment~\{\g_@@_type_env_str\}~can~be~used~only~in~math~mode~ + The~\g_@@_type_env_str\ can~be~used~only~in~math~mode~ (and~not~in~\token_to_str:N \vcenter).\\ This~error~is~fatal. } @@ -6655,6 +6798,9 @@ c & c & b & a & e The~option~'Transparent'~has~been~renamed~'transparent'.\\ However,~you~can~go~on~for~this~time. } +% \end{macrocode} +% +% \begin{macrocode} \@@_msg_new:nn { Option~RenewMatrix~suppressed } { The~option~'RenewMatrix'~has~been~renamed~'renew-matrix'.\\ @@ -6744,8 +6890,8 @@ c & c & b & a & e % \begin{macrocode} \@@_msg_new:nnn { Unknown~option~for~NiceMatrix } { - The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~environment~ - \{\g_@@_type_env_str\}. \\ + The~option~'\tl_use:N\l_keys_key_tl'~is~unknown~for~the~ + \g_@@_type_env_str. \\ If~you~go~on,~it~will~be~ignored. \\ For~a~list~of~the~available~options,~type~H~<return>. } @@ -6805,7 +6951,7 @@ c & c & b & a & e % \begin{macrocode} \@@_msg_new:nn { Zero~row } { - There~is~a~problem.~Maybe~your~environment~\{\g_@@_type_env_str\}~is~empty.~ + There~is~a~problem.~Maybe~your~\g_@@_type_env_str\ is~empty.~ Maybe~you~have~used~l,~c~and~r~instead~of~L,~C~and~R~in~the~preamble~ of~your~environment. \\ If~you~go~on,~the~result~may~be~incorrect. @@ -6816,7 +6962,7 @@ c & c & b & a & e \@@_msg_new:nn { Use~of~:~in~first~position } { You~can't~use~the~column~specifier~'\l_@@_letter_for_dotted_lines_str'~in~the~ - first~position~of~the~preamble~of~the~environment~\{\g_@@_type_env_str\}. \\ + first~position~of~the~preamble~of~the~\g_@@_type_env_str. \\ If~you~go~on,~this~dotted~line~will~be~ignored. } % \end{macrocode} @@ -6827,7 +6973,7 @@ c & c & b & a & e % \begin{macrocode} \@@_msg_new:nn { Obsolete~environment } { - The~environment~\{\@currenvir\}~is~obsolete.~ + The~environment~\{\@currenvir\}~is~obsolete~and~will~be~deleted~in~future~version.~ We~should~use~#1~instead. } % \end{macrocode} @@ -7171,6 +7317,15 @@ c & c & b & a & e % % There is no longer artificial errors |Duplicate~name| in the environments of % \pkg{amsmath}. +% +% \subsection*{Changes between version 3.6 and 3.7} +% +% The four ``corners'' of the matrix are correctly protected against the four +% codes: |code-for-first-col|, |code-for-last-col|, |code-for-first-row| and +% |code-for-last-row|. +% +% New command |\pAutoNiceMatrix| and its variants (suggestion of Christophe Bal). +% % \PrintIndex % % \tableofcontents diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf Binary files differindex ce320d5eb1..f8b8f28703 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix.pdf |