summaryrefslogtreecommitdiff
path: root/macros/latex/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r--macros/latex/contrib/datetime2-contrib/datetime2-serbian/README57
-rw-r--r--macros/latex/contrib/datetime2-contrib/datetime2-serbian/README.md96
-rw-r--r--macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.dtx7018
-rw-r--r--macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.ins147
-rw-r--r--macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.pdfbin78035 -> 280065 bytes
-rw-r--r--macros/latex/contrib/jnuexam/exam-a-a3input.pdfbin111416 -> 102199 bytes
-rw-r--r--macros/latex/contrib/jnuexam/exam-a-a3split.pdfbin103007 -> 94090 bytes
-rw-r--r--macros/latex/contrib/jnuexam/exam-a-empty.pdfbin100412 -> 91316 bytes
-rw-r--r--macros/latex/contrib/jnuexam/exam-a.pdfbin118234 -> 104945 bytes
-rw-r--r--macros/latex/contrib/jnuexam/exam-a.tex68
-rw-r--r--macros/latex/contrib/jnuexam/exam-b-a3input.pdfbin111285 -> 102033 bytes
-rw-r--r--macros/latex/contrib/jnuexam/exam-b-a3split.pdfbin102968 -> 93887 bytes
-rw-r--r--macros/latex/contrib/jnuexam/exam-b-empty.pdfbin100270 -> 91140 bytes
-rw-r--r--macros/latex/contrib/jnuexam/exam-b.pdfbin118116 -> 104821 bytes
-rw-r--r--macros/latex/contrib/jnuexam/jnuexam.cls178
-rw-r--r--macros/latex/contrib/jnuexam/jnuexam.pdfbin65809 -> 74286 bytes
-rw-r--r--macros/latex/contrib/jnuexam/jnuexam.tex107
-rw-r--r--macros/latex/contrib/ocgx2/ChangeLog8
-rw-r--r--macros/latex/contrib/ocgx2/ocgx2.sty18
-rw-r--r--macros/latex/contrib/ucsmonograph/README.md12
-rw-r--r--macros/latex/contrib/ucsmonograph/ucsmonograph.dtx252
-rw-r--r--macros/latex/contrib/ucsmonograph/ucsmonograph.pdfbin410611 -> 424968 bytes
22 files changed, 7289 insertions, 672 deletions
diff --git a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/README b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/README
deleted file mode 100644
index 7f39f59f56..0000000000
--- a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/README
+++ /dev/null
@@ -1,57 +0,0 @@
-Serbian Language Module for datetime2 Package
-
-Author: Nicola L. C. Talbot (inactive)
-
-Licence: LPPL
-
-Required Packages: datetime2, tracklang
-
-This module is unmaintained. If you want to volunteer to take over
-the maintenance contact me at www.dickimaw-books.com/contact.html
-
-Example usage:
-
-\documentclass{article}
-\usepackage[serbian]{datetime2}
-\begin{document}
-\today
-\end{document}
-
-\documentclass[serbian]{article}
-\usepackage{babel}
-\usepackage[useregional]{datetime2}
-\begin{document}
-\today
-\end{document}
-
-\documentclass{article}
-\usepackage{polyglossia}
-\setmainlanguage{serbian}
-\usepackage[serbian]{datetime2}
-\begin{document}
-\today
-\end{document}
-
-INSTALLATION
-============
-
-xelatex datetime2-serbian.ins
-
-Move all *.ldf files to
-TEXMF/tex/latex/datetime2-contrib/datetime2-serbian/
-
-Documentation:
-
-xelatex datetime2-serbian.dtx
-makeindex -s gind.ist datetime2-serbian.idx
-makeindex -s gglo.ist -o datetime2-serbian.gls datetime2-serbian.glo
-xelatex datetime2-serbian.dtx
-xelatex datetime2-serbian.dtx
-
-Move datetime2-serbian.pdf and README to
-TEXMF/doc/latex/datetime2-contrib/datetime2-serbian/
-
-This material is subject to the LaTeX Project Public License.
-See http://www.ctan.org/license/lppl1.3 for the details of that
-license.
-
diff --git a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/README.md b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/README.md
new file mode 100644
index 0000000000..cacfff42e5
--- /dev/null
+++ b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/README.md
@@ -0,0 +1,96 @@
+Serbian Language Module for datetime2 CTAN Package
+==================================================
+
+**Current maintainer:** Andrej Radović
+
+**Authors:** Andrej Radović (r.andrej@gmail.com), Nicola L. C. Talbot
+(inactive)
+
+**Licence:** LPPL
+
+**Required Packages:** `datetime2`, `tracklang`
+
+Styles
+------
+
+This module provides the following styles:
+
+### Latin:
+* serbian - regionless style
+* sr-Latn - Serbian, Serbia
+* sr-Latn-RS - Serbian, Serbia
+* sr-Latn-ME - Serbian, Montenegro
+* sr-Latn-BA - Serbian, Bosnia and Herzegovina
+
+### Cyrillic
+* serbianc - regionless style
+* sr-Cyrl - Serbian, Serbia
+* sr-Cyrl-RS - Serbian, Serbia
+* sr-Cyrl-ME - Serbian, Montenegro
+* sr-Cyrl-BA - Serbian, Bosnia and Herzegovina
+
+Notes:
+------
+
+The regional settings still don't work, but `serbian` and `serbianc` work just
+fine.
+The package is still in development.
+
+Example usage:
+--------------
+
+### Generic w/ `babel`
+ \documentclass{article}
+ \usepackage[serbian]{datetime2}
+ \begin{document}
+ \today
+ \end{document}
+
+### Generic w/ `babel`
+
+ \documentclass[serbian]{article}
+ \usepackage{babel}
+ \usepackage[useregional]{datetime2}
+ \begin{document}
+ \today
+ \end{document}
+
+### Generic w/ `polyglossia`
+
+ \documentclass{article}
+ \usepackage{polyglossia}
+ \setmainlanguage{serbian}
+ \usepackage[serbian]{datetime2}
+ \begin{document}
+ \today
+ \end{document}
+
+
+Installation
+------------
+
+Extract the language definition files first:
+
+Run LuaLaTeX over the file `datetime2-serbian.ins`:
+
+ lualatex datetime2-serbian.ins
+
+Move all `*.ldf` files to
+
+ TEXMF/tex/latex/datetime2-contrib/datetime2-serbian/
+
+ Then, you can compile the documentation yourself by executing
+
+ lualatex datetime2-serbian.dtx
+ makeindex -s ginddt2s.ist datetime2-serbian.idx
+ makeindex -s gglodt2s.ist -o datetime2-serbian.gls datetime2-serbian.glo
+ lualatex datetime2-serbian.dtx
+ lualatex datetime2-serbian.dtx
+
+or just use the precompiled documentation shipped with the source files.
+In both cases, copy the files `datetime2-serbian.pdf` and `README.md` to
+`TEXMF/doc/latex/datetime2-contrib/datetime2-serbian/`.
+
+This material is subject to the LaTeX Project Public License.
+See http://www.ctan.org/license/lppl1.3 for the details of that
+license.
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 cd0c173e29..8409c539c2 100644
--- a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.dtx
+++ b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.dtx
@@ -20,38 +20,128 @@
% \iffalse
% Doc-Source file to use with LaTeX2e
% Copyright (C) 2019 Nicola Talbot, all rights reserved.
-% (New maintainer add relevant lines here.)
+% Copyright (C) 2019 Andrej Radović, all rights reserved.
% \fi
% \iffalse
%<*driver>
-\documentclass{ltxdoc}
+\documentclass[11pt]{ltxdoc}
+
\usepackage{alltt}
+\usepackage{hologo}
\usepackage{graphicx}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
\usepackage{fontspec}
+\usepackage{multicol}
+\usepackage[dvipsnames]{xcolor}
+\usepackage[english]{babel}
\usepackage[colorlinks,
- bookmarks,
- hyperindex=false,
- pdfauthor={Nicola L.C. Talbot},
- pdftitle={datetime2.sty Serbian Module}]{hyperref}
+%draft, % hyperref's draft mode - disable all hypertext
+% TOC settings
+%
+bookmarks,
+linktocpage=true, % make page number, not text, be link on TOC
+%
+% link colors and other settings
+pageanchor=true,% give every page an anchor in its top left corner
+% necessary for many other options
+plainpages=false,% don't force Arabic anchor naming
+breaklinks=true,% allow breaking links over lines
+colorlinks=true,% enable link coloring
+urlcolor=Maroon,% url colors
+linkcolor=MidnightBlue,% color for normal, internal links
+citecolor=PineGreen,% bibliographical citation color
+%frenchlinks=true % use small caps instead of color for links
+%pdfborder={1 0 0},% the color of boxes around links if colorlinks is
+% not used
+%
+% PDF settings
+%
+unicode=true, % set PDF metadata to be unicode
+pdfpagemode=UseNone, % don't open either bookmark or thumbnail sidebar
+% alternately, UseOutlines shows bookmark sidebar
+pdfstartview=FitV, % scale the PDF to fit the height on first open
+bookmarksnumbered=true,% include section number in bookmarks
+bookmarksopen=true,% expand bookmark tree in PDF viewer to a level
+bookmarksopenlevel=1,% this is the level
+hypertexnames=true, % guessable link names
+pdfhighlight=/O,% links are outlined when selected, not /I for inverted
+%
+% PDF metadata
+%
+pdftitle={datetime2.sty Serbian Module}
+pdfauthor={Andrej Radović},
+pdfcreator={xdvipdfmx},%
+pdfproducer={lualatex},%
+hyperindex=false%
+]{hyperref}
+\usepackage{textcase}
+
+\usepackage{enumitem}
+\newlist{optdescription}{description}{1}
+\setlist[optdescription]{%
+ align=right,
+ labelindent=!,
+ leftmargin=0pt,
+ font=\small\normalfont\ttfamily}
-\setmainfont{Liberation Serif}
-\setmonofont{Liberation Mono}
-\newfontfamily\cyrillicfont{Liberation Serif}
+\usepackage{acronym}
+\renewcommand{\acsfont}[1]{{\scshape{#1}}}
+\renewcommand*{\aclabelfont}[1]{{\acsfont{#1}}}
-\CheckSum{615}
+
+%%\CheckSum{692}
\renewcommand*{\usage}[1]{\hyperpage{#1}}
\renewcommand*{\main}[1]{\hyperpage{#1}}
\IndexPrologue{\section*{\indexname}\markboth{\indexname}{\indexname}}
\setcounter{IndexColumns}{2}
+\setcounter{GlossaryColumns}{2}
+\setlength{\columnsep}{2em}
+\let\GlossaryParms\IndexParms%
+\newcommand*{\indexitemst}[1]{{\bfseries\sffamily\normalsize{#1}}}
-\newcommand*{\sty}[1]{\textsf{#1}}
+\newcommand*{\sty}[1]{{\textsf{#1}}}
\newcommand*{\opt}[1]{\texttt{#1}\index{#1=\texttt{#1}|main}}
+\newcommand*{\subsubsectionopt}[1]{\subsubsection{#1}\index{#1=\texttt{#1}|main}}
+\newcommand*{\itemopt}[1]{\item[#1]\index{#1=\texttt{#1}|main}}
+
+\usepackage[final,tracking=true, protrusion=true, expansion=true]{microtype}
-\RecordChanges
-\PageIndex
-\CodelineNumbered
+\usepackage[drafting=false,
+tocaligned=false,
+dottedtoc=false,
+eulerchapternumbers=false,
+linedheaders=false,
+floatperchapter=false,
+eulermath=false,
+beramono=false,
+palatino=false,
+style=arsclassica,
+nochapters=true%
+]{classicthesis}
+
+\pagestyle{plain}
+\cfoot[\small\pagemark]{}% use a small centered page number in the footer
+\ofoot[]{}% clear the outer footer
+
+\usepackage[%showframe,
+top=3.25cm,bottom=3cm]{geometry}
+
+\defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}
+\setmainfont{XCharter}[Numbers=OldStyle]
+\setmonofont{Inconsolata LGC}
+\setsansfont{Fira Sans Book}[%
+ Numbers=OldStyle,
+ ItalicFont = {Fira Sans Book Italic},
+ BoldFont = {Fira Sans SemiBold},
+ BoldItalicFont = {Fira Sans SemiBold Italic}]
+\newfontfamily\cyrillicfont{XCharter}
+
+\RecordChanges%
+\PageIndex%
+\CodelineNumbered%
\begin{document}
\DocInput{datetime2-serbian.dtx}
@@ -61,408 +151,1372 @@
%
%\MakeShortVerb{"}
%
-%\title{Serbian Module for datetime2 Package}
-%\author{Nicola L. C. Talbot (inactive)}
-%\date{2019-09-14 (v1.1)}
+%\changes{2.0}{2019-11-07}{%
+% Restyled the documentation.
+%}
+%
+%
+%\title{{\rmfamily\normalfont\spacedallcaps{%
+% Serbian Module for datetime\liningnums{2} Package}}\\%
+% {\large\url{https://gitlab.com/andrejr/datetime2-serbian}}}
+%\author{%
+% \spacedlowsmallcaps{Andrej Radović}\\
+% \url{r.andrej@gmail.com}
+% \and
+% \spacedlowsmallcaps{Nicola L. C. Talbot} \\
+% \spacedlowsmallcaps{(inactive)}
+%}
+%\date{{\sffamily\scshape 2019-11-07 (v2.0)}}
%\maketitle
%
-%This module is currently unmaintained and may be subject to change.
-%If you want to volunteer to take over maintenance, contact me at
-%\url{http://www.dickimaw-books.com/contact.html}
+% \renewcommand{\abstractname}{\normalfont\normalsize\spacedlowsmallcaps{Abstract}}
+%
%
%\begin{abstract}
+%\noindent
%This is the Serbian language module for the \sty{datetime2}
%package. If you want to use the settings in this module you must
%install it in addition to installing \sty{datetime2}. If you use
%\sty{babel} or \sty{polyglossia}, you will need this module to
%prevent them from redefining \cs{today}. The \sty{datetime2}
-% \opt{useregional} setting must be set to "text" or "numeric"
-% for the language styles to be set.
-% Alternatively, you can set the style in the document using
-% \cs{DTMsetstyle}, but this may be changed by \cs{date}\meta{language}
-% depending on the value of the \opt{useregional} setting.
+% \opt{useregional} setting must be on (\texttt{text} or
+% \texttt{numeric}) for the language styles to be set.
+% Alternatively, you can set them in the document using
+% \cs{DTMsetstyle}, but without the \opt{useregional} setting on the
+% style will be changed by \cs{date}\meta{language}.
%\end{abstract}
%
-%I've copied the date style from \texttt{babel-serbian}'s \cs{today}.
+%\changes{2.0}{2019-11-07}{%
+% Added a proper introduction.
+%}
+%
+% \noindent
+% As of version 2.0, there is support for both Ekavian and Ijekavian
+% pronunciation in both Latin and Cyrillic, regions (Serbia, Bosnia and
+% Herzegovina, Montenegro), numeric format variants (Roman month ordinals,
+% optional leading zeros).
+% The package provides two regionless styles, "serbian" (Latin) and "serbianc"
+% (Cyrillic), as well as regional styles (explained in \autoref{sub:regions}).
+%
+% Neither month nor day of week abbreviations are supported.
+% These aren't often used within dates in Serbian.
%
-%I don't know if these settings are correct as I can't speak Serbian.
-%In particular, I don't know if the "serbian" time style is
-%correct. Currently this just uses the "default" time style. Please
-%be aware that this may change. Whoever takes over maintanance
-%of this module may can change it as appropriate.
+% Currently, there are problems invoking regional styles, but I'm working on
+% fixing those.
+% Regionless styles are fully functional and you may load them as "serbian" and
+% "serbianc".
%
-%The new maintainer should add the line:
+% \bigskip
+%
+% {\itshape
+% \noindent
+% The package is generated from (Jinja2) templates by a Python script before
+% it's uploaded to CTAN, so don't try to send patches to files you find there.
+% All development is done on Gitlab
+% (\url{https://gitlab.com/andrejr/datetime2-serbian}).
+%
+% If you're developing other datetime2 localization modules (or
+% localization modules in general), the way the package is generated might be
+% of interest to you.
+% I actually tried writing the package by hand, but it was way too tedious.
+% Generating most of the package from templates seems like the best way to do
+% it.
+% Along the way, I also wrote a small utility for generating \acsu{ascii} --
+% \acsu{licr} strings from utf-8 strings, and it can be found here:
+% \url{https://gitlab.com/andrejr/utf8_to_licr}.
+% I might publish it to CTAN if there is interest.
+% }
+%
+% \tableofcontents
+%
+% \section{The Documentation}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added installation guide.
+%}
+%
+% \subsection{Installation}
+% Extract the language definition files first:
+% \begin{enumerate}
+% \item
+% Run \hologo{LuaLaTeX} over the file \texttt{datetime2-serbian.ins}: \\
+% "lualatex datetime2-serbian.ins"
+% %
+% \item Move all \texttt{*.ldf} files to %
+% \nolinkurl{TEXMF/tex/latex/datetime2-contrib/datetime2-serbian/}
+% \end{enumerate}
+% Then, you can compile the documentation yourself by executing
%\begin{verbatim}
-% The Current Maintainer of this work is Name.
+%lualatex datetime2-serbian.dtx
+%makeindex -s ginddt2s.ist datetime2-serbian.idx
+%makeindex -s gglodt2s.ist -o datetime2-serbian.gls datetime2-serbian.glo
+%lualatex datetime2-serbian.dtx
+%lualatex datetime2-serbian.dtx
%\end{verbatim}
-%to the preamble part in \texttt{datetime2-serbian.ins} where Name
-%is the name of the maintainer(s) and replace
-%the `inactive' status to `maintained'.
+% or just use the precompiled documentation shipped with the source files.
+% In both cases, copy the files \texttt{datetime2-serbian.pdf} and
+% \texttt{README.md} to
+% \nolinkurl{TEXMF/doc/latex/datetime2-contrib/datetime2-serbian/}.
+%
+%
+% \subsection{Setting up \sty{datetime2} with a language module}
+%
+% \subsubsection{Loading a language module}
+% \emph{There are three different ways to load the required language module.
+% See the \sty{datetime2} documentation for further detail.}
+%
+% \medskip
+%
+% \paragraph{Variant 1:}
+% Request the desired language module explicitly by passing one of the
+% region options to the \sty{datetime2} package, such as "serbian", "serbianc",
+% "sr-Cyrl-ME", \ldots{} (the full list can be found in \autoref{sub:regions}).%
+%
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage[serbian]{datetime2}
+%\begin{document}
+%\today
+%\end{document}
+%\end{verbatim}
+%
+% \paragraph{Variant 2:}
+% Load \sty{babel} and pass the "serbian" or "serbianc" option to the
+% "\documentclass" command (or to \sty{babel} directly).
+% If you now pass the \opt{useregional} option to \sty{datetime2}, the language
+% module suitable to the one specified with \sty{babel} is loaded:
+%\begin{verbatim}
+%\documentclass[serbian]{article}
+%\usepackage{babel}
+%\usepackage[useregional]{datetime2}
+%\begin{document}
+%\today
+%\end{document}
+%\end{verbatim}
+%
+% \paragraph{Variant 3:}
+% When using \sty{polyglossia}, you should request the desired language module
+% by passing one of the previously mentioned options to the \sty{datetime2}
+% package:
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage{polyglossia}
+%\setmainlanguage{serbian}
+%\usepackage[serbian]{datetime2}
+%\begin{document}
+%\today
+%\end{document}
+%\end{verbatim}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added regions and documented their use.
+%}
+% \subsection{Regions and scripts}\label{sub:regions}
+%
+% Serbian language is a rare example of synchronic digraphia --- a situation
+% where all literate members of a society use two interchangeable writing
+% systems (Cyrillic and Latin).
+% This is true in all regions Serbian is spoken in (Serbia, Bosnia and
+% Herzegovina, Montenegro).
+% This is why every region has a Cyrillic and Latin variant, as well as the
+% regionless styles ("serbian" and "serbianc").
+%
+% The only other difference between the regions is the default value of
+% \hyperref[sub:pronu]{\opt{pronunciation}}, which is Ekavian by default for
+% "serbian", "serbianc", "sr-*-RS" and Ijekavian for the rest.
+%
+% The full list of regions (and regionless styles, on top) is as follows:
+%\begin{multicols}{2}
+%\begin{verbatim}
+%serbian
+%sr-Latn
+%sr-Latn-RS
+%sr-Latn-ME
+%sr-Latn-BA
+%serbianc
+%sr-Cyrl
+%sr-Cyrl-RS
+%sr-Cyrl-ME
+%sr-Cyrl-BA
+%\end{verbatim}
+%\end{multicols}
+%
+%
+% \subsection{Settings (Serbian-related)}
+%\changes{2.0}{2019-11-07}{%
+% Added documentation for new settings.
+%}
+%
+% 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}
+%\end{verbatim}
+%
+%
+% \subsubsectionopt{pronunciation}\label{sub:pronu}
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch between Ekavian and Ijekavian pronunciation.
+%}
+% 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.
+%
+% The default value is Ekavian by default for "serbian", "serbianc", "sr-*-RS"
+% and Ijekavian for the rest of the regions.
+%
+% \smallskip
+% ponedeljak, 4. novembar 2019. \hfill \emph{Ekavian pronunciation} \\
+% ponedjeljak, 4. novembar 2019. \hfill \emph{Ijekavian pronunciation}
+%
+%
+% \subsubsectionopt{monthi}
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch June, July alternate spellings.
+%}
+% 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
+% 15. juni 1389. \hfill "monthi=true" \\
+% 15. jun 1389. \hfill "monthi=false"
+%
+% \subsubsectionopt{leadingzero}\label{sub:leadingzero}
+%\changes{2.0}{2019-11-07}{%
+% Added a switch for toggling leading zeroes in day and month ordinals.
+%}
+% This is a boolean key.
+% If "false" (the default), there is no leading zero for hours, days or months.
+% If "true", there is.
+%
+% \smallskip
+% уторак, 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}{%
+% Added a switch between multiple numeric month ordinal formats used in
+% Serbian.
+%}
+% This key defines the way the month ordinal is written in Serbian "*-numeric"
+% formats.
+% 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
+% 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).
+%
+% \smallskip
+% уторак, 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
+% "monthord=romanlsc" with "\oldstylenums"
+%
+% \subsection{Other features and settings}
+%
+% \subsubsection{Showing the weekday}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% 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}
+% package.
+%
+% \subsubsection{Generic customization of styles}
+% There are a number of settings provided that can be used in "\DTMlangsetup"
+% to modify the date-time style.
+% These should be present in all "datetime2-*" packages and are present in
+% all Serbian regionless and regional styles
+%
+% These are:
+% \begin{optdescription}
+% \itemopt{dowdaysep}%
+% The separator between the day of week name and the day of month number.
+%
+% \itemopt{daymonthsep}%
+% The separator between the day and the month name.
+%
+% \itemopt{monthyearsep}%
+% The separator between the month name and year.
+%
+% \itemopt{datesep}%
+% The separator between the date numbers in the numeric styles.
+%
+% \itemopt{timesep}%
+% The separator between hours, minutes and seconds.
+%
+% \itemopt{datetimesep}%
+% The separator between the date and time for the full date-time format.
+%
+% \itemopt{timezonesep}%
+% The separator between the time and zone for the full date-time format.
+%
+% \itemopt{mapzone}%
+% This is a boolean key. If true, the time zone mappings are applied.
+%
+% \itemopt{showdayofmonth}%
+% A boolean key that determines whether or not to show the day of the month.
+%
+% \itemopt{showyear}%
+% A boolean key that determines whether or not to show the year.
+%\end{optdescription}
+%
+% Although the keys listed here are \emph{defined} for all variant styles, it
+% depends on \sty{datetime2}'s setup and the requested styles whether they're
+% \emph{used}. \\
+% For more information about the "\DTMlangsetup" command see the documentation
+% of the main \sty{datetime2} package.
%
-%Currently there is only a regionless style.
+%
+% \subsection{License}
+% This material is subject to the \LaTeX\ Project Public License, Version 1.3c or later. \\
+% See the copyright headers of the single files for further details.
%
%\StopEventually{%
-%\clearpage
-%\phantomsection
-%\addcontentsline{toc}{section}{Change History}%
-%\PrintChanges
-%\addcontentsline{toc}{section}{\indexname}%
-%\PrintIndex}
+% \clearpage
+% \section*{Acronyms}
+% \addcontentsline{toc}{section}{Acronyms}%
+% \begin{acronym}[asciim]
+% \acro{ascii}{American Standard Code for Information
+% Interchange\acroextra{, legacy 7-bit text encoding used on American
+% computers since the 1960s.
+% It fails to encode non-English characters.
+% The mainstream encoding used when \hologo{TeX} was concieved.
+% }}
+% \acro{utf-8}{Unicode Transformation Format -- 8-bit\acroextra{,
+% modern variable width character encoding that's backward-compatible with
+% \acs*{ascii} for all \acs*{ascii} characters, yet provides full coverage
+% for almost every spoken language.}}
+% \acro{licr}{\LaTeX{} Internal Character Representation\acroextra{, a set
+% of macros that help define non-\acs*{ascii} characters for typesetting in
+% \LaTeX{} even in engines that only support \acs*{ascii}.}}
+% \end{acronym}
+% \phantomsection
+% \addcontentsline{toc}{section}{Change History}%
+% \PrintChanges
+% \addcontentsline{toc}{section}{\indexname}%
+% \PrintIndex
+%}
+%
+%\newgeometry{left=5cm,right=2.75cm,top=3.25cm,bottom=3cm}
+%
%\section{The Code}
+%
%\iffalse
% \begin{macrocode}
-%<*datetime2-serbian-utf8.ldf>
+%<*datetime2-serbian-base.ldf>
% \end{macrocode}
%\fi
-%\subsection{UTF-8}
-%This file contains the settings that use UTF-8 characters. This
-%file is loaded if XeLaTeX or LuaLaTeX are used. Please make sure
-%your text editor is set to UTF-8 if you want to view this code.
+%\subsection{Base package localization strings}
+%
+% 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}
-% Identify module
+%\changes{2.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.
+%}
+%
% \begin{macrocode}
-\ProvidesDateTimeModule{serbian-utf8}[2019/09/14 v1.0]
+\ProvidesDateTimeModule{serbian-base}[2019/11/07 v2.0]
% \end{macrocode}
-%\begin{macro}{\DTMserbianordinal}
+%
+%
+%\begin{macro}{\DTMserbianordinalROMAN}
+% Uppercase Roman numerals.
% \begin{macrocode}
-\newcommand*{\DTMserbianordinal}[1]{%
- \number#1.%
+\newcommand*{\DTMserbianordinalROMAN}[1]{%
+ \ifcase#1
+ \or%
+ I%
+ \or%
+ II%
+ \or%
+ III%
+ \or%
+ IV%
+ \or%
+ V%
+ \or%
+ VI%
+ \or%
+ VII%
+ \or%
+ VIII%
+ \or%
+ IX%
+ \or%
+ X%
+ \or%
+ XI%
+ \or%
+ XII%
+ \fi
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\DTMserbiancyrmonthname}
-% Serbian month names. (Cyrillic alphabet.)
+%
+%\begin{macro}{\DTMserbianordinalroman}
+% Lowercase Roman numerals.
% \begin{macrocode}
-\newcommand*{\DTMserbiancyrmonthname}[1]{%
+\newcommand*{\DTMserbianordinalroman}[1]{%
\ifcase#1
- \or
- јануар%
- \or
- фебруар%
- \or
- март%
- \or
- април%
- \or
- мај%
- \or
- јун%
- \or
- јул%
- \or
- август%
- \or
- септембар%
- \or
- октобар%
- \or
- новембар%
- \or
- децембар%
+ \or%
+ i%
+ \or%
+ ii%
+ \or%
+ iii%
+ \or%
+ iv%
+ \or%
+ v%
+ \or%
+ vi%
+ \or%
+ vii%
+ \or%
+ viii%
+ \or%
+ ix%
+ \or%
+ x%
+ \or%
+ xi%
+ \or%
+ xii%
\fi
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\DTMserbiancyrMonthname}
-% As above but capitalize.
+%
+% We will now include the appropriate localization data.
+%
+% Packages \sty{ifxetex} and \sty{ifluatex} provide a way to determine if the
+% currently used \LaTeX{} engine is \hologo{XeLaTeX} or \hologo{LuaLaTeX},
+% respectively.
+% \begin{macrocode}
+\RequirePackage{ifxetex,ifluatex}
+% \end{macrocode}
+% Load \texttt{serbian-utf8} if either \hologo{XeLaTeX} or \hologo{LuaLaTeX}
+% are used, since these engines natively support utf-8.
+% Otherwise load \texttt{serbian-ascii}, which provides support for legacy
+% engines that only support \ac{licr}.
+% \begin{macrocode}
+\ifxetex%
+ \RequireDateTimeModule{serbian-base-utf8}
+\else
+ \ifluatex%
+ \RequireDateTimeModule{serbian-base-utf8}
+ \else
+ \RequireDateTimeModule{serbian-base-ascii}
+ \fi
+\fi
+% \end{macrocode}
+%
+%\iffalse
% \begin{macrocode}
-\newcommand*{\DTMserbiancyrMonthname}[1]{%
+%</datetime2-serbian-base.ldf>
+% \end{macrocode}
+%\fi
+%
+%
+%
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-serbian-base-utf8.ldf>
+% \end{macrocode}
+%\fi
+%\subsection{Base Serbian \acs{utf-8} localization strings}
+% This file contains the localization strings necessary for proper date
+% formatting in \acs{utf-8} format.
+% 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}{%
+% 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.
+%}
+% \begin{macrocode}
+\ProvidesDateTimeModule{serbian-base-utf8}[2019/11/07 v2.0]
+% \end{macrocode}
+%
+%\subsubsection{Latin month names}
+%
+%\begin{macro}{\DTMserbianlatnoimonthname}
+% Serbian month names, Latin alphabet, no \sty{i} suffix for June and July,
+% non-capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbianlatnoimonthname}[1]{%
\ifcase#1
- \or
- Јануар%
- \or
- Фебруар%
- \or
- Март%
- \or
- Април%
- \or
- Мај%
- \or
- Јун%
- \or
- Јул%
- \or
- Август%
- \or
- Септембар%
- \or
- Октобар%
- \or
- Новембар%
- \or
- Децембар%
+ \or%
+ januar%
+ \or%
+ februar%
+ \or%
+ mart%
+ \or%
+ april%
+ \or%
+ maj%
+ \or%
+ jun%
+ \or%
+ jul%
+ \or%
+ avgust%
+ \or%
+ septembar%
+ \or%
+ oktobar%
+ \or%
+ novembar%
+ \or%
+ decembar%
\fi
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\DTMserbianlatinmonthname}
-% Serbian month names. (Latin alphabet.)
+%\begin{macro}{\DTMserbianlatnoiMonthname}
+% Serbian month names, Latin alphabet, no \sty{i} suffix for June and July,
+% capitalized.
% \begin{macrocode}
-\newcommand*{\DTMserbianlatinmonthname}[1]{%
+\newcommand*{\DTMserbianlatnoiMonthname}[1]{%
\ifcase#1
- \or
- januar%
- \or
- februar%
- \or
- mart%
- \or
- april%
- \or
- maj%
- \or
- juni%
- \or
- juli%
- \or
- avgust%
- \or
- septembar%
- \or
- oktobar%
- \or
- novembar%
- \or
- decembar%
+ \or%
+ Januar%
+ \or%
+ Februar%
+ \or%
+ Mart%
+ \or%
+ April%
+ \or%
+ Maj%
+ \or%
+ Jun%
+ \or%
+ Jul%
+ \or%
+ Avgust%
+ \or%
+ Septembar%
+ \or%
+ Oktobar%
+ \or%
+ Novembar%
+ \or%
+ Decembar%
\fi
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\DTMserbianlatinMonthname}
-% As above but capitalize.
+%\begin{macro}{\DTMserbianlatimonthname}
+% Serbian month names, Latin alphabet, \sty{i} suffix for June and July,
+% non-capitalized.
% \begin{macrocode}
-\newcommand*{\DTMserbianlatinMonthname}[1]{%
- \ifcase#1
- \or
- Januar%
- \or
- Februar%
- \or
- Mart%
- \or
- April%
- \or
- Maj%
- \or
- Juni%
- \or
+\newcommand*{\DTMserbianlatimonthname}[1]{%
+ \ifnum#1=6%
+ juni%
+ \else\ifnum\#1=7%
+ juli%
+ \else
+ \DTMserbianlatnoimonthname%
+ \fi\fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbianlatiMonthname}
+% Serbian month names, Latin alphabet, \sty{i} suffix for June and July,
+% capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbianlatiMonthname}[1]{%
+ \ifnum#1=6%
+ Juni%
+ \else\ifnum\#1=7%
Juli%
- \or
- Avgust%
- \or
- Septembar%
- \or
- Oktobar%
- \or
- Novembar%
- \or
- Decembar%
+ \else
+ \DTMserbianlatnoimonthname%
+ \fi\fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\subsubsection{Latin days of week, Ekavian pronunciation}
+%
+%\begin{macro}{\DTMserbianlatekweekdayname}
+% Serbian weekday names, Latin alphabet, Ekavian pronunciation,
+% non-capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbianlatekweekdayname}[1]{%
+ \ifcase#1
+ ponedeljak%
+ \or%
+ utorak%
+ \or%
+ sreda%
+ \or%
+ četvrtak%
+ \or%
+ petak%
+ \or%
+ subota%
+ \or%
+ nedelja%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbianlatekWeekdayname}
+% Serbian weekday names, Latin alphabet, Ekavian pronunciation, capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbianlatekWeekdayname}[1]{%
+ \ifcase#1
+ Ponedeljak%
+ \or%
+ Utorak%
+ \or%
+ Sreda%
+ \or%
+ Četvrtak%
+ \or%
+ Petak%
+ \or%
+ Subota%
+ \or%
+ Nedelja%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\subsubsection{Latin days of week, Ijekavian pronunciation}
+%
+%
+%\begin{macro}{\DTMserbianlatijweekdayname}
+% Serbian weekday names, Latin alphabet, Ijekavian pronunciation,
+% non-capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbianlatijweekdayname}[1]{%
+ \ifcase#1
+ ponedjeljak%
+ \or%
+ utorak%
+ \or%
+ srijeda%
+ \or%
+ četvrtak%
+ \or%
+ petak%
+ \or%
+ subota%
+ \or%
+ nedjelja%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbianlatijWeekdayname}
+% Serbian weekday names, Latin alphabet, Ijekavian pronunciation,
+% capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbianlatijWeekdayname}[1]{%
+ \ifcase#1
+ Ponedjeljak%
+ \or%
+ Utorak%
+ \or%
+ Srijeda%
+ \or%
+ Četvrtak%
+ \or%
+ Petak%
+ \or%
+ Subota%
+ \or%
+ Nedjelja%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\subsubsection{Cyrillic month names}
+%
+%\begin{macro}{\DTMserbiancyrnoimonthname}
+% Serbian month names, Cyrillic alphabet, no \sty{i} suffix for June and July,
+% non-capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrnoimonthname}[1]{%
+ \ifcase#1
+ \or%
+ јануар%
+ \or%
+ фебруар%
+ \or%
+ март%
+ \or%
+ април%
+ \or%
+ мај%
+ \or%
+ јун%
+ \or%
+ јул%
+ \or%
+ август%
+ \or%
+ септембар%
+ \or%
+ октобар%
+ \or%
+ новембар%
+ \or%
+ децембар%
\fi
}
% \end{macrocode}
%\end{macro}
%
-%If abbreviated dates are supported, short month names should be
-%likewise provided.
+%\begin{macro}{\DTMserbiancyrnoiMonthname}
+% Serbian month names, Cyrillic alphabet, no \sty{i} suffix for June and July,
+% capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrnoiMonthname}[1]{%
+ \ifcase#1
+ \or%
+ Јануар%
+ \or%
+ Фебруар%
+ \or%
+ Март%
+ \or%
+ Април%
+ \or%
+ Мај%
+ \or%
+ Јун%
+ \or%
+ Јул%
+ \or%
+ Август%
+ \or%
+ Септембар%
+ \or%
+ Октобар%
+ \or%
+ Новембар%
+ \or%
+ Децембар%
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancyrimonthname}
+% Serbian month names, Cyrillic alphabet, \sty{i} suffix for June and July,
+% non-capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrimonthname}[1]{%
+ \ifnum#1=6%
+ јуни%
+ \else\ifnum\#1=7%
+ јули%
+ \else
+ \DTMserbiancyrnoimonthname%
+ \fi\fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancyriMonthname}
+% Serbian month names, Cyrillic alphabet, \sty{i} suffix for June and July,
+% capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyriMonthname}[1]{%
+ \ifnum#1=6%
+ Јуни%
+ \else\ifnum\#1=7%
+ Јули%
+ \else
+ \DTMserbiancyrnoimonthname%
+ \fi\fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\subsubsection{Cyrillic days of week, Ekavian pronunciation}
+%
+%\begin{macro}{\DTMserbiancyrekweekdayname}
+% Serbian weekday names, Cyrillic alphabet, Ekavian pronunciation,
+% non-capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrekweekdayname}[1]{%
+ \ifcase#1
+ понедељак%
+ \or%
+ уторак%
+ \or%
+ среда%
+ \or%
+ четвртак%
+ \or%
+ петак%
+ \or%
+ субота%
+ \or%
+ недеља%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancyrekWeekdayname}
+% Serbian weekday names, Cyrillic alphabet, Ekavian pronunciation, capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrekWeekdayname}[1]{%
+ \ifcase#1
+ Понедељак%
+ \or%
+ Уторак%
+ \or%
+ Среда%
+ \or%
+ Четвртак%
+ \or%
+ Петак%
+ \or%
+ Субота%
+ \or%
+ Недеља%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\subsubsection{Cyrillic days of week, Ijekavian pronunciation}
+%
+%
+%\begin{macro}{\DTMserbiancyrijweekdayname}
+% Serbian weekday names, Cyrillic alphabet, Ijekavian pronunciation,
+% non-capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrijweekdayname}[1]{%
+ \ifcase#1
+ понедјељак%
+ \or%
+ уторак%
+ \or%
+ сриједа%
+ \or%
+ четвртак%
+ \or%
+ петак%
+ \or%
+ субота%
+ \or%
+ недјеља%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancyrijWeekdayname}
+% Serbian weekday names, Cyrillic alphabet, Ijekavian pronunciation,
+% capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrijWeekdayname}[1]{%
+ \ifcase#1
+ Понедјељак%
+ \or%
+ Уторак%
+ \or%
+ Сриједа%
+ \or%
+ Четвртак%
+ \or%
+ Петак%
+ \or%
+ Субота%
+ \or%
+ Недјеља%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%
%
%\iffalse
% \begin{macrocode}
-%</datetime2-serbian-utf8.ldf>
+%</datetime2-serbian-base-utf8.ldf>
% \end{macrocode}
%\fi
+%
%\iffalse
% \begin{macrocode}
-%<*datetime2-serbian-ascii.ldf>
+%<*datetime2-serbian-base-ascii.ldf>
% \end{macrocode}
%\fi
-%\subsection{ASCII}
-%This file contains the settings that use \LaTeX\ commands for
-%non-ASCII characters. This should be input if neither XeLaTeX nor
-%LuaLaTeX are used. Even if the user has loaded \sty{inputenc} with
-%"utf8", this file should still be used not the
-%\texttt{datetime2-serbian-utf8.ldf} file as the non-ASCII
-%characters are made active in that situation and would need
-%protecting against expansion.
+%\subsection{Base Serbian \acs{ascii} --- \acs{licr} localization strings}
+% This file contains the localization strings necessary for proper date
+% formatting in \ac{licr} format, which is \acs{ascii}-compatible.
+% It provides support for legacy \LaTeX{} engines that only support this kind
+% of format and encoding.
+%
+% This part of the file is generated from the \acs{utf-8} version with the
+% help of a tool I wrote, since writing pure \ac{licr} by hand would be
+% quite insane.
+%
%\changes{1.0}{2015-03-31}{Initial release}
-% Identify module
+%\changes{2.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.
+%}
+%
% \begin{macrocode}
-\ProvidesDateTimeModule{serbian-ascii}[2019/09/14 v1.0]
+\ProvidesDateTimeModule{serbian-base-ascii}[2019/11/07 v2.0]
% \end{macrocode}
%
-%If abbreviated dates are supported, short month names should be
-%likewise provided.
-%\begin{macro}{\DTMserbianordinal}
+%%\subsubsection{Latin month names}
+%
+%\begin{macro}{\DTMserbianlatnoimonthname}
+% Serbian month names, Latin alphabet, no \sty{i} suffix for June and July,
+% non-capitalized.
% \begin{macrocode}
-\newcommand*{\DTMserbianordinal}[1]{%
- \number#1.%
+\newcommand*{\DTMserbianlatnoimonthname}[1]{%
+ \ifcase#1
+ \or%
+ januar%
+ \or%
+ februar%
+ \or%
+ mart%
+ \or%
+ april%
+ \or%
+ maj%
+ \or%
+ jun%
+ \or%
+ jul%
+ \or%
+ avgust%
+ \or%
+ septembar%
+ \or%
+ oktobar%
+ \or%
+ novembar%
+ \or%
+ decembar%
+ \fi
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\DTMserbiancyrmonthname}
-% Serbian month names. (Cyrillic alphabet.) I'm not sure if these
-% are correct.
+%\begin{macro}{\DTMserbianlatnoiMonthname}
+% Serbian month names, Latin alphabet, no \sty{i} suffix for June and July,
+% capitalized.
% \begin{macrocode}
-\newcommand*{\DTMserbiancyrmonthname}[1]{%
+\newcommand*{\DTMserbianlatnoiMonthname}[1]{%
\ifcase#1
- \or
- \protect\cyrje\protect\cyra\protect\cyrn\protect\cyru\protect\cyra
- \protect\cyrr
- \or
- \protect\cyrf\protect\cyrie\protect\cyrb\protect\cyrr\protect\cyru
- \protect\cyrr
- \or
- \protect\cyrm\protect\cyra\protect\cyrr\protect\cyrt
- \or
- \protect\cyra\protect\cyrp\protect\cyrr\protect\cyri\protect\cyrl
- \or
- \protect\cyrm\protect\cyra\protect\cyrje
- \or
- \protect\cyrje\protect\cyru\protect\cyrn
- \or
- \protect\cyrje\protect\cyru\protect\cyrl
- \or
- \protect\cyra\protect\cyrv\protect\cyrg\protect\cyru\protect\cyrs
- \protect\cyrt
- \or
- \protect\cyrs\protect\cyre\protect\cyrp\protect\cyrt\protect\cyre
- \protect\cyrm\protect\cyrb\protect\cyra\protect\cyrr
- \or
- \protect\cyro\protect\cyrk\protect\cyrt\protect\cyro\protect\cyrb
- \protect\cyra\protect\cyrr
- \or
- \protect\cyrn\protect\cyro\protect\cyrv\protect\cyre\protect\cyrm
- \protect\cyrb\protect\cyra\protect\cyrr
- \or
- \protect\cyrd\protect\cyre\protect\cyrc\protect\cyre\protect\cyrm
- \protect\cyrb\protect\cyra\protect\cyrr
+ \or%
+ Januar%
+ \or%
+ Februar%
+ \or%
+ Mart%
+ \or%
+ April%
+ \or%
+ Maj%
+ \or%
+ Jun%
+ \or%
+ Jul%
+ \or%
+ Avgust%
+ \or%
+ Septembar%
+ \or%
+ Oktobar%
+ \or%
+ Novembar%
+ \or%
+ Decembar%
\fi
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\DTMserbiancyrMonthname}
-% As above but capitalize.
+%\begin{macro}{\DTMserbianlatimonthname}
+% Serbian month names, Latin alphabet, \sty{i} suffix for June and July,
+% non-capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbianlatimonthname}[1]{%
+ \ifnum#1=6%
+ juni%
+ \else\ifnum\#1=7%
+ juli%
+ \else
+ \DTMserbianlatnoimonthname%
+ \fi\fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbianlatiMonthname}
+% Serbian month names, Latin alphabet, \sty{i} suffix for June and July,
+% capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbianlatiMonthname}[1]{%
+ \ifnum#1=6%
+ Juni%
+ \else\ifnum\#1=7%
+ Juli%
+ \else
+ \DTMserbianlatnoimonthname%
+ \fi\fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\subsubsection{Latin days of week, Ekavian pronunciation}
+%
+%\begin{macro}{\DTMserbianlatekweekdayname}
+% Serbian weekday names, Latin alphabet, Ekavian pronunciation,
+% non-capitalized
% \begin{macrocode}
-\newcommand*{\DTMserbiancyrMonthname}[1]{%
+\newcommand*{\DTMserbianlatekweekdayname}[1]{%
\ifcase#1
- \or
- \protect\CYRJE\protect\cyra\protect\cyrn\protect\cyru\protect\cyra
- \protect\cyrr
- \or
- \protect\CYRF\protect\cyrie\protect\cyrb\protect\cyrr\protect\cyru
- \protect\cyrr
- \or
- \protect\CYRM\protect\cyra\protect\cyrr\protect\cyrt
- \or
- \protect\CYRA\protect\cyrp\protect\cyrr\protect\cyri\protect\cyrl
- \or
- \protect\CYRM\protect\cyra\protect\cyrje
- \or
- \protect\CYRJE\protect\cyru\protect\cyrn
- \or
- \protect\CYRJE\protect\cyru\protect\cyrl
- \or
- \protect\CYRA\protect\cyrv\protect\cyrg\protect\cyru\protect\cyrs
- \protect\cyrt
- \or
- \protect\CYRS\protect\cyre\protect\cyrp\protect\cyrt\protect\cyre
- \protect\cyrm\protect\cyrb\protect\cyra\protect\cyrr
- \or
- \protect\CYRO\protect\cyrk\protect\cyrt\protect\cyro\protect\cyrb
- \protect\cyra\protect\cyrr
- \or
- \protect\CYRN\protect\cyro\protect\cyrv\protect\cyre\protect\cyrm
- \protect\cyrb\protect\cyra\protect\cyrr
- \or
- \protect\CYRD\protect\cyre\protect\cyrc\protect\cyre\protect\cyrm
- \protect\cyrb\protect\cyra\protect\cyrr
- \fi
+ ponedeljak%
+ \or%
+ utorak%
+ \or%
+ sreda%
+ \or%
+ \v cetvrtak%
+ \or%
+ petak%
+ \or%
+ subota%
+ \or%
+ nedelja%
+ \fi%
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\DTMserbianlatinmonthname}
-% Serbian month names. (Latin alphabet.)
+%\begin{macro}{\DTMserbianlatekWeekdayname}
+% Serbian weekday names, Latin alphabet, Ekavian pronunciation, capitalized
% \begin{macrocode}
-\newcommand*{\DTMserbianlatinmonthname}[1]{%
+\newcommand*{\DTMserbianlatekWeekdayname}[1]{%
\ifcase#1
- \or
- januar%
- \or
- februar%
- \or
- mart%
- \or
- april%
- \or
- maj%
- \or
- juni%
- \or
- juli%
- \or
- avgust%
- \or
- septembar%
- \or
- oktobar%
- \or
- novembar%
- \or
- decembar%
+ Ponedeljak%
+ \or%
+ Utorak%
+ \or%
+ Sreda%
+ \or%
+ \v Cetvrtak%
+ \or%
+ Petak%
+ \or%
+ Subota%
+ \or%
+ Nedelja%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\subsubsection{Latin days of week, Ijekavian pronunciation}
+%
+%
+%\begin{macro}{\DTMserbianlatijweekdayname}
+% Serbian weekday names, Latin alphabet, Ijekavian pronunciation,
+% non-capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbianlatijweekdayname}[1]{%
+ \ifcase#1
+ ponedjeljak%
+ \or%
+ utorak%
+ \or%
+ srijeda%
+ \or%
+ \v cetvrtak%
+ \or%
+ petak%
+ \or%
+ subota%
+ \or%
+ nedjelja%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbianlatijWeekdayname}
+% Serbian weekday names, Latin alphabet, Ijekavian pronunciation,
+% capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbianlatijWeekdayname}[1]{%
+ \ifcase#1
+ Ponedjeljak%
+ \or%
+ Utorak%
+ \or%
+ Srijeda%
+ \or%
+ \v Cetvrtak%
+ \or%
+ Petak%
+ \or%
+ Subota%
+ \or%
+ Nedjelja%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\subsubsection{Cyrillic month names}
+%
+%\begin{macro}{\DTMserbiancyrnoimonthname}
+% Serbian month names, Cyrillic alphabet, no \sty{i} suffix for June and July,
+% non-capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrnoimonthname}[1]{%
+ \ifcase#1
+ \or%
+ \cyrje\cyra\cyrn\cyru\cyra\cyrr%
+ \or%
+ \cyrf\cyre\cyrb\cyrr\cyru\cyra\cyrr%
+ \or%
+ \cyrm\cyra\cyrr\cyrt%
+ \or%
+ \cyra\cyrp\cyrr\cyri\cyrl%
+ \or%
+ \cyrm\cyra\cyrje%
+ \or%
+ \cyrje\cyru\cyrn%
+ \or%
+ \cyrje\cyru\cyrl%
+ \or%
+ \cyra\cyrv\cyrg\cyru\cyrs\cyrt%
+ \or%
+ \cyrs\cyre\cyrp\cyrt\cyre\cyrm\cyrb\cyra\cyrr%
+ \or%
+ \cyro\cyrk\cyrt\cyro\cyrb\cyra\cyrr%
+ \or%
+ \cyrn\cyro\cyrv\cyre\cyrm\cyrb\cyra\cyrr%
+ \or%
+ \cyrd\cyre\cyrc\cyre\cyrm\cyrb\cyra\cyrr%
\fi
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\DTMserbianlatinMonthname}
-% As above but capitalize.
+%\begin{macro}{\DTMserbiancyrnoiMonthname}
+% Serbian month names, Cyrillic alphabet, no \sty{i} suffix for June and July,
+% capitalized.
% \begin{macrocode}
-\newcommand*{\DTMserbianlatinMonthname}[1]{%
+\newcommand*{\DTMserbiancyrnoiMonthname}[1]{%
\ifcase#1
- \or
- Januar%
- \or
- Februar%
- \or
- Mart%
- \or
- April%
- \or
- Maj%
- \or
- Juni%
- \or
- Juli%
- \or
- Avgust%
- \or
- Septembar%
- \or
- Oktobar%
- \or
- Novembar%
- \or
- Decembar%
+ \or%
+ \CYRJE\cyra\cyrn\cyru\cyra\cyrr%
+ \or%
+ \CYRF\cyre\cyrb\cyrr\cyru\cyra\cyrr%
+ \or%
+ \CYRM\cyra\cyrr\cyrt%
+ \or%
+ \CYRA\cyrp\cyrr\cyri\cyrl%
+ \or%
+ \CYRM\cyra\cyrje%
+ \or%
+ \CYRJE\cyru\cyrn%
+ \or%
+ \CYRJE\cyru\cyrl%
+ \or%
+ \CYRA\cyrv\cyrg\cyru\cyrs\cyrt%
+ \or%
+ \CYRS\cyre\cyrp\cyrt\cyre\cyrm\cyrb\cyra\cyrr%
+ \or%
+ \CYRO\cyrk\cyrt\cyro\cyrb\cyra\cyrr%
+ \or%
+ \CYRN\cyro\cyrv\cyre\cyrm\cyrb\cyra\cyrr%
+ \or%
+ \CYRD\cyre\cyrc\cyre\cyrm\cyrb\cyra\cyrr%
\fi
}
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\DTMserbiancyrimonthname}
+% Serbian month names, Cyrillic alphabet, \sty{i} suffix for June and July,
+% non-capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrimonthname}[1]{%
+ \ifnum#1=6%
+ \cyrje\cyru\cyrn\cyri%
+ \else\ifnum\#1=7%
+ \cyrje\cyru\cyrl\cyri%
+ \else
+ \DTMserbiancyrnoimonthname%
+ \fi\fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancyriMonthname}
+% Serbian month names, Cyrillic alphabet, \sty{i} suffix for June and July,
+% capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyriMonthname}[1]{%
+ \ifnum#1=6%
+ \CYRJE\cyru\cyrn\cyri%
+ \else\ifnum\#1=7%
+ \CYRJE\cyru\cyrl\cyri%
+ \else
+ \DTMserbiancyrnoimonthname%
+ \fi\fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\subsubsection{Cyrillic days of week, Ekavian pronunciation}
+%
+%\begin{macro}{\DTMserbiancyrekweekdayname}
+% Serbian weekday names, Cyrillic alphabet, Ekavian pronunciation,
+% non-capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrekweekdayname}[1]{%
+ \ifcase#1
+ \cyrp\cyro\cyrn\cyre\cyrd\cyre\cyrlje\cyra\cyrk%
+ \or%
+ \cyru\cyrt\cyro\cyrr\cyra\cyrk%
+ \or%
+ \cyrs\cyrr\cyre\cyrd\cyra%
+ \or%
+ \cyrch\cyre\cyrt\cyrv\cyrr\cyrt\cyra\cyrk%
+ \or%
+ \cyrp\cyre\cyrt\cyra\cyrk%
+ \or%
+ \cyrs\cyru\cyrb\cyro\cyrt\cyra%
+ \or%
+ \cyrn\cyre\cyrd\cyre\cyrlje\cyra%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancyrekWeekdayname}
+% Serbian weekday names, Cyrillic alphabet, Ekavian pronunciation, capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrekWeekdayname}[1]{%
+ \ifcase#1
+ \CYRP\cyro\cyrn\cyre\cyrd\cyre\cyrlje\cyra\cyrk%
+ \or%
+ \CYRU\cyrt\cyro\cyrr\cyra\cyrk%
+ \or%
+ \CYRS\cyrr\cyre\cyrd\cyra%
+ \or%
+ \CYRCH\cyre\cyrt\cyrv\cyrr\cyrt\cyra\cyrk%
+ \or%
+ \CYRP\cyre\cyrt\cyra\cyrk%
+ \or%
+ \CYRS\cyru\cyrb\cyro\cyrt\cyra%
+ \or%
+ \CYRN\cyre\cyrd\cyre\cyrlje\cyra%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\subsubsection{Cyrillic days of week, Ijekavian pronunciation}
+%
+%
+%\begin{macro}{\DTMserbiancyrijweekdayname}
+% Serbian weekday names, Cyrillic alphabet, Ijekavian pronunciation,
+% non-capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrijweekdayname}[1]{%
+ \ifcase#1
+ \cyrp\cyro\cyrn\cyre\cyrd\cyrje\cyre\cyrlje\cyra\cyrk%
+ \or%
+ \cyru\cyrt\cyro\cyrr\cyra\cyrk%
+ \or%
+ \cyrs\cyrr\cyri\cyrje\cyre\cyrd\cyra%
+ \or%
+ \cyrch\cyre\cyrt\cyrv\cyrr\cyrt\cyra\cyrk%
+ \or%
+ \cyrp\cyre\cyrt\cyra\cyrk%
+ \or%
+ \cyrs\cyru\cyrb\cyro\cyrt\cyra%
+ \or%
+ \cyrn\cyre\cyrd\cyrje\cyre\cyrlje\cyra%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancyrijWeekdayname}
+% Serbian weekday names, Cyrillic alphabet, Ijekavian pronunciation,
+% capitalized
+% \begin{macrocode}
+\newcommand*{\DTMserbiancyrijWeekdayname}[1]{%
+ \ifcase#1
+ \CYRP\cyro\cyrn\cyre\cyrd\cyrje\cyre\cyrlje\cyra\cyrk%
+ \or%
+ \CYRU\cyrt\cyro\cyrr\cyra\cyrk%
+ \or%
+ \CYRS\cyrr\cyri\cyrje\cyre\cyrd\cyra%
+ \or%
+ \CYRCH\cyre\cyrt\cyrv\cyrr\cyrt\cyra\cyrk%
+ \or%
+ \CYRP\cyre\cyrt\cyra\cyrk%
+ \or%
+ \CYRS\cyru\cyrb\cyro\cyrt\cyra%
+ \or%
+ \CYRN\cyre\cyrd\cyrje\cyre\cyrlje\cyra%
+ \fi%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%
%\iffalse
% \begin{macrocode}
-%</datetime2-serbian-ascii.ldf>
+%</datetime2-serbian-base-ascii.ldf>
% \end{macrocode}
%\fi
%
-%\subsection{Main Serbian Module (\texttt{datetime2-serbian.ldf})}
-%\changes{1.0}{2015-03-31}{Initial release}
%
%\iffalse
% \begin{macrocode}
@@ -470,44 +1524,48 @@
% \end{macrocode}
%\fi
%
-% Identify Module
+%\subsection{Serbian \sty{serbian} Code
+% (\texttt{datetime2-serbian.ldf})}
+%\changes{1.0}{2015-03-24}{Initial release}
+%\changes{2.0}{2019-11-07}{%
+% Added regions, all settings made available to regions so all changes can be
+% region-specific.
+%}
% \begin{macrocode}
-\ProvidesDateTimeModule{serbian}[2019/09/14 v1.0]
+\ProvidesDateTimeModule{serbian}[2019/11/07 v2.0]
% \end{macrocode}
-% Need to find out if XeTeX or LuaTeX are being used.
+%\changes{2.0}{2019-11-07}{%
+% All localization strings loaded from base module.
+%}
+%
+% Load base Serbian module.
% \begin{macrocode}
-\RequirePackage{ifxetex,ifluatex}
+\RequireDateTimeModule{serbian-base}
% \end{macrocode}
-% XeTeX and LuaTeX natively support UTF-8, so load
-% \texttt{serbian-utf8} if either of those engines are used
-% otherwise load \texttt{serbian-ascii}.
+%
+%\subsubsection{Defining the \sty{serbian} style}
+%
+% Allow the user a way of configuring the "serbian" and
+% "serbian-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}{\DTMserbiandowdaysep}
+% The separator between weekday and day.
% \begin{macrocode}
-\ifxetex
- \RequireDateTimeModule{serbian-utf8}
-\else
- \ifluatex
- \RequireDateTimeModule{serbian-utf8}
- \else
- \RequireDateTimeModule{serbian-ascii}
- \fi
-\fi
+\newcommand*{\DTMserbiandowdaysep}{,\space}
% \end{macrocode}
+%\end{macro}
%
-% Define the \texttt{serbian} style.
-% The time style is the same as the "default" style
-% provided by \sty{datetime2}. This may need correcting. For
-% example, if a 12 hour style similar to the "englishampm" (from the
-% "english-base" module) is required.
%
-% Allow the user a way of configuring the "serbian" and
-% "serbian-numeric" styles. This doesn't use the package wide
-% separators such as
-% \cs{dtm@datetimesep} in case other date formats are also required.
%\begin{macro}{\DTMserbiandaymonthsep}
% The separator between the day and month for the text format.
% \begin{macrocode}
\newcommand*{\DTMserbiandaymonthsep}{%
- \DTMtexorpdfstring{\protect~}{\space}%
+ \DTMtexorpdfstring{\protect~}{\space}%
}
% \end{macrocode}
%\end{macro}
@@ -520,16 +1578,16 @@
%\end{macro}
%
%\begin{macro}{\DTMserbiandatetimesep}
-% The separator between the date and time blocks in the full format
-% (either text or numeric).
+% The separator between the date and time blocks in the full format (either
+% text or numeric).
% \begin{macrocode}
\newcommand*{\DTMserbiandatetimesep}{\space}
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMserbiantimezonesep}
-% The separator between the time and zone blocks in the full format
-% (either text or numeric).
+% The separator between the time and zone blocks in the full format (either
+% text or numeric).
% \begin{macrocode}
\newcommand*{\DTMserbiantimezonesep}{\space}
% \end{macrocode}
@@ -549,44 +1607,144 @@
% \end{macrocode}
%\end{macro}
%
-%Provide keys that can be used in \cs{DTMlangsetup} to set these
-%separators.
+%Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
% \begin{macrocode}
-\DTMdefkey{serbian}{daymonthsep}{\renewcommand*{\DTMserbiandaymonthsep}{#1}}
-\DTMdefkey{serbian}{monthyearsep}{\renewcommand*{\DTMserbianmonthyearsep}{#1}}
-\DTMdefkey{serbian}{datetimesep}{\renewcommand*{\DTMserbiandatetimesep}{#1}}
-\DTMdefkey{serbian}{timezonesep}{\renewcommand*{\DTMserbiantimezonesep}{#1}}
-\DTMdefkey{serbian}{datesep}{\renewcommand*{\DTMserbiandatesep}{#1}}
-\DTMdefkey{serbian}{timesep}{\renewcommand*{\DTMserbiantimesep}{#1}}
+\DTMdefkey{serbian}{dowdaysep}%
+ {\renewcommand*{\DTMserbiandowdaysep}{#1}}
+\DTMdefkey{serbian}{daymonthsep}%
+ {\renewcommand*{\DTMserbiandaymonthsep}{#1}}
+\DTMdefkey{serbian}{monthyearsep}%
+ {\renewcommand*{\DTMserbianmonthyearsep}{#1}}
+\DTMdefkey{serbian}{datetimesep}%
+ {\renewcommand*{\DTMserbiandatetimesep}{#1}}
+\DTMdefkey{serbian}{timezonesep}%
+ {\renewcommand*{\DTMserbiantimezonesep}{#1}}
+\DTMdefkey{serbian}{datesep}%
+ {\renewcommand*{\DTMserbiandatesep}{#1}}
+\DTMdefkey{serbian}{timesep}%
+ {\renewcommand*{\DTMserbiantimesep}{#1}}
% \end{macrocode}
%
-%\begin{macro}{\DTMserbianmonthname}
-% Provide a way to switch between Latin and Cyrillic month names.
+%\subsubsection{Switches and settings}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+%\begin{macro}{\DTMserbianweekdayname}
+% Define the weekday name, lowercase.
% \begin{macrocode}
-\newcommand*{\DTMserbianmonthname}{\DTMserbiancyrmonthname}
+\newcommand*{\DTMserbianweekdayname}%
+{\DTMserbianlatekweekdayname}
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\DTMserbianMonthname}
+
+%\begin{macro}{\DTMserbianweekdayname}
+% Define the weekday name, capitalized.
% \begin{macrocode}
-\newcommand*{\DTMserbianMonthname}{\DTMserbiancyrMonthname}
+\newcommand*{\DTMserbianWeekdayname}%
+ {\DTMserbianlatekWeekdayname}
% \end{macrocode}
%\end{macro}
%
+% Provide a way to switch between Ekavian and Ijekavian pronunciation.
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch between Ekavian and Ijekavian pronunciation.
+%}
+%
% \begin{macrocode}
-\DTMdefchoicekey{serbian}{alphabet}[\val\nr]{cyrillic,latin}{%
- \ifcase\nr\relax
- \renewcommand*{\DTMserbianmonthname}{\DTMserbiancyrmonthname}%
- \renewcommand*{\DTMserbianMonthname}{\DTMserbiancyrMonthname}%
- \or
- \renewcommand*{\DTMserbianmonthname}{\DTMserbianlatinmonthname}%
- \renewcommand*{\DTMserbianMonthname}{\DTMserbianlatinMonthname}%
- \fi
+\DTMdefchoicekey{serbian}%
+ {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMserbianweekdayname}%
+ {\DTMserbianlatekweekdayname}%
+ \renewcommand*{\DTMserbianWeekdayname}%
+ {\DTMserbianlatekWeekdayname}%
+ \or%
+ \renewcommand*{\DTMserbianweekdayname}%
+ {\DTMserbianlatijweekdayname}%
+ \renewcommand*{\DTMserbianWeekdayname}
+ {\DTMserbianlatijWeekdayname}%
+ \fi
}
% \end{macrocode}
%
-% TODO: provide a boolean key to switch between full and abbreviated
-% formats if appropriate. (I don't know how the date should be
-% abbreviated.)
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch June, July alternate spellings.
+%}
+% Define a boolean key that can switch between (jun, jul) and (juni, juli)
+% month spellings.
+% \begin{macrocode}
+\DTMdefboolkey{serbian}{monthi}[true]{}
+% \end{macrocode}
+% The default is without the "i" suffix.
+% \begin{macrocode}
+\DTMsetbool{serbian}{monthi}{false}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch for adding leading zeroes in day and month ordinals.
+%}
+% Define a boolean key that determines if the day and month ordinals should
+% have leading zeroes.
+% \begin{macrocode}
+\DTMdefboolkey{serbian}{leadingzero}[true]{}
+% \end{macrocode}
+% The default is to omit the leading zero.
+% \begin{macrocode}
+\DTMsetbool{serbian}{leadingzero}{false}
+% \end{macrocode}
+%
+%
+%
+%\begin{macro}{\DTMserbiandayordinal}
+% Define the day ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMserbiandayordinal}[1]{%
+ \DTMifbool{serbian}{leadingzero}%
+ {\DTMtwodigits{#1}}%
+ {\number#1}\DTMserbiandatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbianyearordinal}
+% Define the year ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMserbianyearordinal}[1]{%
+ \number#1\DTMserbiandatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.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).
+%}
+%
+% Define the month names.
+%
+%\begin{macro}{\DTMserbiannoimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMserbiannoimonthname}{\DTMserbianlatnoimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiannoiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMserbiannoiMonthname}{\DTMserbianlatnoiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbianimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMserbianimonthname}{\DTMserbianlatimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbianiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMserbianiMonthname}{\DTMserbianlatiMonthname}
+% \end{macrocode}
+%\end{macro}
%
% Define a boolean key that determines if the time zone mappings
% should be used.
@@ -617,137 +1775,222 @@
% \begin{macrocode}
\DTMsetbool{serbian}{showyear}{true}
% \end{macrocode}
-%
-% Define the "serbian" style. (TODO: implement day of week?)
-% \begin{macrocode}
-\DTMnewstyle
- {serbian}% label
- {% date style
- \renewcommand*\DTMdisplaydate[4]{%
- \DTMifbool{serbian}{showdayofmonth}
- {\DTMserbianordinal{##3}\DTMserbiandaymonthsep}%
- {}%
- \DTMserbianmonthname{##2}%
- \DTMifbool{serbian}{showyear}%
- {%
- \DTMserbianmonthyearsep
- \number##1
- }%
- {}%
- }%
- \renewcommand*\DTMDisplaydate[4]{%
- \DTMifbool{serbian}{showdayofmonth}
- {%
- \DTMserbianordinal{##3}\DTMserbiandaymonthsep
- \DTMserbianmonthname{##2}%
- }%
- {%
- \DTMserbianMonthname{##2}%
- }%
- \DTMifbool{serbian}{showyear}%
- {%
- \DTMserbianmonthyearsep
- \number##1
- }%
- {}%
- }%
- }%
- {% time style (use default)
- \DTMsettimestyle{default}%
- }%
- {% zone style
- \DTMresetzones
- \DTMserbianzonemaps
- \renewcommand*{\DTMdisplayzone}[2]{%
- \DTMifbool{serbian}{mapzone}%
- {\DTMusezonemapordefault{##1}{##2}}%
- {%
- \ifnum##1<0 \else+\fi\DTMtwodigits{##1}%
- \ifDTMshowzoneminutes\DTMserbiantimesep\DTMtwodigits{##2}\fi
- }%
- }%
- }%
- {% full style
- \renewcommand*{\DTMdisplay}[9]{%
- \ifDTMshowdate
- \DTMdisplaydate{##1}{##2}{##3}{##4}%
- \DTMserbiandatetimesep
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% \begin{macrocode}
+\DTMnewstyle%
+{serbian}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMserbianweekdayname{##4}%
+ \DTMserbiandowdaysep%
+ \fi
+ \fi
+ \DTMifbool{serbian}{showdayofmonth}
+ {\DTMserbiandayordinal{##3}\DTMserbiandaymonthsep}%
+ {}%
+ \DTMifbool{serbian}{monthi}%
+ {\DTMserbianimonthname{##2}}%
+ {\DTMserbiannoimonthname{##2}}%
+ \DTMifbool{serbian}{showyear}%
+ {%
+ \DTMserbianmonthyearsep%
+ \DTMserbianyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMserbianWeekdayname{##4}%
+ \DTMserbiandowdaysep%
+ \fi
+ \fi
+ \DTMifbool{serbian}{showdayofmonth}
+ {%
+ \DTMserbiandayordinal{##3}\DTMserbiandaymonthsep%
+ \DTMifbool{serbian}{monthi}%
+ {\DTMserbianimonthname{##2}}%
+ {\DTMserbiannoimonthname{##2}}%
+ }%
+ {%
+ \DTMifbool{serbian}{monthi}%
+ {\DTMserbianiMonthname{##2}}%
+ {\DTMserbiannoiMonthname{##2}}%
+ }%
+ \DTMifbool{serbian}{showyear}%
+ {%
+ \DTMserbianmonthyearsep%
+ \DTMserbianyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{serbian}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMserbiantimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMserbiantimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMserbianzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{serbian}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMserbiantimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMserbiandatetimesep%
\fi
\DTMdisplaytime{##5}{##6}{##7}%
- \ifDTMshowzone
- \DTMserbiantimezonesep
- \DTMdisplayzone{##8}{##9}%
+ \ifDTMshowzone%
+ \DTMserbiantimezonesep%
+ \DTMdisplayzone{##8}{##9}%
\fi
- }%
- \renewcommand*{\DTMDisplay}[9]{%
- \ifDTMshowdate
- \DTMDisplaydate{##1}{##2}{##3}{##4}%
- \DTMserbiandatetimesep
+ }%
+ \renewcommand*{\DTMDisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMDisplaydate{##1}{##2}{##3}{##4}%
+ \DTMserbiandatetimesep%
\fi
\DTMdisplaytime{##5}{##6}{##7}%
- \ifDTMshowzone
- \DTMserbiantimezonesep
- \DTMdisplayzone{##8}{##9}%
+ \ifDTMshowzone%
+ \DTMserbiantimezonesep%
+ \DTMdisplayzone{##8}{##9}%
\fi
- }%
- }%
+ }%
+}%
+% \end{macrocode}
+%
+%
+%\begin{macro}{\DTMserbianmonthordinal}
+% Define the month ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMserbianmonthordinal}[1]{%
+ \DTMifbool{serbian}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch between multiple numeric month ordinal formats used in
+% Serbian.
+%}
+% Define a setting to switch between Arabic, uppercase Roman and lowercase
+% smallcaps Roman month format for the "serbian-numeric" style.
+% \begin{macrocode}
+\DTMdefchoicekey{serbian}{monthord}%
+[\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMserbianmonthordinal}[1]{%
+ \DTMifbool{serbian}{leadingzero}%
+ {\DTMtwodigits{##1}}{\number##1}\DTMserbiandatesep}%
+ \or%
+ \renewcommand*{\DTMserbianmonthordinal}[1]{%
+ \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
+ {serbianordinalROMAN{##1}}}%
+ \or%
+ \renewcommand*{\DTMserbianmonthordinal}[1]{%
+ \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
+ {serbianordinalROMAN{##1}}}%
+ \fi
+}
% \end{macrocode}
%
+%\changes{2.0}{2019-11-07}{%
+% Fixed the (previously entirely wrong) numeric date style.
+%}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
% Define numeric style.
% \begin{macrocode}
-\DTMnewstyle
- {serbian-numeric}% label
- {% date style
- \renewcommand*\DTMdisplaydate[4]{%
- \DTMifbool{serbian}{showdayofmonth}%
- {%
- \number##3 % space intended
- \DTMserbiandatesep
- }%
- {}%
- \number##2 % space intended
- \DTMifbool{serbian}{showyear}%
- {%
- \DTMserbiandatesep
- \number##1 % space intended
- }%
- {}%
+\DTMnewstyle%
+{serbian-numeric}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMserbianweekdayname{##4}%
+ \DTMserbiandowdaysep%
+ \fi
+ \fi
+ \DTMifbool{serbian}{showdayofmonth}%
+ {\DTMserbiandayordinal{##3}\DTMserbiandaymonthsep}%
+ {}%
+ \DTMserbianmonthordinal{##2}%
+ \DTMifbool{serbian}{showyear}%
+ {%
+ \DTMserbianmonthyearsep%
+ \DTMserbianyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMserbianWeekdayname{##4}%
+ \DTMserbiandowdaysep%
+ \fi
+ \fi
+ \DTMifbool{serbian}{showdayofmonth}%
+ {\DTMserbiandayordinal{##3}\DTMserbiandaymonthsep}%
+ {}%
+ \DTMserbianmonthordinal{##2}%
+ \DTMifbool{serbian}{showyear}%
+ {%
+ \DTMserbianmonthyearsep%
+ \DTMserbianyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{serbian}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMserbiantimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMserbiantimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMserbianzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{serbian}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMserbiantimesep\DTMtwodigits{##2}\fi
}%
- \renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}%
- }%
- {% time style
- \renewcommand*\DTMdisplaytime[3]{%
- \number##1
- \DTMserbiantimesep\DTMtwodigits{##2}%
- \ifDTMshowseconds\DTMserbiantimesep\DTMtwodigits{##3}\fi
- }%
- }%
- {% zone style
- \DTMresetzones
- \DTMserbianzonemaps
- \renewcommand*{\DTMdisplayzone}[2]{%
- \DTMifbool{serbian}{mapzone}%
- {\DTMusezonemapordefault{##1}{##2}}%
- {%
- \ifnum##1<0 \else+\fi\DTMtwodigits{##1}%
- \ifDTMshowzoneminutes\DTMserbiantimesep\DTMtwodigits{##2}\fi
- }%
- }%
- }%
- {% full style
- \renewcommand*{\DTMdisplay}[9]{%
- \ifDTMshowdate
- \DTMdisplaydate{##1}{##2}{##3}{##4}%
- \DTMserbiandatetimesep
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMserbiandatetimesep%
\fi
\DTMdisplaytime{##5}{##6}{##7}%
- \ifDTMshowzone
- \DTMserbiantimezonesep
- \DTMdisplayzone{##8}{##9}%
+ \ifDTMshowzone%
+ \DTMserbiantimezonesep%
+ \DTMdisplayzone{##8}{##9}%
\fi
- }%
- \renewcommand*{\DTMDisplay}{\DTMdisplay}%
- }
+ }%
+ \renewcommand*{\DTMDisplay}{\DTMdisplay}%
+}
% \end{macrocode}
%
%\begin{macro}{\DTMserbianzonemaps}
@@ -764,25 +2007,28 @@
% Switch style according to the \opt{useregional} setting.
% \begin{macrocode}
-\DTMifcaseregional
+\DTMifcaseregional%
{}% do nothing
-{\DTMsetstyle{serbian}}
-{\DTMsetstyle{serbian-numeric}}
+{\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}{%
+% Added regions.
+%}
% \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{%
- \ifundef\dateserbian
+ \ifundef\dateserbian%
{% do nothing
}%
{%
\def\dateserbian{%
- \DTMifcaseregional
+ \DTMifcaseregional%
{}% do nothing
{\DTMsetstyle{serbian}}%
{\DTMsetstyle{serbian-numeric}}%
@@ -791,17 +2037,4819 @@
}%
{%
\csdef{date\CurrentTrackedDialect}{%
- \DTMifcaseregional
+ \DTMifcaseregional%
{}% do nothing
{\DTMsetstyle{serbian}}%
{\DTMsetstyle{serbian-numeric}}%
}%
}%
% \end{macrocode}
+%
%\iffalse
% \begin{macrocode}
%</datetime2-serbian.ldf>
% \end{macrocode}
%\fi
+%
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-sr-Latn.ldf>
+% \end{macrocode}
+%\fi
+%
+%\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}{%
+% Added regions, all settings made available to regions so all changes can be
+% region-specific.
+%}
+% \begin{macrocode}
+\ProvidesDateTimeModule{sr-Latn}[2019/11/07 v2.0]
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% All localization strings loaded from base module.
+%}
+%
+% Load base Serbian module.
+% \begin{macrocode}
+\RequireDateTimeModule{serbian-base}
+% \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
+% 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}
+\newcommand*{\DTMsrLatndowdaysep}{,\space}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMsrLatndaymonthsep}
+% The separator between the day and month for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatndaymonthsep}{%
+ \DTMtexorpdfstring{\protect~}{\space}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnmonthyearsep}
+% The separator between the month and year for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnmonthyearsep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatndatetimesep}
+% The separator between the date and time blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrLatndatetimesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatntimezonesep}
+% The separator between the time and zone blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrLatntimezonesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatndatesep}
+% The separator for the numeric date format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatndatesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatntimesep}
+% The separator for the numeric time format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatntimesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
+% \begin{macrocode}
+\DTMdefkey{sr-Latn}{dowdaysep}%
+ {\renewcommand*{\DTMsr-Latndowdaysep}{#1}}
+\DTMdefkey{sr-Latn}{daymonthsep}%
+ {\renewcommand*{\DTMsr-Latndaymonthsep}{#1}}
+\DTMdefkey{sr-Latn}{monthyearsep}%
+ {\renewcommand*{\DTMsr-Latnmonthyearsep}{#1}}
+\DTMdefkey{sr-Latn}{datetimesep}%
+ {\renewcommand*{\DTMsr-Latndatetimesep}{#1}}
+\DTMdefkey{sr-Latn}{timezonesep}%
+ {\renewcommand*{\DTMsr-Latntimezonesep}{#1}}
+\DTMdefkey{sr-Latn}{datesep}%
+ {\renewcommand*{\DTMsr-Latndatesep}{#1}}
+\DTMdefkey{sr-Latn}{timesep}%
+ {\renewcommand*{\DTMsr-Latntimesep}{#1}}
+% \end{macrocode}
+%
+%\subsubsection{Switches and settings}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+%\begin{macro}{\DTMsrLatnweekdayname}
+% Define the weekday name, lowercase.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnweekdayname}%
+{\DTMserbianlatekweekdayname}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\DTMsrLatnweekdayname}
+% Define the weekday name, capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnWeekdayname}%
+ {\DTMserbianlatekWeekdayname}
+% \end{macrocode}
+%\end{macro}
+%
+% Provide a way to switch between Ekavian and Ijekavian pronunciation.
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch between Ekavian and Ijekavian pronunciation.
+%}
+%
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Latn}%
+ {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrLatnweekdayname}%
+ {\DTMserbianlatekweekdayname}%
+ \renewcommand*{\DTMsrLatnWeekdayname}%
+ {\DTMserbianlatekWeekdayname}%
+ \or%
+ \renewcommand*{\DTMsrLatnweekdayname}%
+ {\DTMserbianlatijweekdayname}%
+ \renewcommand*{\DTMsrLatnWeekdayname}
+ {\DTMserbianlatijWeekdayname}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch June, July alternate spellings.
+%}
+% Define a boolean key that can switch between (jun, jul) and (juni, juli)
+% month spellings.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn}{monthi}[true]{}
+% \end{macrocode}
+% The default is without the "i" suffix.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn}{monthi}{false}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch for adding leading zeroes in day and month ordinals.
+%}
+% Define a boolean key that determines if the day and month ordinals should
+% have leading zeroes.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn}{leadingzero}[true]{}
+% \end{macrocode}
+% The default is to omit the leading zero.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn}{leadingzero}{false}
+% \end{macrocode}
+%
+%
+%
+%\begin{macro}{\DTMsrLatndayordinal}
+% Define the day ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatndayordinal}[1]{%
+ \DTMifbool{sr-Latn}{leadingzero}%
+ {\DTMtwodigits{#1}}%
+ {\number#1}\DTMsrLatndatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnyearordinal}
+% Define the year ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatnyearordinal}[1]{%
+ \number#1\DTMsrLatndatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.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).
+%}
+%
+% Define the month names.
+%
+%\begin{macro}{\DTMsrLatnnoimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnnoimonthname}{\DTMserbianlatnoimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnnoiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnnoiMonthname}{\DTMserbianlatnoiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnimonthname}{\DTMserbianlatimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatniMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatniMonthname}{\DTMserbianlatiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+% Define a boolean key that determines if the time zone mappings
+% should be used.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn}{mapzone}[true]{}
+% \end{macrocode}
+% The default is to use mappings.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn}{mapzone}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the day of month should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn}{showdayofmonth}[true]{}
+% \end{macrocode}
+% The default is to show the day of month.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn}{showdayofmonth}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the year should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn}{showyear}[true]{}
+% \end{macrocode}
+% The default is to show the year.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn}{showyear}{true}
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Latn}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnweekdayname{##4}%
+ \DTMsrLatndowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn}{showdayofmonth}
+ {\DTMsrLatndayordinal{##3}\DTMsrLatndaymonthsep}%
+ {}%
+ \DTMifbool{sr-Latn}{monthi}%
+ {\DTMsrLatnimonthname{##2}}%
+ {\DTMsrLatnnoimonthname{##2}}%
+ \DTMifbool{sr-Latn}{showyear}%
+ {%
+ \DTMsrLatnmonthyearsep%
+ \DTMsrLatnyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnWeekdayname{##4}%
+ \DTMsrLatndowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn}{showdayofmonth}
+ {%
+ \DTMsrLatndayordinal{##3}\DTMsrLatndaymonthsep%
+ \DTMifbool{sr-Latn}{monthi}%
+ {\DTMsrLatnimonthname{##2}}%
+ {\DTMsrLatnnoimonthname{##2}}%
+ }%
+ {%
+ \DTMifbool{sr-Latn}{monthi}%
+ {\DTMsrLatniMonthname{##2}}%
+ {\DTMsrLatnnoiMonthname{##2}}%
+ }%
+ \DTMifbool{sr-Latn}{showyear}%
+ {%
+ \DTMsrLatnmonthyearsep%
+ \DTMsrLatnyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Latn}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrLatntimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrLatntimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrLatnzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Latn}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrLatntimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatndatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatntimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMDisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatndatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatntimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+}%
+% \end{macrocode}
+%
+%
+%\begin{macro}{\DTMsrLatnmonthordinal}
+% Define the month ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatnmonthordinal}[1]{%
+ \DTMifbool{sr-Latn}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch between multiple numeric month ordinal formats used in
+% Serbian.
+%}
+% Define a setting to switch between Arabic, uppercase Roman and lowercase
+% smallcaps Roman month format for the "srLatn-numeric" style.
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Latn}{monthord}%
+[\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrLatnmonthordinal}[1]{%
+ \DTMifbool{sr-Latn}{leadingzero}%
+ {\DTMtwodigits{##1}}{\number##1}\DTMsrLatndatesep}%
+ \or%
+ \renewcommand*{\DTMsrLatnmonthordinal}[1]{%
+ \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
+ {serbianordinalROMAN{##1}}}%
+ \or%
+ \renewcommand*{\DTMsrLatnmonthordinal}[1]{%
+ \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
+ {serbianordinalROMAN{##1}}}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Fixed the (previously entirely wrong) numeric date style.
+%}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% Define numeric style.
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Latn-numeric}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnweekdayname{##4}%
+ \DTMsrLatndowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn}{showdayofmonth}%
+ {\DTMsrLatndayordinal{##3}\DTMsrLatndaymonthsep}%
+ {}%
+ \DTMsrLatnmonthordinal{##2}%
+ \DTMifbool{sr-Latn}{showyear}%
+ {%
+ \DTMsrLatnmonthyearsep%
+ \DTMsrLatnyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnWeekdayname{##4}%
+ \DTMsrLatndowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn}{showdayofmonth}%
+ {\DTMsrLatndayordinal{##3}\DTMsrLatndaymonthsep}%
+ {}%
+ \DTMsrLatnmonthordinal{##2}%
+ \DTMifbool{sr-Latn}{showyear}%
+ {%
+ \DTMsrLatnmonthyearsep%
+ \DTMsrLatnyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Latn}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrLatntimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrLatntimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrLatnzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Latn}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrLatntimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatndatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatntimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}{\DTMdisplay}%
+}
+% \end{macrocode}
+%
+%\begin{macro}{\DTMsr-Latnzonemaps}
+% The time zone mappings are set through this command, which can be
+% redefined if extra mappings are required or mappings need to be
+% removed.
+% \begin{macrocode}
+\newcommand*{\DTMsr-Latnzonemaps}{%
+ \DTMdefzonemap{01}{00}{CET}%
+ \DTMdefzonemap{02}{00}{CEST}%
+}
+% \end{macrocode}
+%\end{macro}
+
+% Switch style according to the \opt{useregional} setting.
+% \begin{macrocode}
+\DTMifcaseregional%
+{}% do nothing
+{\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}{%
+% Added regions.
+%}
+% \begin{macrocode}
+\ifcsundef{date\CurrentTrackedDialect}
+{%
+ \ifundef\dateserbian%
+ {% do nothing
+ }%
+ {%
+ \def\dateserbian{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Latn}}%
+ {\DTMsetstyle{sr-Latn-numeric}}%
+ }%
+ }%
+}%
+{%
+ \csdef{date\CurrentTrackedDialect}{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Latn}}%
+ {\DTMsetstyle{sr-Latn-numeric}}%
+ }%
+}%
+% \end{macrocode}
+%
+%\iffalse
+% \begin{macrocode}
+%</datetime2-sr-Latn.ldf>
+% \end{macrocode}
+%\fi
+%
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-sr-Latn-RS.ldf>
+% \end{macrocode}
+%\fi
+%
+%\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}{%
+% Added regions, all settings made available to regions so all changes can be
+% region-specific.
+%}
+% \begin{macrocode}
+\ProvidesDateTimeModule{sr-Latn-RS}[2019/11/07 v2.0]
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% All localization strings loaded from base module.
+%}
+%
+% Load base Serbian module.
+% \begin{macrocode}
+\RequireDateTimeModule{serbian-base}
+% \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
+% 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}
+\newcommand*{\DTMsrLatnRSdowdaysep}{,\space}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMsrLatnRSdaymonthsep}
+% The separator between the day and month for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRSdaymonthsep}{%
+ \DTMtexorpdfstring{\protect~}{\space}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnRSmonthyearsep}
+% The separator between the month and year for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRSmonthyearsep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnRSdatetimesep}
+% The separator between the date and time blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRSdatetimesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnRStimezonesep}
+% The separator between the time and zone blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRStimezonesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnRSdatesep}
+% The separator for the numeric date format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRSdatesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnRStimesep}
+% The separator for the numeric time format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRStimesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
+% \begin{macrocode}
+\DTMdefkey{sr-Latn-RS}{dowdaysep}%
+ {\renewcommand*{\DTMsr-Latn-RSdowdaysep}{#1}}
+\DTMdefkey{sr-Latn-RS}{daymonthsep}%
+ {\renewcommand*{\DTMsr-Latn-RSdaymonthsep}{#1}}
+\DTMdefkey{sr-Latn-RS}{monthyearsep}%
+ {\renewcommand*{\DTMsr-Latn-RSmonthyearsep}{#1}}
+\DTMdefkey{sr-Latn-RS}{datetimesep}%
+ {\renewcommand*{\DTMsr-Latn-RSdatetimesep}{#1}}
+\DTMdefkey{sr-Latn-RS}{timezonesep}%
+ {\renewcommand*{\DTMsr-Latn-RStimezonesep}{#1}}
+\DTMdefkey{sr-Latn-RS}{datesep}%
+ {\renewcommand*{\DTMsr-Latn-RSdatesep}{#1}}
+\DTMdefkey{sr-Latn-RS}{timesep}%
+ {\renewcommand*{\DTMsr-Latn-RStimesep}{#1}}
+% \end{macrocode}
+%
+%\subsubsection{Switches and settings}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+%\begin{macro}{\DTMsrLatnRSweekdayname}
+% Define the weekday name, lowercase.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRSweekdayname}%
+{\DTMserbianlatekweekdayname}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\DTMsrLatnRSweekdayname}
+% Define the weekday name, capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRSWeekdayname}%
+ {\DTMserbianlatekWeekdayname}
+% \end{macrocode}
+%\end{macro}
+%
+% Provide a way to switch between Ekavian and Ijekavian pronunciation.
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch between Ekavian and Ijekavian pronunciation.
+%}
+%
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Latn-RS}%
+ {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrLatnRSweekdayname}%
+ {\DTMserbianlatekweekdayname}%
+ \renewcommand*{\DTMsrLatnRSWeekdayname}%
+ {\DTMserbianlatekWeekdayname}%
+ \or%
+ \renewcommand*{\DTMsrLatnRSweekdayname}%
+ {\DTMserbianlatijweekdayname}%
+ \renewcommand*{\DTMsrLatnRSWeekdayname}
+ {\DTMserbianlatijWeekdayname}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch June, July alternate spellings.
+%}
+% Define a boolean key that can switch between (jun, jul) and (juni, juli)
+% month spellings.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-RS}{monthi}[true]{}
+% \end{macrocode}
+% The default is without the "i" suffix.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-RS}{monthi}{false}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch for adding leading zeroes in day and month ordinals.
+%}
+% Define a boolean key that determines if the day and month ordinals should
+% have leading zeroes.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-RS}{leadingzero}[true]{}
+% \end{macrocode}
+% The default is to omit the leading zero.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-RS}{leadingzero}{false}
+% \end{macrocode}
+%
+%
+%
+%\begin{macro}{\DTMsrLatnRSdayordinal}
+% Define the day ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatnRSdayordinal}[1]{%
+ \DTMifbool{sr-Latn-RS}{leadingzero}%
+ {\DTMtwodigits{#1}}%
+ {\number#1}\DTMsrLatnRSdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnRSyearordinal}
+% Define the year ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatnRSyearordinal}[1]{%
+ \number#1\DTMsrLatnRSdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.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).
+%}
+%
+% Define the month names.
+%
+%\begin{macro}{\DTMsrLatnRSnoimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRSnoimonthname}{\DTMserbianlatnoimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnRSnoiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRSnoiMonthname}{\DTMserbianlatnoiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnRSimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRSimonthname}{\DTMserbianlatimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnRSiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnRSiMonthname}{\DTMserbianlatiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+% Define a boolean key that determines if the time zone mappings
+% should be used.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-RS}{mapzone}[true]{}
+% \end{macrocode}
+% The default is to use mappings.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-RS}{mapzone}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the day of month should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-RS}{showdayofmonth}[true]{}
+% \end{macrocode}
+% The default is to show the day of month.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-RS}{showdayofmonth}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the year should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-RS}{showyear}[true]{}
+% \end{macrocode}
+% The default is to show the year.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-RS}{showyear}{true}
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Latn-RS}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnRSweekdayname{##4}%
+ \DTMsrLatnRSdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-RS}{showdayofmonth}
+ {\DTMsrLatnRSdayordinal{##3}\DTMsrLatnRSdaymonthsep}%
+ {}%
+ \DTMifbool{sr-Latn-RS}{monthi}%
+ {\DTMsrLatnRSimonthname{##2}}%
+ {\DTMsrLatnRSnoimonthname{##2}}%
+ \DTMifbool{sr-Latn-RS}{showyear}%
+ {%
+ \DTMsrLatnRSmonthyearsep%
+ \DTMsrLatnRSyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnRSWeekdayname{##4}%
+ \DTMsrLatnRSdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-RS}{showdayofmonth}
+ {%
+ \DTMsrLatnRSdayordinal{##3}\DTMsrLatnRSdaymonthsep%
+ \DTMifbool{sr-Latn-RS}{monthi}%
+ {\DTMsrLatnRSimonthname{##2}}%
+ {\DTMsrLatnRSnoimonthname{##2}}%
+ }%
+ {%
+ \DTMifbool{sr-Latn-RS}{monthi}%
+ {\DTMsrLatnRSiMonthname{##2}}%
+ {\DTMsrLatnRSnoiMonthname{##2}}%
+ }%
+ \DTMifbool{sr-Latn-RS}{showyear}%
+ {%
+ \DTMsrLatnRSmonthyearsep%
+ \DTMsrLatnRSyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Latn-RS}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrLatnRStimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrLatnRStimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrLatnRSzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Latn-RS}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrLatnRStimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatnRSdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatnRStimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMDisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatnRSdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatnRStimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+}%
+% \end{macrocode}
+%
+%
+%\begin{macro}{\DTMsrLatnRSmonthordinal}
+% Define the month ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatnRSmonthordinal}[1]{%
+ \DTMifbool{sr-Latn-RS}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch between multiple numeric month ordinal formats used in
+% Serbian.
+%}
+% Define a setting to switch between Arabic, uppercase Roman and lowercase
+% smallcaps Roman month format for the "srLatnRS-numeric" style.
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Latn-RS}{monthord}%
+[\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrLatnRSmonthordinal}[1]{%
+ \DTMifbool{sr-Latn-RS}{leadingzero}%
+ {\DTMtwodigits{##1}}{\number##1}\DTMsrLatnRSdatesep}%
+ \or%
+ \renewcommand*{\DTMsrLatnRSmonthordinal}[1]{%
+ \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
+ {serbianordinalROMAN{##1}}}%
+ \or%
+ \renewcommand*{\DTMsrLatnRSmonthordinal}[1]{%
+ \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
+ {serbianordinalROMAN{##1}}}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Fixed the (previously entirely wrong) numeric date style.
+%}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% Define numeric style.
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Latn-RS-numeric}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnRSweekdayname{##4}%
+ \DTMsrLatnRSdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-RS}{showdayofmonth}%
+ {\DTMsrLatnRSdayordinal{##3}\DTMsrLatnRSdaymonthsep}%
+ {}%
+ \DTMsrLatnRSmonthordinal{##2}%
+ \DTMifbool{sr-Latn-RS}{showyear}%
+ {%
+ \DTMsrLatnRSmonthyearsep%
+ \DTMsrLatnRSyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnRSWeekdayname{##4}%
+ \DTMsrLatnRSdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-RS}{showdayofmonth}%
+ {\DTMsrLatnRSdayordinal{##3}\DTMsrLatnRSdaymonthsep}%
+ {}%
+ \DTMsrLatnRSmonthordinal{##2}%
+ \DTMifbool{sr-Latn-RS}{showyear}%
+ {%
+ \DTMsrLatnRSmonthyearsep%
+ \DTMsrLatnRSyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Latn-RS}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrLatnRStimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrLatnRStimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrLatnRSzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Latn-RS}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrLatnRStimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatnRSdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatnRStimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}{\DTMdisplay}%
+}
+% \end{macrocode}
+%
+%\begin{macro}{\DTMsr-Latn-RSzonemaps}
+% The time zone mappings are set through this command, which can be
+% redefined if extra mappings are required or mappings need to be
+% removed.
+% \begin{macrocode}
+\newcommand*{\DTMsr-Latn-RSzonemaps}{%
+ \DTMdefzonemap{01}{00}{CET}%
+ \DTMdefzonemap{02}{00}{CEST}%
+}
+% \end{macrocode}
+%\end{macro}
+
+% Switch style according to the \opt{useregional} setting.
+% \begin{macrocode}
+\DTMifcaseregional%
+{}% do nothing
+{\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}{%
+% Added regions.
+%}
+% \begin{macrocode}
+\ifcsundef{date\CurrentTrackedDialect}
+{%
+ \ifundef\dateserbian%
+ {% do nothing
+ }%
+ {%
+ \def\dateserbian{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Latn-RS}}%
+ {\DTMsetstyle{sr-Latn-RS-numeric}}%
+ }%
+ }%
+}%
+{%
+ \csdef{date\CurrentTrackedDialect}{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Latn-RS}}%
+ {\DTMsetstyle{sr-Latn-RS-numeric}}%
+ }%
+}%
+% \end{macrocode}
+%
+%\iffalse
+% \begin{macrocode}
+%</datetime2-sr-Latn-RS.ldf>
+% \end{macrocode}
+%\fi
+%
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-sr-Latn-ME.ldf>
+% \end{macrocode}
+%\fi
+%
+%\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}{%
+% Added regions, all settings made available to regions so all changes can be
+% region-specific.
+%}
+% \begin{macrocode}
+\ProvidesDateTimeModule{sr-Latn-ME}[2019/11/07 v2.0]
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% All localization strings loaded from base module.
+%}
+%
+% Load base Serbian module.
+% \begin{macrocode}
+\RequireDateTimeModule{serbian-base}
+% \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
+% 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}
+\newcommand*{\DTMsrLatnMEdowdaysep}{,\space}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMsrLatnMEdaymonthsep}
+% The separator between the day and month for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEdaymonthsep}{%
+ \DTMtexorpdfstring{\protect~}{\space}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnMEmonthyearsep}
+% The separator between the month and year for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEmonthyearsep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnMEdatetimesep}
+% The separator between the date and time blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEdatetimesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnMEtimezonesep}
+% The separator between the time and zone blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEtimezonesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnMEdatesep}
+% The separator for the numeric date format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEdatesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnMEtimesep}
+% The separator for the numeric time format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEtimesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
+% \begin{macrocode}
+\DTMdefkey{sr-Latn-ME}{dowdaysep}%
+ {\renewcommand*{\DTMsr-Latn-MEdowdaysep}{#1}}
+\DTMdefkey{sr-Latn-ME}{daymonthsep}%
+ {\renewcommand*{\DTMsr-Latn-MEdaymonthsep}{#1}}
+\DTMdefkey{sr-Latn-ME}{monthyearsep}%
+ {\renewcommand*{\DTMsr-Latn-MEmonthyearsep}{#1}}
+\DTMdefkey{sr-Latn-ME}{datetimesep}%
+ {\renewcommand*{\DTMsr-Latn-MEdatetimesep}{#1}}
+\DTMdefkey{sr-Latn-ME}{timezonesep}%
+ {\renewcommand*{\DTMsr-Latn-MEtimezonesep}{#1}}
+\DTMdefkey{sr-Latn-ME}{datesep}%
+ {\renewcommand*{\DTMsr-Latn-MEdatesep}{#1}}
+\DTMdefkey{sr-Latn-ME}{timesep}%
+ {\renewcommand*{\DTMsr-Latn-MEtimesep}{#1}}
+% \end{macrocode}
+%
+%\subsubsection{Switches and settings}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+%\begin{macro}{\DTMsrLatnMEweekdayname}
+% Define the weekday name, lowercase.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEweekdayname}%
+{\DTMserbianlatijweekdayname}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\DTMsrLatnMEweekdayname}
+% Define the weekday name, capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEWeekdayname}%
+ {\DTMserbianlatijWeekdayname}
+% \end{macrocode}
+%\end{macro}
+%
+% Provide a way to switch between Ekavian and Ijekavian pronunciation.
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch between Ekavian and Ijekavian pronunciation.
+%}
+%
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Latn-ME}%
+ {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrLatnMEweekdayname}%
+ {\DTMserbianlatekweekdayname}%
+ \renewcommand*{\DTMsrLatnMEWeekdayname}%
+ {\DTMserbianlatekWeekdayname}%
+ \or%
+ \renewcommand*{\DTMsrLatnMEweekdayname}%
+ {\DTMserbianlatijweekdayname}%
+ \renewcommand*{\DTMsrLatnMEWeekdayname}
+ {\DTMserbianlatijWeekdayname}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch June, July alternate spellings.
+%}
+% Define a boolean key that can switch between (jun, jul) and (juni, juli)
+% month spellings.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-ME}{monthi}[true]{}
+% \end{macrocode}
+% The default is without the "i" suffix.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-ME}{monthi}{false}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch for adding leading zeroes in day and month ordinals.
+%}
+% Define a boolean key that determines if the day and month ordinals should
+% have leading zeroes.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-ME}{leadingzero}[true]{}
+% \end{macrocode}
+% The default is to omit the leading zero.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-ME}{leadingzero}{false}
+% \end{macrocode}
+%
+%
+%
+%\begin{macro}{\DTMsrLatnMEdayordinal}
+% Define the day ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatnMEdayordinal}[1]{%
+ \DTMifbool{sr-Latn-ME}{leadingzero}%
+ {\DTMtwodigits{#1}}%
+ {\number#1}\DTMsrLatnMEdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnMEyearordinal}
+% Define the year ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatnMEyearordinal}[1]{%
+ \number#1\DTMsrLatnMEdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.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).
+%}
+%
+% Define the month names.
+%
+%\begin{macro}{\DTMsrLatnMEnoimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEnoimonthname}{\DTMserbianlatnoimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnMEnoiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEnoiMonthname}{\DTMserbianlatnoiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnMEimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEimonthname}{\DTMserbianlatimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnMEiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnMEiMonthname}{\DTMserbianlatiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+% Define a boolean key that determines if the time zone mappings
+% should be used.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-ME}{mapzone}[true]{}
+% \end{macrocode}
+% The default is to use mappings.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-ME}{mapzone}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the day of month should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-ME}{showdayofmonth}[true]{}
+% \end{macrocode}
+% The default is to show the day of month.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-ME}{showdayofmonth}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the year should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-ME}{showyear}[true]{}
+% \end{macrocode}
+% The default is to show the year.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-ME}{showyear}{true}
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Latn-ME}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnMEweekdayname{##4}%
+ \DTMsrLatnMEdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-ME}{showdayofmonth}
+ {\DTMsrLatnMEdayordinal{##3}\DTMsrLatnMEdaymonthsep}%
+ {}%
+ \DTMifbool{sr-Latn-ME}{monthi}%
+ {\DTMsrLatnMEimonthname{##2}}%
+ {\DTMsrLatnMEnoimonthname{##2}}%
+ \DTMifbool{sr-Latn-ME}{showyear}%
+ {%
+ \DTMsrLatnMEmonthyearsep%
+ \DTMsrLatnMEyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnMEWeekdayname{##4}%
+ \DTMsrLatnMEdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-ME}{showdayofmonth}
+ {%
+ \DTMsrLatnMEdayordinal{##3}\DTMsrLatnMEdaymonthsep%
+ \DTMifbool{sr-Latn-ME}{monthi}%
+ {\DTMsrLatnMEimonthname{##2}}%
+ {\DTMsrLatnMEnoimonthname{##2}}%
+ }%
+ {%
+ \DTMifbool{sr-Latn-ME}{monthi}%
+ {\DTMsrLatnMEiMonthname{##2}}%
+ {\DTMsrLatnMEnoiMonthname{##2}}%
+ }%
+ \DTMifbool{sr-Latn-ME}{showyear}%
+ {%
+ \DTMsrLatnMEmonthyearsep%
+ \DTMsrLatnMEyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Latn-ME}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrLatnMEtimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrLatnMEtimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrLatnMEzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Latn-ME}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrLatnMEtimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatnMEdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatnMEtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMDisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatnMEdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatnMEtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+}%
+% \end{macrocode}
+%
+%
+%\begin{macro}{\DTMsrLatnMEmonthordinal}
+% Define the month ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatnMEmonthordinal}[1]{%
+ \DTMifbool{sr-Latn-ME}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch between multiple numeric month ordinal formats used in
+% Serbian.
+%}
+% Define a setting to switch between Arabic, uppercase Roman and lowercase
+% smallcaps Roman month format for the "srLatnME-numeric" style.
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Latn-ME}{monthord}%
+[\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrLatnMEmonthordinal}[1]{%
+ \DTMifbool{sr-Latn-ME}{leadingzero}%
+ {\DTMtwodigits{##1}}{\number##1}\DTMsrLatnMEdatesep}%
+ \or%
+ \renewcommand*{\DTMsrLatnMEmonthordinal}[1]{%
+ \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
+ {serbianordinalROMAN{##1}}}%
+ \or%
+ \renewcommand*{\DTMsrLatnMEmonthordinal}[1]{%
+ \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
+ {serbianordinalROMAN{##1}}}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Fixed the (previously entirely wrong) numeric date style.
+%}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% Define numeric style.
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Latn-ME-numeric}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnMEweekdayname{##4}%
+ \DTMsrLatnMEdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-ME}{showdayofmonth}%
+ {\DTMsrLatnMEdayordinal{##3}\DTMsrLatnMEdaymonthsep}%
+ {}%
+ \DTMsrLatnMEmonthordinal{##2}%
+ \DTMifbool{sr-Latn-ME}{showyear}%
+ {%
+ \DTMsrLatnMEmonthyearsep%
+ \DTMsrLatnMEyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnMEWeekdayname{##4}%
+ \DTMsrLatnMEdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-ME}{showdayofmonth}%
+ {\DTMsrLatnMEdayordinal{##3}\DTMsrLatnMEdaymonthsep}%
+ {}%
+ \DTMsrLatnMEmonthordinal{##2}%
+ \DTMifbool{sr-Latn-ME}{showyear}%
+ {%
+ \DTMsrLatnMEmonthyearsep%
+ \DTMsrLatnMEyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Latn-ME}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrLatnMEtimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrLatnMEtimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrLatnMEzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Latn-ME}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrLatnMEtimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatnMEdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatnMEtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}{\DTMdisplay}%
+}
+% \end{macrocode}
+%
+%\begin{macro}{\DTMsr-Latn-MEzonemaps}
+% The time zone mappings are set through this command, which can be
+% redefined if extra mappings are required or mappings need to be
+% removed.
+% \begin{macrocode}
+\newcommand*{\DTMsr-Latn-MEzonemaps}{%
+ \DTMdefzonemap{01}{00}{CET}%
+ \DTMdefzonemap{02}{00}{CEST}%
+}
+% \end{macrocode}
+%\end{macro}
+
+% Switch style according to the \opt{useregional} setting.
+% \begin{macrocode}
+\DTMifcaseregional%
+{}% do nothing
+{\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}{%
+% Added regions.
+%}
+% \begin{macrocode}
+\ifcsundef{date\CurrentTrackedDialect}
+{%
+ \ifundef\dateserbian%
+ {% do nothing
+ }%
+ {%
+ \def\dateserbian{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Latn-ME}}%
+ {\DTMsetstyle{sr-Latn-ME-numeric}}%
+ }%
+ }%
+}%
+{%
+ \csdef{date\CurrentTrackedDialect}{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Latn-ME}}%
+ {\DTMsetstyle{sr-Latn-ME-numeric}}%
+ }%
+}%
+% \end{macrocode}
+%
+%\iffalse
+% \begin{macrocode}
+%</datetime2-sr-Latn-ME.ldf>
+% \end{macrocode}
+%\fi
+%
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-sr-Latn-BA.ldf>
+% \end{macrocode}
+%\fi
+%
+%\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}{%
+% Added regions, all settings made available to regions so all changes can be
+% region-specific.
+%}
+% \begin{macrocode}
+\ProvidesDateTimeModule{sr-Latn-BA}[2019/11/07 v2.0]
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% All localization strings loaded from base module.
+%}
+%
+% Load base Serbian module.
+% \begin{macrocode}
+\RequireDateTimeModule{serbian-base}
+% \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
+% 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}
+\newcommand*{\DTMsrLatnBAdowdaysep}{,\space}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMsrLatnBAdaymonthsep}
+% The separator between the day and month for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAdaymonthsep}{%
+ \DTMtexorpdfstring{\protect~}{\space}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnBAmonthyearsep}
+% The separator between the month and year for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAmonthyearsep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnBAdatetimesep}
+% The separator between the date and time blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAdatetimesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnBAtimezonesep}
+% The separator between the time and zone blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAtimezonesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnBAdatesep}
+% The separator for the numeric date format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAdatesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnBAtimesep}
+% The separator for the numeric time format.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAtimesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
+% \begin{macrocode}
+\DTMdefkey{sr-Latn-BA}{dowdaysep}%
+ {\renewcommand*{\DTMsr-Latn-BAdowdaysep}{#1}}
+\DTMdefkey{sr-Latn-BA}{daymonthsep}%
+ {\renewcommand*{\DTMsr-Latn-BAdaymonthsep}{#1}}
+\DTMdefkey{sr-Latn-BA}{monthyearsep}%
+ {\renewcommand*{\DTMsr-Latn-BAmonthyearsep}{#1}}
+\DTMdefkey{sr-Latn-BA}{datetimesep}%
+ {\renewcommand*{\DTMsr-Latn-BAdatetimesep}{#1}}
+\DTMdefkey{sr-Latn-BA}{timezonesep}%
+ {\renewcommand*{\DTMsr-Latn-BAtimezonesep}{#1}}
+\DTMdefkey{sr-Latn-BA}{datesep}%
+ {\renewcommand*{\DTMsr-Latn-BAdatesep}{#1}}
+\DTMdefkey{sr-Latn-BA}{timesep}%
+ {\renewcommand*{\DTMsr-Latn-BAtimesep}{#1}}
+% \end{macrocode}
+%
+%\subsubsection{Switches and settings}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+%\begin{macro}{\DTMsrLatnBAweekdayname}
+% Define the weekday name, lowercase.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAweekdayname}%
+{\DTMserbianlatijweekdayname}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\DTMsrLatnBAweekdayname}
+% Define the weekday name, capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAWeekdayname}%
+ {\DTMserbianlatijWeekdayname}
+% \end{macrocode}
+%\end{macro}
+%
+% Provide a way to switch between Ekavian and Ijekavian pronunciation.
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch between Ekavian and Ijekavian pronunciation.
+%}
+%
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Latn-BA}%
+ {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrLatnBAweekdayname}%
+ {\DTMserbianlatekweekdayname}%
+ \renewcommand*{\DTMsrLatnBAWeekdayname}%
+ {\DTMserbianlatekWeekdayname}%
+ \or%
+ \renewcommand*{\DTMsrLatnBAweekdayname}%
+ {\DTMserbianlatijweekdayname}%
+ \renewcommand*{\DTMsrLatnBAWeekdayname}
+ {\DTMserbianlatijWeekdayname}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch June, July alternate spellings.
+%}
+% Define a boolean key that can switch between (jun, jul) and (juni, juli)
+% month spellings.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-BA}{monthi}[true]{}
+% \end{macrocode}
+% The default is without the "i" suffix.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-BA}{monthi}{false}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch for adding leading zeroes in day and month ordinals.
+%}
+% Define a boolean key that determines if the day and month ordinals should
+% have leading zeroes.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-BA}{leadingzero}[true]{}
+% \end{macrocode}
+% The default is to omit the leading zero.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-BA}{leadingzero}{false}
+% \end{macrocode}
+%
+%
+%
+%\begin{macro}{\DTMsrLatnBAdayordinal}
+% Define the day ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatnBAdayordinal}[1]{%
+ \DTMifbool{sr-Latn-BA}{leadingzero}%
+ {\DTMtwodigits{#1}}%
+ {\number#1}\DTMsrLatnBAdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnBAyearordinal}
+% Define the year ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatnBAyearordinal}[1]{%
+ \number#1\DTMsrLatnBAdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.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).
+%}
+%
+% Define the month names.
+%
+%\begin{macro}{\DTMsrLatnBAnoimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAnoimonthname}{\DTMserbianlatnoimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnBAnoiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAnoiMonthname}{\DTMserbianlatnoiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnBAimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAimonthname}{\DTMserbianlatimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrLatnBAiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrLatnBAiMonthname}{\DTMserbianlatiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+% Define a boolean key that determines if the time zone mappings
+% should be used.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-BA}{mapzone}[true]{}
+% \end{macrocode}
+% The default is to use mappings.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-BA}{mapzone}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the day of month should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-BA}{showdayofmonth}[true]{}
+% \end{macrocode}
+% The default is to show the day of month.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-BA}{showdayofmonth}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the year should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Latn-BA}{showyear}[true]{}
+% \end{macrocode}
+% The default is to show the year.
+% \begin{macrocode}
+\DTMsetbool{sr-Latn-BA}{showyear}{true}
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Latn-BA}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnBAweekdayname{##4}%
+ \DTMsrLatnBAdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-BA}{showdayofmonth}
+ {\DTMsrLatnBAdayordinal{##3}\DTMsrLatnBAdaymonthsep}%
+ {}%
+ \DTMifbool{sr-Latn-BA}{monthi}%
+ {\DTMsrLatnBAimonthname{##2}}%
+ {\DTMsrLatnBAnoimonthname{##2}}%
+ \DTMifbool{sr-Latn-BA}{showyear}%
+ {%
+ \DTMsrLatnBAmonthyearsep%
+ \DTMsrLatnBAyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnBAWeekdayname{##4}%
+ \DTMsrLatnBAdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-BA}{showdayofmonth}
+ {%
+ \DTMsrLatnBAdayordinal{##3}\DTMsrLatnBAdaymonthsep%
+ \DTMifbool{sr-Latn-BA}{monthi}%
+ {\DTMsrLatnBAimonthname{##2}}%
+ {\DTMsrLatnBAnoimonthname{##2}}%
+ }%
+ {%
+ \DTMifbool{sr-Latn-BA}{monthi}%
+ {\DTMsrLatnBAiMonthname{##2}}%
+ {\DTMsrLatnBAnoiMonthname{##2}}%
+ }%
+ \DTMifbool{sr-Latn-BA}{showyear}%
+ {%
+ \DTMsrLatnBAmonthyearsep%
+ \DTMsrLatnBAyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Latn-BA}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrLatnBAtimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrLatnBAtimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrLatnBAzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Latn-BA}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrLatnBAtimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatnBAdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatnBAtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMDisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatnBAdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatnBAtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+}%
+% \end{macrocode}
+%
+%
+%\begin{macro}{\DTMsrLatnBAmonthordinal}
+% Define the month ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrLatnBAmonthordinal}[1]{%
+ \DTMifbool{sr-Latn-BA}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch between multiple numeric month ordinal formats used in
+% Serbian.
+%}
+% Define a setting to switch between Arabic, uppercase Roman and lowercase
+% smallcaps Roman month format for the "srLatnBA-numeric" style.
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Latn-BA}{monthord}%
+[\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrLatnBAmonthordinal}[1]{%
+ \DTMifbool{sr-Latn-BA}{leadingzero}%
+ {\DTMtwodigits{##1}}{\number##1}\DTMsrLatnBAdatesep}%
+ \or%
+ \renewcommand*{\DTMsrLatnBAmonthordinal}[1]{%
+ \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
+ {serbianordinalROMAN{##1}}}%
+ \or%
+ \renewcommand*{\DTMsrLatnBAmonthordinal}[1]{%
+ \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
+ {serbianordinalROMAN{##1}}}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Fixed the (previously entirely wrong) numeric date style.
+%}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% Define numeric style.
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Latn-BA-numeric}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnBAweekdayname{##4}%
+ \DTMsrLatnBAdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-BA}{showdayofmonth}%
+ {\DTMsrLatnBAdayordinal{##3}\DTMsrLatnBAdaymonthsep}%
+ {}%
+ \DTMsrLatnBAmonthordinal{##2}%
+ \DTMifbool{sr-Latn-BA}{showyear}%
+ {%
+ \DTMsrLatnBAmonthyearsep%
+ \DTMsrLatnBAyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrLatnBAWeekdayname{##4}%
+ \DTMsrLatnBAdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Latn-BA}{showdayofmonth}%
+ {\DTMsrLatnBAdayordinal{##3}\DTMsrLatnBAdaymonthsep}%
+ {}%
+ \DTMsrLatnBAmonthordinal{##2}%
+ \DTMifbool{sr-Latn-BA}{showyear}%
+ {%
+ \DTMsrLatnBAmonthyearsep%
+ \DTMsrLatnBAyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Latn-BA}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrLatnBAtimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrLatnBAtimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrLatnBAzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Latn-BA}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrLatnBAtimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrLatnBAdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrLatnBAtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}{\DTMdisplay}%
+}
+% \end{macrocode}
+%
+%\begin{macro}{\DTMsr-Latn-BAzonemaps}
+% The time zone mappings are set through this command, which can be
+% redefined if extra mappings are required or mappings need to be
+% removed.
+% \begin{macrocode}
+\newcommand*{\DTMsr-Latn-BAzonemaps}{%
+ \DTMdefzonemap{01}{00}{CET}%
+ \DTMdefzonemap{02}{00}{CEST}%
+}
+% \end{macrocode}
+%\end{macro}
+
+% Switch style according to the \opt{useregional} setting.
+% \begin{macrocode}
+\DTMifcaseregional%
+{}% do nothing
+{\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}{%
+% Added regions.
+%}
+% \begin{macrocode}
+\ifcsundef{date\CurrentTrackedDialect}
+{%
+ \ifundef\dateserbian%
+ {% do nothing
+ }%
+ {%
+ \def\dateserbian{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Latn-BA}}%
+ {\DTMsetstyle{sr-Latn-BA-numeric}}%
+ }%
+ }%
+}%
+{%
+ \csdef{date\CurrentTrackedDialect}{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Latn-BA}}%
+ {\DTMsetstyle{sr-Latn-BA-numeric}}%
+ }%
+}%
+% \end{macrocode}
+%
+%\iffalse
+% \begin{macrocode}
+%</datetime2-sr-Latn-BA.ldf>
+% \end{macrocode}
+%\fi
+%
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-serbianc.ldf>
+% \end{macrocode}
+%\fi
+%
+%\subsection{Serbian \sty{serbianc} Code
+% (\texttt{datetime2-serbianc.ldf})}
+%\changes{1.0}{2015-03-24}{Initial release}
+%\changes{2.0}{2019-11-07}{%
+% Added regions, all settings made available to regions so all changes can be
+% region-specific.
+%}
+% \begin{macrocode}
+\ProvidesDateTimeModule{serbianc}[2019/11/07 v2.0]
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% All localization strings loaded from base module.
+%}
+%
+% Load base Serbian module.
+% \begin{macrocode}
+\RequireDateTimeModule{serbian-base}
+% \end{macrocode}
+%
+%\subsubsection{Defining the \sty{serbianc} style}
+%
+% Allow the user a way of configuring the "serbianc" and
+% "serbianc-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}{\DTMserbiancdowdaysep}
+% The separator between weekday and day.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancdowdaysep}{,\space}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMserbiancdaymonthsep}
+% The separator between the day and month for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancdaymonthsep}{%
+ \DTMtexorpdfstring{\protect~}{\space}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancmonthyearsep}
+% The separator between the month and year for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancmonthyearsep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancdatetimesep}
+% The separator between the date and time blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMserbiancdatetimesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbianctimezonesep}
+% The separator between the time and zone blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMserbianctimezonesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancdatesep}
+% The separator for the numeric date format.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancdatesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbianctimesep}
+% The separator for the numeric time format.
+% \begin{macrocode}
+\newcommand*{\DTMserbianctimesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
+% \begin{macrocode}
+\DTMdefkey{serbianc}{dowdaysep}%
+ {\renewcommand*{\DTMserbiancdowdaysep}{#1}}
+\DTMdefkey{serbianc}{daymonthsep}%
+ {\renewcommand*{\DTMserbiancdaymonthsep}{#1}}
+\DTMdefkey{serbianc}{monthyearsep}%
+ {\renewcommand*{\DTMserbiancmonthyearsep}{#1}}
+\DTMdefkey{serbianc}{datetimesep}%
+ {\renewcommand*{\DTMserbiancdatetimesep}{#1}}
+\DTMdefkey{serbianc}{timezonesep}%
+ {\renewcommand*{\DTMserbianctimezonesep}{#1}}
+\DTMdefkey{serbianc}{datesep}%
+ {\renewcommand*{\DTMserbiancdatesep}{#1}}
+\DTMdefkey{serbianc}{timesep}%
+ {\renewcommand*{\DTMserbianctimesep}{#1}}
+% \end{macrocode}
+%
+%\subsubsection{Switches and settings}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+%\begin{macro}{\DTMserbiancweekdayname}
+% Define the weekday name, lowercase.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancweekdayname}%
+{\DTMserbiancyrekweekdayname}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\DTMserbiancweekdayname}
+% Define the weekday name, capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMserbiancWeekdayname}%
+ {\DTMserbiancyrekWeekdayname}
+% \end{macrocode}
+%\end{macro}
+%
+% Provide a way to switch between Ekavian and Ijekavian pronunciation.
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch between Ekavian and Ijekavian pronunciation.
+%}
+%
+% \begin{macrocode}
+\DTMdefchoicekey{serbianc}%
+ {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMserbiancweekdayname}%
+ {\DTMserbiancyrekweekdayname}%
+ \renewcommand*{\DTMserbiancWeekdayname}%
+ {\DTMserbiancyrekWeekdayname}%
+ \or%
+ \renewcommand*{\DTMserbiancweekdayname}%
+ {\DTMserbiancyrijweekdayname}%
+ \renewcommand*{\DTMserbiancWeekdayname}
+ {\DTMserbiancyrijWeekdayname}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch June, July alternate spellings.
+%}
+% Define a boolean key that can switch between (jun, jul) and (juni, juli)
+% month spellings.
+% \begin{macrocode}
+\DTMdefboolkey{serbianc}{monthi}[true]{}
+% \end{macrocode}
+% The default is without the "i" suffix.
+% \begin{macrocode}
+\DTMsetbool{serbianc}{monthi}{false}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch for adding leading zeroes in day and month ordinals.
+%}
+% Define a boolean key that determines if the day and month ordinals should
+% have leading zeroes.
+% \begin{macrocode}
+\DTMdefboolkey{serbianc}{leadingzero}[true]{}
+% \end{macrocode}
+% The default is to omit the leading zero.
+% \begin{macrocode}
+\DTMsetbool{serbianc}{leadingzero}{false}
+% \end{macrocode}
+%
+%
+%
+%\begin{macro}{\DTMserbiancdayordinal}
+% Define the day ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMserbiancdayordinal}[1]{%
+ \DTMifbool{serbianc}{leadingzero}%
+ {\DTMtwodigits{#1}}%
+ {\number#1}\DTMserbiancdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancyearordinal}
+% Define the year ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMserbiancyearordinal}[1]{%
+ \number#1\DTMserbiancdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.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).
+%}
+%
+% Define the month names.
+%
+%\begin{macro}{\DTMserbiancnoimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMserbiancnoimonthname}{\DTMserbiancyrnoimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancnoiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMserbiancnoiMonthname}{\DTMserbiancyrnoiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbiancimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMserbiancimonthname}{\DTMserbiancyrimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMserbianciMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMserbianciMonthname}{\DTMserbiancyriMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+% Define a boolean key that determines if the time zone mappings
+% should be used.
+% \begin{macrocode}
+\DTMdefboolkey{serbianc}{mapzone}[true]{}
+% \end{macrocode}
+% The default is to use mappings.
+% \begin{macrocode}
+\DTMsetbool{serbianc}{mapzone}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the day of month should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{serbianc}{showdayofmonth}[true]{}
+% \end{macrocode}
+% The default is to show the day of month.
+% \begin{macrocode}
+\DTMsetbool{serbianc}{showdayofmonth}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the year should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{serbianc}{showyear}[true]{}
+% \end{macrocode}
+% The default is to show the year.
+% \begin{macrocode}
+\DTMsetbool{serbianc}{showyear}{true}
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% \begin{macrocode}
+\DTMnewstyle%
+{serbianc}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMserbiancweekdayname{##4}%
+ \DTMserbiancdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{serbianc}{showdayofmonth}
+ {\DTMserbiancdayordinal{##3}\DTMserbiancdaymonthsep}%
+ {}%
+ \DTMifbool{serbianc}{monthi}%
+ {\DTMserbiancimonthname{##2}}%
+ {\DTMserbiancnoimonthname{##2}}%
+ \DTMifbool{serbianc}{showyear}%
+ {%
+ \DTMserbiancmonthyearsep%
+ \DTMserbiancyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMserbiancWeekdayname{##4}%
+ \DTMserbiancdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{serbianc}{showdayofmonth}
+ {%
+ \DTMserbiancdayordinal{##3}\DTMserbiancdaymonthsep%
+ \DTMifbool{serbianc}{monthi}%
+ {\DTMserbiancimonthname{##2}}%
+ {\DTMserbiancnoimonthname{##2}}%
+ }%
+ {%
+ \DTMifbool{serbianc}{monthi}%
+ {\DTMserbianciMonthname{##2}}%
+ {\DTMserbiancnoiMonthname{##2}}%
+ }%
+ \DTMifbool{serbianc}{showyear}%
+ {%
+ \DTMserbiancmonthyearsep%
+ \DTMserbiancyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{serbianc}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMserbianctimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMserbianctimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMserbianczonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{serbianc}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMserbianctimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMserbiancdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMserbianctimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMDisplaydate{##1}{##2}{##3}{##4}%
+ \DTMserbiancdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMserbianctimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+}%
+% \end{macrocode}
+%
+%
+%\begin{macro}{\DTMserbiancmonthordinal}
+% Define the month ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMserbiancmonthordinal}[1]{%
+ \DTMifbool{serbianc}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch between multiple numeric month ordinal formats used in
+% Serbian.
+%}
+% Define a setting to switch between Arabic, uppercase Roman and lowercase
+% smallcaps Roman month format for the "serbianc-numeric" style.
+% \begin{macrocode}
+\DTMdefchoicekey{serbianc}{monthord}%
+[\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMserbiancmonthordinal}[1]{%
+ \DTMifbool{serbianc}{leadingzero}%
+ {\DTMtwodigits{##1}}{\number##1}\DTMserbiancdatesep}%
+ \or%
+ \renewcommand*{\DTMserbiancmonthordinal}[1]{%
+ \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
+ {serbianordinalROMAN{##1}}}%
+ \or%
+ \renewcommand*{\DTMserbiancmonthordinal}[1]{%
+ \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
+ {serbianordinalROMAN{##1}}}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Fixed the (previously entirely wrong) numeric date style.
+%}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% Define numeric style.
+% \begin{macrocode}
+\DTMnewstyle%
+{serbianc-numeric}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMserbiancweekdayname{##4}%
+ \DTMserbiancdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{serbianc}{showdayofmonth}%
+ {\DTMserbiancdayordinal{##3}\DTMserbiancdaymonthsep}%
+ {}%
+ \DTMserbiancmonthordinal{##2}%
+ \DTMifbool{serbianc}{showyear}%
+ {%
+ \DTMserbiancmonthyearsep%
+ \DTMserbiancyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMserbiancWeekdayname{##4}%
+ \DTMserbiancdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{serbianc}{showdayofmonth}%
+ {\DTMserbiancdayordinal{##3}\DTMserbiancdaymonthsep}%
+ {}%
+ \DTMserbiancmonthordinal{##2}%
+ \DTMifbool{serbianc}{showyear}%
+ {%
+ \DTMserbiancmonthyearsep%
+ \DTMserbiancyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{serbianc}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMserbianctimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMserbianctimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMserbianczonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{serbianc}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMserbianctimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMserbiancdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMserbianctimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}{\DTMdisplay}%
+}
+% \end{macrocode}
+%
+%\begin{macro}{\DTMserbianczonemaps}
+% The time zone mappings are set through this command, which can be
+% redefined if extra mappings are required or mappings need to be
+% removed.
+% \begin{macrocode}
+\newcommand*{\DTMserbianczonemaps}{%
+ \DTMdefzonemap{01}{00}{CET}%
+ \DTMdefzonemap{02}{00}{CEST}%
+}
+% \end{macrocode}
+%\end{macro}
+
+% Switch style according to the \opt{useregional} setting.
+% \begin{macrocode}
+\DTMifcaseregional%
+{}% do nothing
+{\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}{%
+% Added regions.
+%}
+% \begin{macrocode}
+\ifcsundef{date\CurrentTrackedDialect}
+{%
+ \ifundef\dateserbianc%
+ {% do nothing
+ }%
+ {%
+ \def\dateserbianc{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{serbianc}}%
+ {\DTMsetstyle{serbianc-numeric}}%
+ }%
+ }%
+}%
+{%
+ \csdef{date\CurrentTrackedDialect}{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{serbianc}}%
+ {\DTMsetstyle{serbianc-numeric}}%
+ }%
+}%
+% \end{macrocode}
+%
+%\iffalse
+% \begin{macrocode}
+%</datetime2-serbianc.ldf>
+% \end{macrocode}
+%\fi
+%
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-sr-Cyrl.ldf>
+% \end{macrocode}
+%\fi
+%
+%\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}{%
+% Added regions, all settings made available to regions so all changes can be
+% region-specific.
+%}
+% \begin{macrocode}
+\ProvidesDateTimeModule{sr-Cyrl}[2019/11/07 v2.0]
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% All localization strings loaded from base module.
+%}
+%
+% Load base Serbian module.
+% \begin{macrocode}
+\RequireDateTimeModule{serbian-base}
+% \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
+% 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}
+\newcommand*{\DTMsrCyrldowdaysep}{,\space}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMsrCyrldaymonthsep}
+% The separator between the day and month for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrldaymonthsep}{%
+ \DTMtexorpdfstring{\protect~}{\space}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlmonthyearsep}
+% The separator between the month and year for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlmonthyearsep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrldatetimesep}
+% The separator between the date and time blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrldatetimesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrltimezonesep}
+% The separator between the time and zone blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrltimezonesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrldatesep}
+% The separator for the numeric date format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrldatesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrltimesep}
+% The separator for the numeric time format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrltimesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
+% \begin{macrocode}
+\DTMdefkey{sr-Cyrl}{dowdaysep}%
+ {\renewcommand*{\DTMsr-Cyrldowdaysep}{#1}}
+\DTMdefkey{sr-Cyrl}{daymonthsep}%
+ {\renewcommand*{\DTMsr-Cyrldaymonthsep}{#1}}
+\DTMdefkey{sr-Cyrl}{monthyearsep}%
+ {\renewcommand*{\DTMsr-Cyrlmonthyearsep}{#1}}
+\DTMdefkey{sr-Cyrl}{datetimesep}%
+ {\renewcommand*{\DTMsr-Cyrldatetimesep}{#1}}
+\DTMdefkey{sr-Cyrl}{timezonesep}%
+ {\renewcommand*{\DTMsr-Cyrltimezonesep}{#1}}
+\DTMdefkey{sr-Cyrl}{datesep}%
+ {\renewcommand*{\DTMsr-Cyrldatesep}{#1}}
+\DTMdefkey{sr-Cyrl}{timesep}%
+ {\renewcommand*{\DTMsr-Cyrltimesep}{#1}}
+% \end{macrocode}
+%
+%\subsubsection{Switches and settings}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+%\begin{macro}{\DTMsrCyrlweekdayname}
+% Define the weekday name, lowercase.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlweekdayname}%
+{\DTMserbiancyrekweekdayname}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\DTMsrCyrlweekdayname}
+% Define the weekday name, capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlWeekdayname}%
+ {\DTMserbiancyrekWeekdayname}
+% \end{macrocode}
+%\end{macro}
+%
+% Provide a way to switch between Ekavian and Ijekavian pronunciation.
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch between Ekavian and Ijekavian pronunciation.
+%}
+%
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Cyrl}%
+ {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrCyrlweekdayname}%
+ {\DTMserbiancyrekweekdayname}%
+ \renewcommand*{\DTMsrCyrlWeekdayname}%
+ {\DTMserbiancyrekWeekdayname}%
+ \or%
+ \renewcommand*{\DTMsrCyrlweekdayname}%
+ {\DTMserbiancyrijweekdayname}%
+ \renewcommand*{\DTMsrCyrlWeekdayname}
+ {\DTMserbiancyrijWeekdayname}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch June, July alternate spellings.
+%}
+% Define a boolean key that can switch between (jun, jul) and (juni, juli)
+% month spellings.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl}{monthi}[true]{}
+% \end{macrocode}
+% The default is without the "i" suffix.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl}{monthi}{false}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch for adding leading zeroes in day and month ordinals.
+%}
+% Define a boolean key that determines if the day and month ordinals should
+% have leading zeroes.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl}{leadingzero}[true]{}
+% \end{macrocode}
+% The default is to omit the leading zero.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl}{leadingzero}{false}
+% \end{macrocode}
+%
+%
+%
+%\begin{macro}{\DTMsrCyrldayordinal}
+% Define the day ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrldayordinal}[1]{%
+ \DTMifbool{sr-Cyrl}{leadingzero}%
+ {\DTMtwodigits{#1}}%
+ {\number#1}\DTMsrCyrldatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlyearordinal}
+% Define the year ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrlyearordinal}[1]{%
+ \number#1\DTMsrCyrldatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.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).
+%}
+%
+% Define the month names.
+%
+%\begin{macro}{\DTMsrCyrlnoimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlnoimonthname}{\DTMserbiancyrnoimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlnoiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlnoiMonthname}{\DTMserbiancyrnoiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlimonthname}{\DTMserbiancyrimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrliMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrliMonthname}{\DTMserbiancyriMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+% Define a boolean key that determines if the time zone mappings
+% should be used.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl}{mapzone}[true]{}
+% \end{macrocode}
+% The default is to use mappings.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl}{mapzone}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the day of month should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl}{showdayofmonth}[true]{}
+% \end{macrocode}
+% The default is to show the day of month.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl}{showdayofmonth}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the year should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl}{showyear}[true]{}
+% \end{macrocode}
+% The default is to show the year.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl}{showyear}{true}
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Cyrl}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlweekdayname{##4}%
+ \DTMsrCyrldowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl}{showdayofmonth}
+ {\DTMsrCyrldayordinal{##3}\DTMsrCyrldaymonthsep}%
+ {}%
+ \DTMifbool{sr-Cyrl}{monthi}%
+ {\DTMsrCyrlimonthname{##2}}%
+ {\DTMsrCyrlnoimonthname{##2}}%
+ \DTMifbool{sr-Cyrl}{showyear}%
+ {%
+ \DTMsrCyrlmonthyearsep%
+ \DTMsrCyrlyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlWeekdayname{##4}%
+ \DTMsrCyrldowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl}{showdayofmonth}
+ {%
+ \DTMsrCyrldayordinal{##3}\DTMsrCyrldaymonthsep%
+ \DTMifbool{sr-Cyrl}{monthi}%
+ {\DTMsrCyrlimonthname{##2}}%
+ {\DTMsrCyrlnoimonthname{##2}}%
+ }%
+ {%
+ \DTMifbool{sr-Cyrl}{monthi}%
+ {\DTMsrCyrliMonthname{##2}}%
+ {\DTMsrCyrlnoiMonthname{##2}}%
+ }%
+ \DTMifbool{sr-Cyrl}{showyear}%
+ {%
+ \DTMsrCyrlmonthyearsep%
+ \DTMsrCyrlyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Cyrl}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrCyrltimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrCyrltimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrCyrlzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Cyrl}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrCyrltimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrldatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrltimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMDisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrldatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrltimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+}%
+% \end{macrocode}
+%
+%
+%\begin{macro}{\DTMsrCyrlmonthordinal}
+% Define the month ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrlmonthordinal}[1]{%
+ \DTMifbool{sr-Cyrl}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch between multiple numeric month ordinal formats used in
+% Serbian.
+%}
+% Define a setting to switch between Arabic, uppercase Roman and lowercase
+% smallcaps Roman month format for the "srCyrl-numeric" style.
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Cyrl}{monthord}%
+[\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrCyrlmonthordinal}[1]{%
+ \DTMifbool{sr-Cyrl}{leadingzero}%
+ {\DTMtwodigits{##1}}{\number##1}\DTMsrCyrldatesep}%
+ \or%
+ \renewcommand*{\DTMsrCyrlmonthordinal}[1]{%
+ \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
+ {serbianordinalROMAN{##1}}}%
+ \or%
+ \renewcommand*{\DTMsrCyrlmonthordinal}[1]{%
+ \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
+ {serbianordinalROMAN{##1}}}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Fixed the (previously entirely wrong) numeric date style.
+%}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% Define numeric style.
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Cyrl-numeric}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlweekdayname{##4}%
+ \DTMsrCyrldowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl}{showdayofmonth}%
+ {\DTMsrCyrldayordinal{##3}\DTMsrCyrldaymonthsep}%
+ {}%
+ \DTMsrCyrlmonthordinal{##2}%
+ \DTMifbool{sr-Cyrl}{showyear}%
+ {%
+ \DTMsrCyrlmonthyearsep%
+ \DTMsrCyrlyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlWeekdayname{##4}%
+ \DTMsrCyrldowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl}{showdayofmonth}%
+ {\DTMsrCyrldayordinal{##3}\DTMsrCyrldaymonthsep}%
+ {}%
+ \DTMsrCyrlmonthordinal{##2}%
+ \DTMifbool{sr-Cyrl}{showyear}%
+ {%
+ \DTMsrCyrlmonthyearsep%
+ \DTMsrCyrlyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Cyrl}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrCyrltimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrCyrltimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrCyrlzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Cyrl}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrCyrltimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrldatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrltimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}{\DTMdisplay}%
+}
+% \end{macrocode}
+%
+%\begin{macro}{\DTMsr-Cyrlzonemaps}
+% The time zone mappings are set through this command, which can be
+% redefined if extra mappings are required or mappings need to be
+% removed.
+% \begin{macrocode}
+\newcommand*{\DTMsr-Cyrlzonemaps}{%
+ \DTMdefzonemap{01}{00}{CET}%
+ \DTMdefzonemap{02}{00}{CEST}%
+}
+% \end{macrocode}
+%\end{macro}
+
+% Switch style according to the \opt{useregional} setting.
+% \begin{macrocode}
+\DTMifcaseregional%
+{}% do nothing
+{\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}{%
+% Added regions.
+%}
+% \begin{macrocode}
+\ifcsundef{date\CurrentTrackedDialect}
+{%
+ \ifundef\dateserbianc%
+ {% do nothing
+ }%
+ {%
+ \def\dateserbianc{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Cyrl}}%
+ {\DTMsetstyle{sr-Cyrl-numeric}}%
+ }%
+ }%
+}%
+{%
+ \csdef{date\CurrentTrackedDialect}{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Cyrl}}%
+ {\DTMsetstyle{sr-Cyrl-numeric}}%
+ }%
+}%
+% \end{macrocode}
+%
+%\iffalse
+% \begin{macrocode}
+%</datetime2-sr-Cyrl.ldf>
+% \end{macrocode}
+%\fi
+%
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-sr-Cyrl-RS.ldf>
+% \end{macrocode}
+%\fi
+%
+%\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}{%
+% Added regions, all settings made available to regions so all changes can be
+% region-specific.
+%}
+% \begin{macrocode}
+\ProvidesDateTimeModule{sr-Cyrl-RS}[2019/11/07 v2.0]
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% All localization strings loaded from base module.
+%}
+%
+% Load base Serbian module.
+% \begin{macrocode}
+\RequireDateTimeModule{serbian-base}
+% \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
+% 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}
+\newcommand*{\DTMsrCyrlRSdowdaysep}{,\space}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMsrCyrlRSdaymonthsep}
+% The separator between the day and month for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRSdaymonthsep}{%
+ \DTMtexorpdfstring{\protect~}{\space}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlRSmonthyearsep}
+% The separator between the month and year for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRSmonthyearsep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlRSdatetimesep}
+% The separator between the date and time blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRSdatetimesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlRStimezonesep}
+% The separator between the time and zone blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRStimezonesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlRSdatesep}
+% The separator for the numeric date format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRSdatesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlRStimesep}
+% The separator for the numeric time format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRStimesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
+% \begin{macrocode}
+\DTMdefkey{sr-Cyrl-RS}{dowdaysep}%
+ {\renewcommand*{\DTMsr-Cyrl-RSdowdaysep}{#1}}
+\DTMdefkey{sr-Cyrl-RS}{daymonthsep}%
+ {\renewcommand*{\DTMsr-Cyrl-RSdaymonthsep}{#1}}
+\DTMdefkey{sr-Cyrl-RS}{monthyearsep}%
+ {\renewcommand*{\DTMsr-Cyrl-RSmonthyearsep}{#1}}
+\DTMdefkey{sr-Cyrl-RS}{datetimesep}%
+ {\renewcommand*{\DTMsr-Cyrl-RSdatetimesep}{#1}}
+\DTMdefkey{sr-Cyrl-RS}{timezonesep}%
+ {\renewcommand*{\DTMsr-Cyrl-RStimezonesep}{#1}}
+\DTMdefkey{sr-Cyrl-RS}{datesep}%
+ {\renewcommand*{\DTMsr-Cyrl-RSdatesep}{#1}}
+\DTMdefkey{sr-Cyrl-RS}{timesep}%
+ {\renewcommand*{\DTMsr-Cyrl-RStimesep}{#1}}
+% \end{macrocode}
+%
+%\subsubsection{Switches and settings}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+%\begin{macro}{\DTMsrCyrlRSweekdayname}
+% Define the weekday name, lowercase.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRSweekdayname}%
+{\DTMserbiancyrijweekdayname}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\DTMsrCyrlRSweekdayname}
+% Define the weekday name, capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRSWeekdayname}%
+ {\DTMserbiancyrijWeekdayname}
+% \end{macrocode}
+%\end{macro}
+%
+% Provide a way to switch between Ekavian and Ijekavian pronunciation.
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch between Ekavian and Ijekavian pronunciation.
+%}
+%
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Cyrl-RS}%
+ {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrCyrlRSweekdayname}%
+ {\DTMserbiancyrekweekdayname}%
+ \renewcommand*{\DTMsrCyrlRSWeekdayname}%
+ {\DTMserbiancyrekWeekdayname}%
+ \or%
+ \renewcommand*{\DTMsrCyrlRSweekdayname}%
+ {\DTMserbiancyrijweekdayname}%
+ \renewcommand*{\DTMsrCyrlRSWeekdayname}
+ {\DTMserbiancyrijWeekdayname}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch June, July alternate spellings.
+%}
+% Define a boolean key that can switch between (jun, jul) and (juni, juli)
+% month spellings.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-RS}{monthi}[true]{}
+% \end{macrocode}
+% The default is without the "i" suffix.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-RS}{monthi}{false}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch for adding leading zeroes in day and month ordinals.
+%}
+% Define a boolean key that determines if the day and month ordinals should
+% have leading zeroes.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-RS}{leadingzero}[true]{}
+% \end{macrocode}
+% The default is to omit the leading zero.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-RS}{leadingzero}{false}
+% \end{macrocode}
+%
+%
+%
+%\begin{macro}{\DTMsrCyrlRSdayordinal}
+% Define the day ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrlRSdayordinal}[1]{%
+ \DTMifbool{sr-Cyrl-RS}{leadingzero}%
+ {\DTMtwodigits{#1}}%
+ {\number#1}\DTMsrCyrlRSdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlRSyearordinal}
+% Define the year ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrlRSyearordinal}[1]{%
+ \number#1\DTMsrCyrlRSdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.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).
+%}
+%
+% Define the month names.
+%
+%\begin{macro}{\DTMsrCyrlRSnoimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRSnoimonthname}{\DTMserbiancyrnoimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlRSnoiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRSnoiMonthname}{\DTMserbiancyrnoiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlRSimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRSimonthname}{\DTMserbiancyrimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlRSiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlRSiMonthname}{\DTMserbiancyriMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+% Define a boolean key that determines if the time zone mappings
+% should be used.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-RS}{mapzone}[true]{}
+% \end{macrocode}
+% The default is to use mappings.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-RS}{mapzone}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the day of month should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-RS}{showdayofmonth}[true]{}
+% \end{macrocode}
+% The default is to show the day of month.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-RS}{showdayofmonth}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the year should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-RS}{showyear}[true]{}
+% \end{macrocode}
+% The default is to show the year.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-RS}{showyear}{true}
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Cyrl-RS}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlRSweekdayname{##4}%
+ \DTMsrCyrlRSdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-RS}{showdayofmonth}
+ {\DTMsrCyrlRSdayordinal{##3}\DTMsrCyrlRSdaymonthsep}%
+ {}%
+ \DTMifbool{sr-Cyrl-RS}{monthi}%
+ {\DTMsrCyrlRSimonthname{##2}}%
+ {\DTMsrCyrlRSnoimonthname{##2}}%
+ \DTMifbool{sr-Cyrl-RS}{showyear}%
+ {%
+ \DTMsrCyrlRSmonthyearsep%
+ \DTMsrCyrlRSyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlRSWeekdayname{##4}%
+ \DTMsrCyrlRSdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-RS}{showdayofmonth}
+ {%
+ \DTMsrCyrlRSdayordinal{##3}\DTMsrCyrlRSdaymonthsep%
+ \DTMifbool{sr-Cyrl-RS}{monthi}%
+ {\DTMsrCyrlRSimonthname{##2}}%
+ {\DTMsrCyrlRSnoimonthname{##2}}%
+ }%
+ {%
+ \DTMifbool{sr-Cyrl-RS}{monthi}%
+ {\DTMsrCyrlRSiMonthname{##2}}%
+ {\DTMsrCyrlRSnoiMonthname{##2}}%
+ }%
+ \DTMifbool{sr-Cyrl-RS}{showyear}%
+ {%
+ \DTMsrCyrlRSmonthyearsep%
+ \DTMsrCyrlRSyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Cyrl-RS}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrCyrlRStimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrCyrlRStimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrCyrlRSzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Cyrl-RS}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrCyrlRStimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrlRSdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrlRStimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMDisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrlRSdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrlRStimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+}%
+% \end{macrocode}
+%
+%
+%\begin{macro}{\DTMsrCyrlRSmonthordinal}
+% Define the month ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrlRSmonthordinal}[1]{%
+ \DTMifbool{sr-Cyrl-RS}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch between multiple numeric month ordinal formats used in
+% Serbian.
+%}
+% Define a setting to switch between Arabic, uppercase Roman and lowercase
+% smallcaps Roman month format for the "srCyrlRS-numeric" style.
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Cyrl-RS}{monthord}%
+[\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrCyrlRSmonthordinal}[1]{%
+ \DTMifbool{sr-Cyrl-RS}{leadingzero}%
+ {\DTMtwodigits{##1}}{\number##1}\DTMsrCyrlRSdatesep}%
+ \or%
+ \renewcommand*{\DTMsrCyrlRSmonthordinal}[1]{%
+ \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
+ {serbianordinalROMAN{##1}}}%
+ \or%
+ \renewcommand*{\DTMsrCyrlRSmonthordinal}[1]{%
+ \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
+ {serbianordinalROMAN{##1}}}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Fixed the (previously entirely wrong) numeric date style.
+%}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% Define numeric style.
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Cyrl-RS-numeric}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlRSweekdayname{##4}%
+ \DTMsrCyrlRSdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-RS}{showdayofmonth}%
+ {\DTMsrCyrlRSdayordinal{##3}\DTMsrCyrlRSdaymonthsep}%
+ {}%
+ \DTMsrCyrlRSmonthordinal{##2}%
+ \DTMifbool{sr-Cyrl-RS}{showyear}%
+ {%
+ \DTMsrCyrlRSmonthyearsep%
+ \DTMsrCyrlRSyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlRSWeekdayname{##4}%
+ \DTMsrCyrlRSdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-RS}{showdayofmonth}%
+ {\DTMsrCyrlRSdayordinal{##3}\DTMsrCyrlRSdaymonthsep}%
+ {}%
+ \DTMsrCyrlRSmonthordinal{##2}%
+ \DTMifbool{sr-Cyrl-RS}{showyear}%
+ {%
+ \DTMsrCyrlRSmonthyearsep%
+ \DTMsrCyrlRSyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Cyrl-RS}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrCyrlRStimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrCyrlRStimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrCyrlRSzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Cyrl-RS}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrCyrlRStimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrlRSdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrlRStimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}{\DTMdisplay}%
+}
+% \end{macrocode}
+%
+%\begin{macro}{\DTMsr-Cyrl-RSzonemaps}
+% The time zone mappings are set through this command, which can be
+% redefined if extra mappings are required or mappings need to be
+% removed.
+% \begin{macrocode}
+\newcommand*{\DTMsr-Cyrl-RSzonemaps}{%
+ \DTMdefzonemap{01}{00}{CET}%
+ \DTMdefzonemap{02}{00}{CEST}%
+}
+% \end{macrocode}
+%\end{macro}
+
+% Switch style according to the \opt{useregional} setting.
+% \begin{macrocode}
+\DTMifcaseregional%
+{}% do nothing
+{\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}{%
+% Added regions.
+%}
+% \begin{macrocode}
+\ifcsundef{date\CurrentTrackedDialect}
+{%
+ \ifundef\dateserbianc%
+ {% do nothing
+ }%
+ {%
+ \def\dateserbianc{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Cyrl-RS}}%
+ {\DTMsetstyle{sr-Cyrl-RS-numeric}}%
+ }%
+ }%
+}%
+{%
+ \csdef{date\CurrentTrackedDialect}{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Cyrl-RS}}%
+ {\DTMsetstyle{sr-Cyrl-RS-numeric}}%
+ }%
+}%
+% \end{macrocode}
+%
+%\iffalse
+% \begin{macrocode}
+%</datetime2-sr-Cyrl-RS.ldf>
+% \end{macrocode}
+%\fi
+%
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-sr-Cyrl-ME.ldf>
+% \end{macrocode}
+%\fi
+%
+%\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}{%
+% Added regions, all settings made available to regions so all changes can be
+% region-specific.
+%}
+% \begin{macrocode}
+\ProvidesDateTimeModule{sr-Cyrl-ME}[2019/11/07 v2.0]
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% All localization strings loaded from base module.
+%}
+%
+% Load base Serbian module.
+% \begin{macrocode}
+\RequireDateTimeModule{serbian-base}
+% \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
+% 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}
+\newcommand*{\DTMsrCyrlMEdowdaysep}{,\space}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMsrCyrlMEdaymonthsep}
+% The separator between the day and month for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEdaymonthsep}{%
+ \DTMtexorpdfstring{\protect~}{\space}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlMEmonthyearsep}
+% The separator between the month and year for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEmonthyearsep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlMEdatetimesep}
+% The separator between the date and time blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEdatetimesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlMEtimezonesep}
+% The separator between the time and zone blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEtimezonesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlMEdatesep}
+% The separator for the numeric date format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEdatesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlMEtimesep}
+% The separator for the numeric time format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEtimesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
+% \begin{macrocode}
+\DTMdefkey{sr-Cyrl-ME}{dowdaysep}%
+ {\renewcommand*{\DTMsr-Cyrl-MEdowdaysep}{#1}}
+\DTMdefkey{sr-Cyrl-ME}{daymonthsep}%
+ {\renewcommand*{\DTMsr-Cyrl-MEdaymonthsep}{#1}}
+\DTMdefkey{sr-Cyrl-ME}{monthyearsep}%
+ {\renewcommand*{\DTMsr-Cyrl-MEmonthyearsep}{#1}}
+\DTMdefkey{sr-Cyrl-ME}{datetimesep}%
+ {\renewcommand*{\DTMsr-Cyrl-MEdatetimesep}{#1}}
+\DTMdefkey{sr-Cyrl-ME}{timezonesep}%
+ {\renewcommand*{\DTMsr-Cyrl-MEtimezonesep}{#1}}
+\DTMdefkey{sr-Cyrl-ME}{datesep}%
+ {\renewcommand*{\DTMsr-Cyrl-MEdatesep}{#1}}
+\DTMdefkey{sr-Cyrl-ME}{timesep}%
+ {\renewcommand*{\DTMsr-Cyrl-MEtimesep}{#1}}
+% \end{macrocode}
+%
+%\subsubsection{Switches and settings}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+%\begin{macro}{\DTMsrCyrlMEweekdayname}
+% Define the weekday name, lowercase.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEweekdayname}%
+{\DTMserbiancyrijweekdayname}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\DTMsrCyrlMEweekdayname}
+% Define the weekday name, capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEWeekdayname}%
+ {\DTMserbiancyrijWeekdayname}
+% \end{macrocode}
+%\end{macro}
+%
+% Provide a way to switch between Ekavian and Ijekavian pronunciation.
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch between Ekavian and Ijekavian pronunciation.
+%}
+%
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Cyrl-ME}%
+ {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrCyrlMEweekdayname}%
+ {\DTMserbiancyrekweekdayname}%
+ \renewcommand*{\DTMsrCyrlMEWeekdayname}%
+ {\DTMserbiancyrekWeekdayname}%
+ \or%
+ \renewcommand*{\DTMsrCyrlMEweekdayname}%
+ {\DTMserbiancyrijweekdayname}%
+ \renewcommand*{\DTMsrCyrlMEWeekdayname}
+ {\DTMserbiancyrijWeekdayname}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch June, July alternate spellings.
+%}
+% Define a boolean key that can switch between (jun, jul) and (juni, juli)
+% month spellings.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-ME}{monthi}[true]{}
+% \end{macrocode}
+% The default is without the "i" suffix.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-ME}{monthi}{false}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch for adding leading zeroes in day and month ordinals.
+%}
+% Define a boolean key that determines if the day and month ordinals should
+% have leading zeroes.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-ME}{leadingzero}[true]{}
+% \end{macrocode}
+% The default is to omit the leading zero.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-ME}{leadingzero}{false}
+% \end{macrocode}
+%
+%
+%
+%\begin{macro}{\DTMsrCyrlMEdayordinal}
+% Define the day ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrlMEdayordinal}[1]{%
+ \DTMifbool{sr-Cyrl-ME}{leadingzero}%
+ {\DTMtwodigits{#1}}%
+ {\number#1}\DTMsrCyrlMEdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlMEyearordinal}
+% Define the year ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrlMEyearordinal}[1]{%
+ \number#1\DTMsrCyrlMEdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.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).
+%}
+%
+% Define the month names.
+%
+%\begin{macro}{\DTMsrCyrlMEnoimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEnoimonthname}{\DTMserbiancyrnoimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlMEnoiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEnoiMonthname}{\DTMserbiancyrnoiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlMEimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEimonthname}{\DTMserbiancyrimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlMEiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlMEiMonthname}{\DTMserbiancyriMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+% Define a boolean key that determines if the time zone mappings
+% should be used.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-ME}{mapzone}[true]{}
+% \end{macrocode}
+% The default is to use mappings.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-ME}{mapzone}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the day of month should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-ME}{showdayofmonth}[true]{}
+% \end{macrocode}
+% The default is to show the day of month.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-ME}{showdayofmonth}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the year should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-ME}{showyear}[true]{}
+% \end{macrocode}
+% The default is to show the year.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-ME}{showyear}{true}
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Cyrl-ME}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlMEweekdayname{##4}%
+ \DTMsrCyrlMEdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-ME}{showdayofmonth}
+ {\DTMsrCyrlMEdayordinal{##3}\DTMsrCyrlMEdaymonthsep}%
+ {}%
+ \DTMifbool{sr-Cyrl-ME}{monthi}%
+ {\DTMsrCyrlMEimonthname{##2}}%
+ {\DTMsrCyrlMEnoimonthname{##2}}%
+ \DTMifbool{sr-Cyrl-ME}{showyear}%
+ {%
+ \DTMsrCyrlMEmonthyearsep%
+ \DTMsrCyrlMEyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlMEWeekdayname{##4}%
+ \DTMsrCyrlMEdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-ME}{showdayofmonth}
+ {%
+ \DTMsrCyrlMEdayordinal{##3}\DTMsrCyrlMEdaymonthsep%
+ \DTMifbool{sr-Cyrl-ME}{monthi}%
+ {\DTMsrCyrlMEimonthname{##2}}%
+ {\DTMsrCyrlMEnoimonthname{##2}}%
+ }%
+ {%
+ \DTMifbool{sr-Cyrl-ME}{monthi}%
+ {\DTMsrCyrlMEiMonthname{##2}}%
+ {\DTMsrCyrlMEnoiMonthname{##2}}%
+ }%
+ \DTMifbool{sr-Cyrl-ME}{showyear}%
+ {%
+ \DTMsrCyrlMEmonthyearsep%
+ \DTMsrCyrlMEyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Cyrl-ME}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrCyrlMEtimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrCyrlMEtimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrCyrlMEzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Cyrl-ME}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrCyrlMEtimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrlMEdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrlMEtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMDisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrlMEdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrlMEtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+}%
+% \end{macrocode}
+%
+%
+%\begin{macro}{\DTMsrCyrlMEmonthordinal}
+% Define the month ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrlMEmonthordinal}[1]{%
+ \DTMifbool{sr-Cyrl-ME}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch between multiple numeric month ordinal formats used in
+% Serbian.
+%}
+% Define a setting to switch between Arabic, uppercase Roman and lowercase
+% smallcaps Roman month format for the "srCyrlME-numeric" style.
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Cyrl-ME}{monthord}%
+[\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrCyrlMEmonthordinal}[1]{%
+ \DTMifbool{sr-Cyrl-ME}{leadingzero}%
+ {\DTMtwodigits{##1}}{\number##1}\DTMsrCyrlMEdatesep}%
+ \or%
+ \renewcommand*{\DTMsrCyrlMEmonthordinal}[1]{%
+ \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
+ {serbianordinalROMAN{##1}}}%
+ \or%
+ \renewcommand*{\DTMsrCyrlMEmonthordinal}[1]{%
+ \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
+ {serbianordinalROMAN{##1}}}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Fixed the (previously entirely wrong) numeric date style.
+%}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% Define numeric style.
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Cyrl-ME-numeric}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlMEweekdayname{##4}%
+ \DTMsrCyrlMEdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-ME}{showdayofmonth}%
+ {\DTMsrCyrlMEdayordinal{##3}\DTMsrCyrlMEdaymonthsep}%
+ {}%
+ \DTMsrCyrlMEmonthordinal{##2}%
+ \DTMifbool{sr-Cyrl-ME}{showyear}%
+ {%
+ \DTMsrCyrlMEmonthyearsep%
+ \DTMsrCyrlMEyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlMEWeekdayname{##4}%
+ \DTMsrCyrlMEdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-ME}{showdayofmonth}%
+ {\DTMsrCyrlMEdayordinal{##3}\DTMsrCyrlMEdaymonthsep}%
+ {}%
+ \DTMsrCyrlMEmonthordinal{##2}%
+ \DTMifbool{sr-Cyrl-ME}{showyear}%
+ {%
+ \DTMsrCyrlMEmonthyearsep%
+ \DTMsrCyrlMEyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Cyrl-ME}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrCyrlMEtimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrCyrlMEtimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrCyrlMEzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Cyrl-ME}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrCyrlMEtimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrlMEdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrlMEtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}{\DTMdisplay}%
+}
+% \end{macrocode}
+%
+%\begin{macro}{\DTMsr-Cyrl-MEzonemaps}
+% The time zone mappings are set through this command, which can be
+% redefined if extra mappings are required or mappings need to be
+% removed.
+% \begin{macrocode}
+\newcommand*{\DTMsr-Cyrl-MEzonemaps}{%
+ \DTMdefzonemap{01}{00}{CET}%
+ \DTMdefzonemap{02}{00}{CEST}%
+}
+% \end{macrocode}
+%\end{macro}
+
+% Switch style according to the \opt{useregional} setting.
+% \begin{macrocode}
+\DTMifcaseregional%
+{}% do nothing
+{\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}{%
+% Added regions.
+%}
+% \begin{macrocode}
+\ifcsundef{date\CurrentTrackedDialect}
+{%
+ \ifundef\dateserbianc%
+ {% do nothing
+ }%
+ {%
+ \def\dateserbianc{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Cyrl-ME}}%
+ {\DTMsetstyle{sr-Cyrl-ME-numeric}}%
+ }%
+ }%
+}%
+{%
+ \csdef{date\CurrentTrackedDialect}{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Cyrl-ME}}%
+ {\DTMsetstyle{sr-Cyrl-ME-numeric}}%
+ }%
+}%
+% \end{macrocode}
+%
+%\iffalse
+% \begin{macrocode}
+%</datetime2-sr-Cyrl-ME.ldf>
+% \end{macrocode}
+%\fi
+%
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-sr-Cyrl-BA.ldf>
+% \end{macrocode}
+%\fi
+%
+%\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}{%
+% Added regions, all settings made available to regions so all changes can be
+% region-specific.
+%}
+% \begin{macrocode}
+\ProvidesDateTimeModule{sr-Cyrl-BA}[2019/11/07 v2.0]
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% All localization strings loaded from base module.
+%}
+%
+% Load base Serbian module.
+% \begin{macrocode}
+\RequireDateTimeModule{serbian-base}
+% \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
+% 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}
+\newcommand*{\DTMsrCyrlBAdowdaysep}{,\space}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMsrCyrlBAdaymonthsep}
+% The separator between the day and month for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAdaymonthsep}{%
+ \DTMtexorpdfstring{\protect~}{\space}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlBAmonthyearsep}
+% The separator between the month and year for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAmonthyearsep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlBAdatetimesep}
+% The separator between the date and time blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAdatetimesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlBAtimezonesep}
+% The separator between the time and zone blocks in the full format (either
+% text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAtimezonesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlBAdatesep}
+% The separator for the numeric date format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAdatesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlBAtimesep}
+% The separator for the numeric time format.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAtimesep}{.}
+% \end{macrocode}
+%\end{macro}
+%
+%Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
+% \begin{macrocode}
+\DTMdefkey{sr-Cyrl-BA}{dowdaysep}%
+ {\renewcommand*{\DTMsr-Cyrl-BAdowdaysep}{#1}}
+\DTMdefkey{sr-Cyrl-BA}{daymonthsep}%
+ {\renewcommand*{\DTMsr-Cyrl-BAdaymonthsep}{#1}}
+\DTMdefkey{sr-Cyrl-BA}{monthyearsep}%
+ {\renewcommand*{\DTMsr-Cyrl-BAmonthyearsep}{#1}}
+\DTMdefkey{sr-Cyrl-BA}{datetimesep}%
+ {\renewcommand*{\DTMsr-Cyrl-BAdatetimesep}{#1}}
+\DTMdefkey{sr-Cyrl-BA}{timezonesep}%
+ {\renewcommand*{\DTMsr-Cyrl-BAtimezonesep}{#1}}
+\DTMdefkey{sr-Cyrl-BA}{datesep}%
+ {\renewcommand*{\DTMsr-Cyrl-BAdatesep}{#1}}
+\DTMdefkey{sr-Cyrl-BA}{timesep}%
+ {\renewcommand*{\DTMsr-Cyrl-BAtimesep}{#1}}
+% \end{macrocode}
+%
+%\subsubsection{Switches and settings}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+%\begin{macro}{\DTMsrCyrlBAweekdayname}
+% Define the weekday name, lowercase.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAweekdayname}%
+{\DTMserbiancyrijweekdayname}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\DTMsrCyrlBAweekdayname}
+% Define the weekday name, capitalized.
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAWeekdayname}%
+ {\DTMserbiancyrijWeekdayname}
+% \end{macrocode}
+%\end{macro}
+%
+% Provide a way to switch between Ekavian and Ijekavian pronunciation.
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch between Ekavian and Ijekavian pronunciation.
+%}
+%
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Cyrl-BA}%
+ {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrCyrlBAweekdayname}%
+ {\DTMserbiancyrekweekdayname}%
+ \renewcommand*{\DTMsrCyrlBAWeekdayname}%
+ {\DTMserbiancyrekWeekdayname}%
+ \or%
+ \renewcommand*{\DTMsrCyrlBAweekdayname}%
+ {\DTMserbiancyrijweekdayname}%
+ \renewcommand*{\DTMsrCyrlBAWeekdayname}
+ {\DTMserbiancyrijWeekdayname}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a way to switch June, July alternate spellings.
+%}
+% Define a boolean key that can switch between (jun, jul) and (juni, juli)
+% month spellings.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-BA}{monthi}[true]{}
+% \end{macrocode}
+% The default is without the "i" suffix.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-BA}{monthi}{false}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch for adding leading zeroes in day and month ordinals.
+%}
+% Define a boolean key that determines if the day and month ordinals should
+% have leading zeroes.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-BA}{leadingzero}[true]{}
+% \end{macrocode}
+% The default is to omit the leading zero.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-BA}{leadingzero}{false}
+% \end{macrocode}
+%
+%
+%
+%\begin{macro}{\DTMsrCyrlBAdayordinal}
+% Define the day ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrlBAdayordinal}[1]{%
+ \DTMifbool{sr-Cyrl-BA}{leadingzero}%
+ {\DTMtwodigits{#1}}%
+ {\number#1}\DTMsrCyrlBAdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlBAyearordinal}
+% Define the year ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrlBAyearordinal}[1]{%
+ \number#1\DTMsrCyrlBAdatesep}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.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).
+%}
+%
+% Define the month names.
+%
+%\begin{macro}{\DTMsrCyrlBAnoimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAnoimonthname}{\DTMserbiancyrnoimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlBAnoiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAnoiMonthname}{\DTMserbiancyrnoiMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlBAimonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAimonthname}{\DTMserbiancyrimonthname}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMsrCyrlBAiMonthname}
+% \begin{macrocode}
+\newcommand*{\DTMsrCyrlBAiMonthname}{\DTMserbiancyriMonthname}
+% \end{macrocode}
+%\end{macro}
+%
+% Define a boolean key that determines if the time zone mappings
+% should be used.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-BA}{mapzone}[true]{}
+% \end{macrocode}
+% The default is to use mappings.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-BA}{mapzone}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the day of month should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-BA}{showdayofmonth}[true]{}
+% \end{macrocode}
+% The default is to show the day of month.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-BA}{showdayofmonth}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the year should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{sr-Cyrl-BA}{showyear}[true]{}
+% \end{macrocode}
+% The default is to show the year.
+% \begin{macrocode}
+\DTMsetbool{sr-Cyrl-BA}{showyear}{true}
+% \end{macrocode}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Cyrl-BA}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlBAweekdayname{##4}%
+ \DTMsrCyrlBAdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-BA}{showdayofmonth}
+ {\DTMsrCyrlBAdayordinal{##3}\DTMsrCyrlBAdaymonthsep}%
+ {}%
+ \DTMifbool{sr-Cyrl-BA}{monthi}%
+ {\DTMsrCyrlBAimonthname{##2}}%
+ {\DTMsrCyrlBAnoimonthname{##2}}%
+ \DTMifbool{sr-Cyrl-BA}{showyear}%
+ {%
+ \DTMsrCyrlBAmonthyearsep%
+ \DTMsrCyrlBAyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlBAWeekdayname{##4}%
+ \DTMsrCyrlBAdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-BA}{showdayofmonth}
+ {%
+ \DTMsrCyrlBAdayordinal{##3}\DTMsrCyrlBAdaymonthsep%
+ \DTMifbool{sr-Cyrl-BA}{monthi}%
+ {\DTMsrCyrlBAimonthname{##2}}%
+ {\DTMsrCyrlBAnoimonthname{##2}}%
+ }%
+ {%
+ \DTMifbool{sr-Cyrl-BA}{monthi}%
+ {\DTMsrCyrlBAiMonthname{##2}}%
+ {\DTMsrCyrlBAnoiMonthname{##2}}%
+ }%
+ \DTMifbool{sr-Cyrl-BA}{showyear}%
+ {%
+ \DTMsrCyrlBAmonthyearsep%
+ \DTMsrCyrlBAyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Cyrl-BA}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrCyrlBAtimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrCyrlBAtimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrCyrlBAzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Cyrl-BA}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrCyrlBAtimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrlBAdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrlBAtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMDisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrlBAdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrlBAtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+}%
+% \end{macrocode}
+%
+%
+%\begin{macro}{\DTMsrCyrlBAmonthordinal}
+% Define the month ordinal format to be used by this style.
+% \begin{macrocode}
+ \newcommand*{\DTMsrCyrlBAmonthordinal}[1]{%
+ \DTMifbool{sr-Cyrl-BA}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
+% \end{macrocode}
+%\end{macro}
+%
+%\changes{2.0}{2019-11-07}{%
+% Added a switch between multiple numeric month ordinal formats used in
+% Serbian.
+%}
+% Define a setting to switch between Arabic, uppercase Roman and lowercase
+% smallcaps Roman month format for the "srCyrlBA-numeric" style.
+% \begin{macrocode}
+\DTMdefchoicekey{sr-Cyrl-BA}{monthord}%
+[\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
+ \ifcase\@dtm@nr\relax
+ \renewcommand*{\DTMsrCyrlBAmonthordinal}[1]{%
+ \DTMifbool{sr-Cyrl-BA}{leadingzero}%
+ {\DTMtwodigits{##1}}{\number##1}\DTMsrCyrlBAdatesep}%
+ \or%
+ \renewcommand*{\DTMsrCyrlBAmonthordinal}[1]{%
+ \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
+ {serbianordinalROMAN{##1}}}%
+ \or%
+ \renewcommand*{\DTMsrCyrlBAmonthordinal}[1]{%
+ \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
+ {serbianordinalROMAN{##1}}}%
+ \fi
+}
+% \end{macrocode}
+%
+%\changes{2.0}{2019-11-07}{%
+% Fixed the (previously entirely wrong) numeric date style.
+%}
+%\changes{2.0}{2019-11-07}{%
+% Added weekday names.
+%}
+% Define numeric style.
+% \begin{macrocode}
+\DTMnewstyle%
+{sr-Cyrl-BA-numeric}% label
+{% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlBAweekdayname{##4}%
+ \DTMsrCyrlBAdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-BA}{showdayofmonth}%
+ {\DTMsrCyrlBAdayordinal{##3}\DTMsrCyrlBAdaymonthsep}%
+ {}%
+ \DTMsrCyrlBAmonthordinal{##2}%
+ \DTMifbool{sr-Cyrl-BA}{showyear}%
+ {%
+ \DTMsrCyrlBAmonthyearsep%
+ \DTMsrCyrlBAyearordinal{##1}%
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow%
+ \ifnum##4>-1
+ \DTMsrCyrlBAWeekdayname{##4}%
+ \DTMsrCyrlBAdowdaysep%
+ \fi
+ \fi
+ \DTMifbool{sr-Cyrl-BA}{showdayofmonth}%
+ {\DTMsrCyrlBAdayordinal{##3}\DTMsrCyrlBAdaymonthsep}%
+ {}%
+ \DTMsrCyrlBAmonthordinal{##2}%
+ \DTMifbool{sr-Cyrl-BA}{showyear}%
+ {%
+ \DTMsrCyrlBAmonthyearsep%
+ \DTMsrCyrlBAyearordinal{##1}%
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \DTMifbool{sr-Cyrl-BA}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
+ \DTMsrCyrlBAtimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMsrCyrlBAtimesep\DTMtwodigits{##3}\fi
+ }%
+}%
+{% zone style
+ \DTMresetzones%
+ \DTMsrCyrlBAzonemaps%
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{sr-Cyrl-BA}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0
+ \else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMsrCyrlBAtimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate%
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMsrCyrlBAdatetimesep%
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone%
+ \DTMsrCyrlBAtimezonesep%
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}{\DTMdisplay}%
+}
+% \end{macrocode}
+%
+%\begin{macro}{\DTMsr-Cyrl-BAzonemaps}
+% The time zone mappings are set through this command, which can be
+% redefined if extra mappings are required or mappings need to be
+% removed.
+% \begin{macrocode}
+\newcommand*{\DTMsr-Cyrl-BAzonemaps}{%
+ \DTMdefzonemap{01}{00}{CET}%
+ \DTMdefzonemap{02}{00}{CEST}%
+}
+% \end{macrocode}
+%\end{macro}
+
+% Switch style according to the \opt{useregional} setting.
+% \begin{macrocode}
+\DTMifcaseregional%
+{}% do nothing
+{\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}{%
+% Added regions.
+%}
+% \begin{macrocode}
+\ifcsundef{date\CurrentTrackedDialect}
+{%
+ \ifundef\dateserbianc%
+ {% do nothing
+ }%
+ {%
+ \def\dateserbianc{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Cyrl-BA}}%
+ {\DTMsetstyle{sr-Cyrl-BA-numeric}}%
+ }%
+ }%
+}%
+{%
+ \csdef{date\CurrentTrackedDialect}{%
+ \DTMifcaseregional%
+ {}% do nothing
+ {\DTMsetstyle{sr-Cyrl-BA}}%
+ {\DTMsetstyle{sr-Cyrl-BA-numeric}}%
+ }%
+}%
+% \end{macrocode}
+%
+%\iffalse
+% \begin{macrocode}
+%</datetime2-sr-Cyrl-BA.ldf>
+% \end{macrocode}
+%\fi
+%
+%
+%
+%\restoregeometry{}
%\Finale
-\endinput
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.ins b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.ins
index eb0e2e0ff7..7825ac0082 100644
--- a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.ins
+++ b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.ins
@@ -3,6 +3,7 @@
\preamble
datetime2-serbian.dtx
+ Copyright 2019 Andrej Radović
Copyright 2019 Nicola Talbot
This work may be distributed and/or modified under the
@@ -13,12 +14,26 @@
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 `inactive'.
+ This work has the LPPL maintenance status `maintained'.
+
+ The Current Maintainer of this work is Andrej Radović.
This work consists of the files datetime2-serbian.dtx and
- datetime2-serbian.ins and the derived files
- datetime2-serbian-utf8.ldf, datetime2-serbian-ascii.ldf and
- datetime2-serbian.ldf.
+ datetime2-serbian.ins and the derived files are as follows:
+ datetime2-serbian-base.ldf
+ datetime2-serbian-base-utf8.ldf
+ datetime2-serbian-base-ascii.ldf
+ datetime2-serbian.ldf
+ datetime2-sr-Latn.ldf
+ datetime2-sr-Latn-RS.ldf
+ datetime2-sr-Latn-ME.ldf
+ datetime2-sr-Latn-BA.ldf
+ datetime2-serbianc.ldf
+ datetime2-sr-Cyrl.ldf
+ datetime2-sr-Cyrl-RS.ldf
+ datetime2-sr-Cyrl-ME.ldf
+ datetime2-sr-Cyrl-BA.ldf
+
\endpreamble
@@ -27,35 +42,145 @@
\generate
{%
\file
- {datetime2-serbian-utf8.ldf}%
+ {datetime2-serbian.ldf}%
{%
\usepreamble\defaultpreamble
\usepostamble\defaultpostamble
- \from{datetime2-serbian.dtx}{datetime2-serbian-utf8.ldf,package}%
+ \from{datetime2-serbian.dtx}{datetime2-serbian.ldf,package}%
}%
}
\generate
{%
\file
- {datetime2-serbian-ascii.ldf}%
+ {datetime2-sr-Latn.ldf}%
{%
\usepreamble\defaultpreamble
\usepostamble\defaultpostamble
- \from{datetime2-serbian.dtx}{datetime2-serbian-ascii.ldf,package}%
+ \from{datetime2-serbian.dtx}{datetime2-sr-Latn.ldf,package}%
}%
}
\generate
{%
\file
- {datetime2-serbian.ldf}%
+ {datetime2-sr-Latn-RS.ldf}%
{%
\usepreamble\defaultpreamble
\usepostamble\defaultpostamble
- \from{datetime2-serbian.dtx}{datetime2-serbian.ldf,package}%
+ \from{datetime2-serbian.dtx}{datetime2-sr-Latn-RS.ldf,package}%
}%
}
-\endbatchfile
+\generate
+{%
+ \file
+ {datetime2-sr-Latn-ME.ldf}%
+ {%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \from{datetime2-serbian.dtx}{datetime2-sr-Latn-ME.ldf,package}%
+ }%
+}
+
+\generate
+{%
+ \file
+ {datetime2-sr-Latn-BA.ldf}%
+ {%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \from{datetime2-serbian.dtx}{datetime2-sr-Latn-BA.ldf,package}%
+ }%
+}
+
+\generate
+{%
+ \file
+ {datetime2-serbianc.ldf}%
+ {%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \from{datetime2-serbian.dtx}{datetime2-serbianc.ldf,package}%
+ }%
+}
+
+\generate
+{%
+ \file
+ {datetime2-sr-Cyrl.ldf}%
+ {%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \from{datetime2-serbian.dtx}{datetime2-sr-Cyrl.ldf,package}%
+ }%
+}
+
+\generate
+{%
+ \file
+ {datetime2-sr-Cyrl-RS.ldf}%
+ {%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \from{datetime2-serbian.dtx}{datetime2-sr-Cyrl-RS.ldf,package}%
+ }%
+}
+\generate
+{%
+ \file
+ {datetime2-sr-Cyrl-ME.ldf}%
+ {%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \from{datetime2-serbian.dtx}{datetime2-sr-Cyrl-ME.ldf,package}%
+ }%
+}
+
+\generate
+{%
+ \file
+ {datetime2-sr-Cyrl-BA.ldf}%
+ {%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \from{datetime2-serbian.dtx}{datetime2-sr-Cyrl-BA.ldf,package}%
+ }%
+}
+
+
+\generate
+{%
+ \file
+ {datetime2-serbian-base.ldf}%
+ {%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \from{datetime2-serbian.dtx}{datetime2-serbian-base.ldf,package}%
+ }%
+}
+
+\generate
+{%
+ \file
+ {datetime2-serbian-base-utf8.ldf}%
+ {%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \from{datetime2-serbian.dtx}{datetime2-serbian-base-utf8.ldf,package}%
+ }%
+}
+
+\generate
+{%
+ \file
+ {datetime2-serbian-base-ascii.ldf}%
+ {%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \from{datetime2-serbian.dtx}{datetime2-serbian-base-ascii.ldf,package}%
+ }%
+}
+
+\endbatchfile
diff --git a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.pdf b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.pdf
index 090f1a9353..3f1b8c2768 100644
--- a/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.pdf
+++ b/macros/latex/contrib/datetime2-contrib/datetime2-serbian/datetime2-serbian.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-a-a3input.pdf b/macros/latex/contrib/jnuexam/exam-a-a3input.pdf
index 5c185d3fc7..c8ade76680 100644
--- a/macros/latex/contrib/jnuexam/exam-a-a3input.pdf
+++ b/macros/latex/contrib/jnuexam/exam-a-a3input.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-a-a3split.pdf b/macros/latex/contrib/jnuexam/exam-a-a3split.pdf
index f17c0ce2e3..de83638ce7 100644
--- a/macros/latex/contrib/jnuexam/exam-a-a3split.pdf
+++ b/macros/latex/contrib/jnuexam/exam-a-a3split.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-a-empty.pdf b/macros/latex/contrib/jnuexam/exam-a-empty.pdf
index 846854d86d..653325a652 100644
--- a/macros/latex/contrib/jnuexam/exam-a-empty.pdf
+++ b/macros/latex/contrib/jnuexam/exam-a-empty.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-a.pdf b/macros/latex/contrib/jnuexam/exam-a.pdf
index c57592e675..5eb115847a 100644
--- a/macros/latex/contrib/jnuexam/exam-a.pdf
+++ b/macros/latex/contrib/jnuexam/exam-a.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-a.tex b/macros/latex/contrib/jnuexam/exam-a.tex
index 44bc600fae..54b2d1ac40 100644
--- a/macros/latex/contrib/jnuexam/exam-a.tex
+++ b/macros/latex/contrib/jnuexam/exam-a.tex
@@ -39,10 +39,10 @@
\vfill
\begin{problem}
-已知二阶行列式 $\text{$\left|\begin{array}{cc}
+已知二阶行列式 $\left|\begin{array}{cc}
1 & 2\\
- 3 & x
-\end{array}\right|$=0}$,则 $x=$ \fillout{$-6$}.
+\end{array}\right|=0$,则 $x=$ \fillout{$-6$}.
\end{problem}
\vfill
@@ -178,10 +178,10 @@
\begin{solution}
\everymath{\displaystyle}%
-原式$=\int\e^{2x}\,\sec^2 x\dx+2\int\e^{2x}\,\tan x\dx$ \score{2}
-\hspace{5em}${}=\int\e^{2x}\,\d(\tan x)+ 2\int\e^{2x}\,\tan x\dx$ \score{4}
-\hspace{5em}${}=\e^{2x}\,\tan x - 2\int\e^{2x}\,\tan x\dx+ 2\int\e^{2x}\,\tan x\dx$ \score{6}
-\hspace{5em}${}=\e^{2x}\,\tan x + C$ \score{8}
+原式 \? $=\int\e^{2x}\,\sec^2 x\dx+2\int\e^{2x}\,\tan x\dx$ \score{2}
+\+ $=\int\e^{2x}\,\d(\tan x)+ 2\int\e^{2x}\,\tan x\dx$ \score{4}
+\+ $=\e^{2x}\,\tan x - 2\int\e^{2x}\,\tan x\dx+ 2\int\e^{2x}\,\tan x\dx$ \score{6}
+\+ $=\e^{2x}\,\tan x + C$ \score{8}
\end{solution}
\vfill
@@ -220,7 +220,7 @@
\bigskip
\begin{solution}
-$A = \left|\begin{array}{cccc}
+$A \? = \left|\begin{array}{cccc}
0 & 1 & 2 & 3\\
1 & 2 & 3 & 0\\
2 & 3 & 0 & 1\\
@@ -235,7 +235,7 @@ $A = \left|\begin{array}{cccc}
- 1 & - 6 & 1\\
- 6 & - 8 & 2
\end{array}\right|$ \score{4}
-\qquad $= -\left|\begin{array}{ccc}
+\+ $= -\left|\begin{array}{ccc}
1 & 2 & 3\\
0 & - 4 & 4\\
0 & 4 & 20
@@ -255,11 +255,11 @@ x_2 x_3 + 9 x^2_3$ 化为标准形 $f = d_1 y^2_1 + d_2 y^2_2 + d_3 y^2_3$ .
\bigskip
\begin{solution}
-$f = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12 x_2 x_3 + 9 x^2_3$ \par
-\qquad$= x_1^2 + 2 x_1 (x_2 - 3 x_3) + (x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3 $ \par
-\qquad$= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3$ \score{3}
-\qquad$= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 2 x_2 \cdot 3 x_3 + (3 x_3)^2 - 9x_3^2$ \par
-\qquad$= (x_1 + x_2 - 3 x_3)^2 + (x_2 - 3 x_3)^2 - 9 x_3^2$ \score{6}
+$f \? = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12 x_2 x_3 + 9 x^2_3$ \par
+ \+ $= x_1^2 + 2 x_1 (x_2 - 3 x_3) + (x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3 $ \par
+ \+ $= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3$ \score{3}
+ \+ $= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 2 x_2 \cdot 3 x_3 + (3 x_3)^2 - 9x_3^2$ \par
+ \+ $= (x_1 + x_2 - 3 x_3)^2 + (x_2 - 3 x_3)^2 - 9 x_3^2$ \score{6}
令$y_1 = x_1 + x_2 - 3 x_3, y_2 = x_2 - 3 x_3, y_3 = x_3$, \newline
则$f = y_1^2 + y_2^2 - 9y_3^2$为标准形.\score{8}
\end{solution}
@@ -270,19 +270,19 @@ $f = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12 x_2 x_3 + 9 x^2_3$ \par
\begin{problem}
设每发炮弹命中飞机的概率是0.2且相互独立,现在发射100发炮弹.\par
-\step 用切贝谢夫不等式估计命中数目$\xi$在10发到30发之间的概率.\par
-\step 用中心极限定理估计命中数目$\xi$在10发到30发之间的概率.
+(1) 用切贝谢夫不等式估计命中数目$\xi$在10发到30发之间的概率.\par
+(2) 用中心极限定理估计命中数目$\xi$在10发到30发之间的概率.
\end{problem}
\bigskip
\begin{solution}
$E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$. \score{2}
-\step $P (10 < \xi < 30) = P (| \xi - E \xi | < 10) \ge 1 - \frac{D\xi}{10^2}
+(1) $P (10 < \xi < 30) = P (|\xi - E\xi| < 10) \ge 1 - \frac{D\xi}{10^2}
= 1 - \frac{16}{100} = 0.84$. \score{4}
-\step $P (10 < \xi < 30) \approx \Phi_0 \left( \frac{30 - 20}{\sqrt{16}}\right)
- - \Phi_0 \left( \frac{10 - 20}{\sqrt{16}} \right)$ \score{6}
-\qquad $= 2 \Phi_0 (2.5) - 1 = 2 \cdot 0.9938 - 1 =0.9876$ \score{8}
+(2) $P (10 < \xi < 30) \? \approx \Phi_0\left(\frac{30 - 20}{\sqrt{16}}\right)
+ - \Phi_0\left(\frac{10 - 20}{\sqrt{16}}\right)$ \score{6}
+ \+ $= 2 \Phi_0(2.5) - 1 = 2 \cdot 0.9938 - 1 =0.9876$ \score{8}
\end{solution}
\vfill
@@ -295,11 +295,11 @@ $E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$.
\bigskip
\begin{solution}
-\step 待检假设 $H_0 : \mu = 3140$. \score{1}
-\step 选取统计量 $T = \frac{\bar{X}-\mu}{S / \sqrt{n}} \sim t(n-1)$. \score{3}
-\step 查表得到 $t_{\alpha} = t_{\alpha} (n - 1) = t_{0.01} (15) =2.947$. \score{5}
-\step 计算统计值 $t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}} =\frac{3160-3140}{100/4} = 0.8$.\score{7}
-\step 由于 $| t | < t_{\alpha}$, 故接受 $H_0$, 即假设成立. \score{8}
+(1) 待检假设 $H_0 : \mu = 3140$. \score{1}
+(2) 选取统计量 $T = \frac{\widebar{X}-\mu}{S / \sqrt{n}} \sim t(n-1)$. \score{3}
+(3) 查表得到 $t_{\alpha} = t_{\alpha} (n - 1) = t_{0.01} (15) =2.947$. \score{5}
+(4) 计算统计值 $t = \frac{\widebar{x} - \mu_0}{s/\sqrt{n}} =\frac{3160-3140}{100/4} = 0.8$.\score{7}
+(5) 由于 $| t | < t_{\alpha}$, 故接受 $H_0$, 即假设成立. \score{8}
\end{solution}
\vfill
@@ -308,6 +308,8 @@ $E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$.
\makepart{证明题}{共~2~小题,每小题~8~分,共~16~分}
+\renewcommand{\solutionname}{证} % 将“解”字改为“证”字
+
\begin{problem}
设数列$\{x_n\}$满足$x_1=\sqrt2$,$x_{n+1}=\sqrt{2+x_n}$.证明数列收敛,并求出极限.
\end{problem}
@@ -315,13 +317,13 @@ $E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$.
\bigskip
\begin{solution}
-\step 事实上,由于$x_1<2$,且$x_k<2$时
+(1) 事实上,由于$x_1<2$,且$x_k<2$时
$$x_{k+1}=\sqrt{2+x_k}<\sqrt{2+2}=2,$$
由数学归纳法知对所有$n$都有$x_n<2$,即数列有上界.
又由于
$$\frac{x_{n+1}}{x_n}=\sqrt{\frac{2}{x_n^2}+\frac{1}{x_n}}>\sqrt{\frac{2}{2^2}+\frac{1}{2}}=1,$$
所以数列单调增加.由极限存在准则II,数列必定收敛.\score{4}
-\step 设数列的极限为$A$,对递推公式两边同时取极限得到
+(2) 设数列的极限为$A$,对递推公式两边同时取极限得到
$$A=\sqrt{2+A}.$$
解得$A=2$,即数列$\{x_n\}$的极限为$2$.\score{8}
\end{solution}
@@ -329,29 +331,29 @@ $$A=\sqrt{2+A}.$$
\vfill
\begin{problem}
-设事件$A$和$B$相互独立,证明$A$和$\bar{B}$相互独立.
+设事件$A$和$B$相互独立,证明$A$和$\widebar{B}$相互独立.
\end{problem}
\bigskip
\begin{solution}
-$P (A \cdot \bar{B}) = P (A - B) = P (A - A B)$ \score{2}
-\qquad $= P (A) - P (A B) = P (A) - P (A) P (B)$ \score{4}
-\qquad $= P (A) (1 - P (B)) = P (A) P (\bar{B})$ \score{6}
-所以$A$和$\bar{B}$相互独立.\score{8}
+\? $P (A \cdot \widebar{B}) = P (A - B) = P (A - A B)$ \score{2}
+\< $= P (A) - P (A B) = P (A) - P (A) P (B)$ \score{4}
+\< $= P (A) (1 - P (B)) = P (A) P (\widebar{B})$ \score{6}
+所以$A$和$\widebar{B}$相互独立.\score{8}
\end{solution}
\vfill
\makedata{一些可能用到的数据} %附录数据
-\begin{tabu}{*{4}{X[l,$]}}
+\begin{tabularx}{\linewidth}{*{4}{>{$}X<{$}}}
\hline
\Phi_0(0.5)=0.6915 & \Phi_0(1)=0.8413 & \Phi_0(2)=0.9773 & \Phi_0(2.5)=0.9938 \\
t_{0.01}(8)=3.355 & t_{0.01}(9)=3.250 & t_{0.01}(15)=2.947 & t_{0.01}(16)=2.921 \\
\chi_{0.005}^2(8)=22.0 & \chi_{0.005}^2(9)=23.6 & \chi_{0.005}^2(15)=32.8 & \chi_{0.005}^2(16)=34.3 \\
\chi_{0.995}^2(8)=1.34 & \chi_{0.995}^2(9)=1.73 & \chi_{0.995}^2(15)=4.60 & \chi_{0.995}^2(16)=5.14 \\
\hline
-\end{tabu}
+\end{tabularx}
\end{document}
diff --git a/macros/latex/contrib/jnuexam/exam-b-a3input.pdf b/macros/latex/contrib/jnuexam/exam-b-a3input.pdf
index 9b0fd8d18d..7351872d94 100644
--- a/macros/latex/contrib/jnuexam/exam-b-a3input.pdf
+++ b/macros/latex/contrib/jnuexam/exam-b-a3input.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-b-a3split.pdf b/macros/latex/contrib/jnuexam/exam-b-a3split.pdf
index c224b9ab33..ff8a2e40ba 100644
--- a/macros/latex/contrib/jnuexam/exam-b-a3split.pdf
+++ b/macros/latex/contrib/jnuexam/exam-b-a3split.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-b-empty.pdf b/macros/latex/contrib/jnuexam/exam-b-empty.pdf
index 1b27aa32c8..9809fb34cc 100644
--- a/macros/latex/contrib/jnuexam/exam-b-empty.pdf
+++ b/macros/latex/contrib/jnuexam/exam-b-empty.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-b.pdf b/macros/latex/contrib/jnuexam/exam-b.pdf
index 8a378a7e3d..69dd16f187 100644
--- a/macros/latex/contrib/jnuexam/exam-b.pdf
+++ b/macros/latex/contrib/jnuexam/exam-b.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/jnuexam.cls b/macros/latex/contrib/jnuexam/jnuexam.cls
index e839799d0e..84e36954a5 100644
--- a/macros/latex/contrib/jnuexam/jnuexam.cls
+++ b/macros/latex/contrib/jnuexam/jnuexam.cls
@@ -6,18 +6,22 @@
% ----------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jnuexam}[2018/11/21 v0.5 An exam class for Jinan University]
+\ProvidesClass{jnuexam}[2019/11/08 v0.7 An exam class for Jinan University]
\newif\ifsidebyside \sidebysidefalse % 是否 A3 纸张
\newif\ifreverse \reversefalse % 是否逆序出题
\newif\ifanswer \answertrue % 是否显示答案
+\newif\ifamsfonts \amsfontsfalse % 切换数学字体
\newif\ifsourcehan \sourcehanfalse % 切换思源字体
+\newif\ifdisplay \displayfalse % 切换展示公式
\newif\ifcollection \collectionfalse % 用于试卷题库
\DeclareOption{a3paper}{\sidebysidetrue}
\DeclareOption{reverse}{\reversetrue}
\DeclareOption{noanswer}{\answerfalse}
+\DeclareOption{amsfonts}{\amsfontstrue}
\DeclareOption{sourcehan}{\sourcehantrue}
+\DeclareOption{display}{\displaytrue}
\DeclareOption{collection}{\collectiontrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}} %其它选项
@@ -28,14 +32,22 @@
% 14bp 12bp 10.5bp 9bp
\LoadClass[cs4size,UTF8,noindent]{ctexart}
+\ifamsfonts
+ \RequirePackage{amssymb}
+\else
+ \RequirePackage[utopia]{mathdesign} % charter, utopia
+ \renewcommand\bfdefault{bx}
+ \let\oldoiint\oiint\renewcommand{\oiint}{\oldoiint\nolimits}
+ \DeclareTextCommandDefault{\nobreakspace}{\leavevmode\nobreak\ }
+\fi
+
\ifsidebyside
\RequirePackage[a3paper,landscape,twocolumn,columnsep=40mm,left=50mm,right=30mm,top=25mm,bottom=25mm]{geometry}
\else
\RequirePackage[a4paper,left=30mm,right=30mm,top=25mm,bottom=25mm]{geometry}
\fi
-\RequirePackage{tabu}
-\RequirePackage{amssymb}
+\RequirePackage{tabularx}
\RequirePackage{lastpage}
\RequirePackage{fancyhdr}
\RequirePackage{xcolor}
@@ -44,9 +56,12 @@
\RequirePackage{etoolbox}
\RequirePackage{calc}
+\newcolumntype{Y}{>{\centering\arraybackslash}X}
+\newcolumntype{n}[1]{>{\centering\arraybackslash}m{#1}}
+
\setlength{\parindent}{0em}
-\setlength{\lineskiplimit}{3pt}
-\setlength{\lineskip}{3pt}
+\setlength{\lineskiplimit}{4pt}
+\setlength{\lineskip}{4pt}
%% ---------------------------------------------------------------------------
%% 密封线命令 \mifengxian
@@ -116,10 +131,10 @@
\newcommand{\head@table@a}{%
\begin{tabular}{l}
- \underbox{11em}{\niandu}学年度第\underbox{5.5em}{\xueqi}学期 \\
- 课程名称:\underbox{17.5em}{\kecheng\ifx\zhuanye\my@empty\else\kern0pt(\zhuanye)\fi} \\
- 授课教师:\underparbox{17.5em}{\centering\rule{0pt}{3ex}\jiaoshi} \\
- 考试时间:\underbox{17.5em}{\shijian} \\
+ \underbox{11\ccwd}{\niandu}学年度第\underbox{5.5\ccwd}{\xueqi}学期 \\
+ 课程名称:\underbox{17.5\ccwd}{\kecheng\ifx\zhuanye\my@empty\else\kern0pt(\zhuanye)\fi} \\
+ 授课教师:\underparbox{17.5\ccwd}{\centering\rule{0pt}{3ex}\jiaoshi} \\
+ 考试时间:\underbox{17.5\ccwd}{\shijian} \\
\end{tabular}
}
@@ -136,9 +151,9 @@
\newcommand{\head@table@c}{%
\begin{tabular}{l}
- \underspace{10em}学院\underspace{8em}专业\underspace{7.5em}班\kern0pt(\kern0pt{}级\kern0pt) \\[1em]
- 姓名\underspace{8em}学号\underspace{10em}\hfill
- \bfseries 内招~[\ischeck{\neizhao}] 外招~[\ischeck{\waizhao}] %\\[0.8em]
+ \underspace{10\ccwd}学院\underspace{8\ccwd}专业\underspace{7.5\ccwd}班\kern0pt(\kern0pt{}级\kern0pt) \\[1em]
+ 姓名\underspace{8\ccwd}学号\underspace{10\ccwd}\hfill
+ \bfseries 内招~[\ischeck{\neizhao}]~~外招~[\ischeck{\waizhao}] %\\[0.8em]
\end{tabular}
}
@@ -151,25 +166,25 @@
\ifx\shijuan\my@temp@c\renewcommand{\shijuan}{D}\fi
\fi
\noindent
- \begin{tabu}{|@{}X@{}|}
+ \begin{tabularx}{\linewidth}{|@{}X@{}|}
\hline\renewcommand{\arraystretch}{1.5}%
- \begin{tabu}{@{}>{\bfseries}l@{}|@{}X@{}|@{}l@{}}
+ {\begin{tabularx}{\linewidth}{@{}>{\bfseries}l@{}|@{}X@{}|@{}l@{}}
\begin{tabular}{l}教\\ 师\\ 填\\ 写\end{tabular} & \head@table@a & \head@table@b
- \end{tabu}\\
+ \end{tabularx}}\\
\hline\renewcommand{\arraystretch}{0.9}%
- \begin{tabu}{@{}>{\bfseries}l@{}|@{}X@{}}
+ {\begin{tabularx}{\linewidth}{@{}>{\bfseries}l@{}|@{}X@{}}
\begin{tabular}{l}考\\ 生\\ 填\\ 写\end{tabular} & \head@table@c
- \end{tabu}\\
+ \end{tabularx}}\\
\hline
- \end{tabu}
- \vspace{1em}
- \noindent\begin{tabu}{|*{8}{X[c]|}}
+ \end{tabularx}
+ \par\vspace{1em}
+ \noindent\begin{tabularx}{\linewidth}{|*{8}{Y|}}
\hline
- \bfseries{题 号} & 一 & 二 & 三 & 四 & 五 & 六 & 总 分\\
+ \textbf{题号} & 一 & 二 & 三 & 四 & 五 & 六 & 总分\\
\hline
- \bfseries{得 分} & & & & & & & \\
+ \parbox[c][2em][c]{2.2em}{\bfseries 得分} & & & & & & & \\
\hline
- \end{tabu}
+ \end{tabularx}
}
%% ---------------------------------------------------------------------------
@@ -218,6 +233,7 @@
\xdef\allproblems{}
\xdef\lastproblem{}
\newcounter{problem}
+\newcommand{\solutionname}{解}
\newcounter{choice} % 后面选择题的 abcd 环境要用到
\newcounter{step} % 后面解答题的 \step 命令要用到
@@ -228,14 +244,14 @@
\setcounter{problem}{0}%
\stepcounter{section}%
\vspace{1em}%
- \noindent\begin{tabu}{|X[c]|X[c]|X[6]}
+ \noindent\begin{tabularx}{\linewidth}{|n{1.7cm}|n{1.7cm}|X}
\cline{1-2}
得分 & 评阅人 & \textbf{\Chinese{section}、#1}\\
\cline{1-2}
& & (#2) \\
\cline{1-2}
- \end{tabu}
- \vspace{1em}
+ \end{tabularx}
+ \par\vspace{1em}
}
\newcommand{\makedata}[1]{%
@@ -249,11 +265,11 @@
\newenvironment{problemreal}{%
\stepcounter{problem}\setcounter{choice}{0}\setcounter{step}{0}%
- \textsf{\color{blue}\arabic{problem}}.\;\,\ignorespaces
+ \textbf{\textsf{{\color{blue}\arabic{problem}}.}}\;\,\ignorespaces
}{\par}
\newenvironment{solutionreal}{%
\setcounter{step}{0}%
- \textsf{\color{blue}解答}\quad\ignorepars
+ \textbf{\textsf{{\color{blue}\solutionname}.}}\;\,\ignorepars
}{\par}
\let \oldnewpage = \newpage
@@ -373,15 +389,16 @@
\newcommand{\answertable}[3][1em]{%
答题须知:本题答案必须写在如下表格中,否则不给分.\par
- \begin{tabu}{|c|*{#3}{X[c]|}}
+ \begin{tabularx}{\linewidth}{|c|*{#3}{Y|}}
\hline
\answer@lines{#1}{#2}{#3}
- \end{tabu}%
+ \end{tabularx}%
\par\vspace{0.8em}%
}
%% ---------------------------------------------------------------------------
%% 答案切换命令 \answer
+%% 判断命令 \true 和 \false
%% 填空命令 \fillin 和 \fillout
%% 选择命令 \pickin 和 \pickout
%% 四个选项排版环境 abcd,根据四个选项的长度自动排成一行、两行或四行
@@ -389,11 +406,14 @@
\newcommand{\answer}[1]{\ifanswer#1\else\phantom{#1}\fi}
+\newcommand{\cdotfill}{\leavevmode\xleaders\hbox to 0.5em{\hss$\cdot$\hss}\hfill\kern0pt\relax}
+\newcommand{\true}{\unskip\nobreak\cdotfill(\makebox[1.5em]{\color{blue}\answer{$\checkmark$}})}
+\newcommand{\false}{\unskip\nobreak\cdotfill(\makebox[1.5em]{\color{blue}\answer{\sffamily x}})}
+
\newcommand{\ulinefill}[1]{\xleaders\hbox{\underline{\vphantom{#1}\kern1pt}}\hfill\kern0pt}
\newcommand{\fillout}[1]{\allowbreak\hbox{}\nobreak\ulinefill{#1}\underline{\color{blue}\answer{#1}}\ulinefill{#1}}
\newcommand{\fillin}[1]{\underline{\hspace{1em}\color{blue}\answer{#1}\hspace{1em}}}
-\newcommand{\cdotfill}{\leavevmode\xleaders\hbox to 0.5em{\hss$\cdot$\hss}\hfill\kern0pt\relax}
\newcommand{\pickout}[1]{\unskip\nobreak\cdotfill(\makebox[1.5em]{\color{blue}\answer{#1}})}
\newcommand{\pickin}[1]{\unskip\nobreak\hspace{0.3em}(\makebox[1.5em]{\color{blue}\answer{#1}})\hspace{0.3em}\ignorespaces}
@@ -431,21 +451,86 @@
\fi
}
-%\newcommand{\my@item}{\ifnum\value{choice}=0\par\fi\stepcounter{choice}}
-%\newcommand{\fullitem}[1]{\my@item\parbox{\linewidth}{(\Alph{choice})\ #1\rule[-0.5em]{0pt}{0.5em}}\hfill\ignorespaces}
-%\newcommand{\halfitem}[2][0.5]{\my@item\makebox[#1\linewidth][l]{(\Alph{choice})\ #2}\hfill\ignorespaces}
-%\newcommand{\quaritem}[2][0.25]{\my@item\makebox[#1\linewidth][l]{(\Alph{choice})\ #2}\hfill\ignorespaces}
-
%% ---------------------------------------------------------------------------
%% 解答题步骤命令 \step
%% ---------------------------------------------------------------------------
\newcommand{\step}{%
\stepcounter{step}%
- \makebox[2em][l]{\ttfamily(\arabic{step})}%
+ \textsf{(\arabic{step})}\;\,%
}
%% ---------------------------------------------------------------------------
+%% 自由对齐命令 \tabpoint, \tabto, \tableft
+%% 命令 \tabpoint 记录当前的水平位置,也可以简写为 \?
+%% 命令 \tabto 跳到之前记录的位置,也可以简写为 \+
+%% 命令 \tableft 跳到之前记录的位置的左侧,也可以简写为 \<
+%% 这些自由对齐命令需要编译两次才能生效
+%% ---------------------------------------------------------------------------
+
+\usepackage{zref-savepos}
+
+\@ifundefined{zsaveposx}{\let\zsaveposx\zsavepos}{} % 旧版本无 \zsaveposx 命令
+
+\newcounter{saveposcnt}
+\newcounter{useposcnt}
+\renewcommand*{\thesaveposcnt}{savepos\number\value{saveposcnt}}
+\renewcommand*{\theuseposcnt}{usepos\number\value{useposcnt}}
+
+\def\my@alignment@offset{}
+
+\def\my@alignment@list{}
+\forcsvlist{\listadd\my@alignment@list}{=,<,>,\le,\ge,\leq,\geq,\approx}
+
+\newlength{\my@alignment@kern}
+
+\newcommand*{\my@alignment@check}[1]{%
+ \ifx\my@let@token #1%
+ \def\my@alignment@offset{5}%
+ \listbreak
+ \fi
+}
+
+\newcommand{\my@alignment@next}{%
+ \ifdefempty{\my@alignment@offset}{%
+ \def\my@alignment@offset{0}%
+ \forlistloop{\my@alignment@check}{\my@alignment@list}%
+ }{}%
+ \settowidth{\my@alignment@kern}{$\mkern\my@alignment@offset mu$}%
+ \stepcounter{saveposcnt}%
+ \rlap{\kern\my@alignment@kern\zsaveposx{\thesaveposcnt}}%
+}
+
+\newcommand*{\tabpoint}[1][]{%
+ \leavevmode
+ \def\my@alignment@offset{#1}%
+ \futurelet\my@let@token\my@alignment@next
+}
+\let \? = \tabpoint
+
+\newcommand*{\tabto}{%
+ \stepcounter{useposcnt}%
+ \zsaveposx{\theuseposcnt}%
+ \noindent
+ \hskip\zposx{\thesaveposcnt}sp\relax
+ \hskip-\zposx{\theuseposcnt}sp\relax
+ \ignorespaces
+}
+\let \+ = \tabto
+
+\newcommand*{\tableft}{%
+ \settowidth{\my@alignment@kern}{$=\mkern5mu$}%
+ \stepcounter{useposcnt}%
+ \zsaveposx{\theuseposcnt}%
+ \noindent
+ \hskip\zposx{\thesaveposcnt}sp\relax
+ \hskip-\zposx{\theuseposcnt}sp\relax
+ \hskip-\my@alignment@kern
+ \ignorespaces
+}
+\let \< = \tableft
+
+%% ---------------------------------------------------------------------------
%% 评分命令 \score
%% ---------------------------------------------------------------------------
@@ -467,6 +552,14 @@
}
%% ---------------------------------------------------------------------------
+%% 文档选项 display 将全部公式都设为展示公式
+%% 命令 \display 将当前环境的公式都设为展示公式
+%% ---------------------------------------------------------------------------
+
+\newcommand{\display}{\everymath\expandafter{\the\everymath\displaystyle}}
+\ifbool{display}{\display}{}
+
+%% ---------------------------------------------------------------------------
%% 载入个人定制文件 jnuexam.cfg
%% 中文字体切换选项 sourcehan
%% ---------------------------------------------------------------------------
@@ -526,6 +619,7 @@
\RequirePackage{CJKfntef}
\RequirePackage{multirow}
\RequirePackage{diagbox}
+\RequirePackage{tabu}
\RequirePackage{relsize}
\newcommand{\Int}{\mathop{\mathlarger{\int}}}
@@ -557,9 +651,15 @@
\renewrobustcmd{\d}{\ifbool{mmode}{\diff}{\oldd}}%
}
-\newcommand{\va}{\vec{a\vphantom{b}}}
+% from mathabx package
+\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
+\DeclareFontShape{U}{mathx}{m}{n}{<-> mathx10}{}
+\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
+\DeclareMathAccent{\widebar}{0}{mathx}{"73}
+
+\newcommand{\va}{\vec{a}}
\newcommand{\vb}{\vec{b}}
-\newcommand{\vc}{\vec{c\vphantom{b}}}
+\newcommand{\vc}{\vec{c}}
\newcommand{\vd}{\vec{d}}
\newcommand{\ve}{\vec{e}}
\newcommand{\vi}{\vec{i}}
diff --git a/macros/latex/contrib/jnuexam/jnuexam.pdf b/macros/latex/contrib/jnuexam/jnuexam.pdf
index 79517e4623..dac435686d 100644
--- a/macros/latex/contrib/jnuexam/jnuexam.pdf
+++ b/macros/latex/contrib/jnuexam/jnuexam.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/jnuexam.tex b/macros/latex/contrib/jnuexam/jnuexam.tex
index f41fb784f6..bfc98e0834 100644
--- a/macros/latex/contrib/jnuexam/jnuexam.tex
+++ b/macros/latex/contrib/jnuexam/jnuexam.tex
@@ -5,9 +5,7 @@
\usepackage[UTF8,noindent]{ctex}
\usepackage{arev}
-\usepackage{ragged2e}
-\usepackage{listings}
-\usepackage{tabu}
+\usefonttheme{professionalfonts}
\makeatletter
@@ -28,39 +26,45 @@
\setlength{\parskip}{7pt plus 1pt minus 1pt}
-\justifying
-\let\oldraggedright\raggedright
-\let\raggedright\justifying
-
-\lstset{
- basicstyle=\ttfamily\color{blue!50!red}
-}
-
-\lstnewenvironment{code}{}{}
-
\setbeamersize{text margin left=8mm,text margin right=8mm}
-\newenvironment{framex}{\begin{frame}[fragile=singleslide,environment=framex]}{\end{frame}}
+\setbeamercolor{normal text}{bg=gray!20}
\setbeamertemplate{frametitle}{\strut\insertframetitle\strut\par}
\setbeamertemplate{navigation symbols}{}
+\newcommand{\cdotfill}{\leavevmode\xleaders\hbox to 0.5em{\hss$\cdot$\hss}\hfill\kern0pt\relax}
+
+\usepackage{tabularx}
+
\newcommand{\ulinefill}[1]{\xleaders\hbox{\underline{\vphantom{#1}\kern1pt}}\hfill\kern0pt}
\newcommand{\fillbox}[1]{\ulinefill{#1}\underline{#1}\ulinefill{#1}}
-\setbeamercolor{normal text}{bg=gray!20}
-
\setbeamertemplate{title page}{%
\renewcommand{\arraystretch}{2}%
\usebeamerfont{title}
- \begin{tabu}{|X|}
+ \begin{tabularx}{\linewidth}{|X|}
\hline
模板名称:\fillbox{\usebeamercolor[fg]{title}\inserttitle} \\
模板作者:\fillbox{\insertauthor} \\
所在单位:\fillbox{\insertinstitute} \\
更新日期:\fillbox{\the\year}年\fillbox{\the\month}月\fillbox{\the\day}日\\
\hline
- \end{tabu}%
+ \end{tabularx}%
+}
+
+\usepackage{ragged2e}
+
+\justifying
+\let\oldraggedright\raggedright
+\let\raggedright\justifying
+
+\usepackage{fancyvrb}
+
+\newenvironment{framex}{\begin{frame}[fragile=singleslide,environment=framex]}{\end{frame}}
+
+\DefineVerbatimEnvironment{code}{Verbatim}{%
+ formatcom=\color{blue!50!red}%
}
\begin{document}
@@ -136,6 +140,22 @@
\end{framex}
\begin{framex}
+\frametitle{判断题目}
+\begin{code}
+\makepart{判断题}{题数分值}
+
+\begin{problem}
+第一道判断题描述。\true
+\end{problem}
+
+\begin{problem}
+第二道判断题描述。\false
+\end{problem}
+\end{code}
+其中 \verb!\true! 和 \verb!\false! 命令分别表示正确和错误。
+\end{framex}
+
+\begin{framex}
\frametitle{填空题目}
\begin{code}
\makepart{填空题}{题数分值}
@@ -243,6 +263,15 @@
\end{framex}
\begin{framex}
+\frametitle{解答名称}
+通过重新定义 \verb!\solutionname! 命令,可以改变 \verb!solution! 环境的名称。
+比如下面例子将“解答”二字改为“证明”:
+\begin{code}
+\renewcommand{\solutionname}{证明}
+\end{code}
+\end{framex}
+
+\begin{framex}
\frametitle{评分命令}
计算题和证明题等主观题的排版方法是完全一样的。在编写这些主观题的解答时,
可以用 \verb!\score! 命令给出各步骤得分。比如:
@@ -256,6 +285,40 @@ $2+2=4$ \score{8}
\end{framex}
\begin{framex}
+\frametitle{对齐命令}
+此文档类提供几个对齐命令,用于在不同行之间对齐。比如
+\vskip1em\hrule
+我们有$(a+b)^2 = (a+b)(a+b)$ \par
+\leavevmode\phantom{我们有$(a+b)^2$}${}= a^2 + 2ab + b^2$ \cdotfill 2分
+\vskip0.6em\hrule\vskip1em
+\begin{code}
+我们有$(a+b)^2 \? = (a+b)(a+b)$ \\
+ \+$= a^2+2ab+b^2$ \score{2}
+\end{code}
+第一个公式内部的 \verb!\?! 保存当前水平位置,
+而第二个公式前面的 \verb!\+! 表示跳到之前保存的位置。
+\par
+这两个对齐命令 \verb!\?! 和 \verb!\+! 需要编译两次才能生效。
+\end{framex}
+
+\begin{framex}
+\frametitle{对齐命令}
+此文档类提供几个对齐命令,用于在不同行的对齐。比如
+\vskip1em\hrule
+我们有$(a+b)^2 = (a+b)(a+b)$ \par
+\leavevmode\phantom{我们\,}${}= a^2 + 2ab + b^2$ \cdotfill 2分
+\vskip0.6em\hrule\vskip1em
+\begin{code}
+我们有 \? $(a+b)^2 = (a+b)(a+b)$ \\
+ \< $= a^2+2ab+b^2$ \score{2}
+\end{code}
+第一行公式前面的 \verb!\?! 保存当前水平位置,
+而第二行公式前面的 \verb!\<! 表示跳到之前保存位置的左侧(左移一个等号的宽度)。
+\par
+这两个对齐命令 \verb!\?! 和 \verb!\<! 需要编译两次才能生效。
+\end{framex}
+
+\begin{framex}
\frametitle{其它题型}
除了上述四种题型之外,其它题型可以用下面方式编写:
\begin{code}
@@ -308,7 +371,7 @@ $2+2=4$ \score{8}
\frametitle{竖直空白}
在试卷的各个小题后面,可以留下一些竖直空白。本文档类支持下列这些竖直空白命令:\par
\renewcommand{\arraystretch}{1.3}%
-\begin{tabu}{XX}
+\begin{tabularx}{\linewidth}{l<{\qquad}X}
\hline
\texttt{\string\smallskip} & 竖直小空白 \\
\hline
@@ -318,7 +381,7 @@ $2+2=4$ \score{8}
\hline
\texttt{\string\vfill} & 竖直填充 \\
\hline
-\end{tabu}
+\end{tabularx}\par
当然,竖直空白命令可以连续使用多个,以得到所需的空白。
\end{framex}
@@ -329,7 +392,7 @@ $2+2=4$ \score{8}
分别只对 A 卷和 B 卷有效。
\par
\renewcommand{\arraystretch}{1.3}%
-\begin{tabu}{XX[2]}
+\begin{tabularx}{\linewidth}{l<{\qquad}X}
\hline
\texttt{\string\newpage} & 分页,对A卷和B卷均有效 \\
\hline
@@ -337,7 +400,7 @@ $2+2=4$ \score{8}
\hline
\texttt{\string\newpageb} & 分页,仅对B卷有效 \\
\hline
-\end{tabu}
+\end{tabularx}\par
在试卷中\alert{不要}使用其他分页命令,比如 \verb!\clearpage! 等。
\end{framex}
diff --git a/macros/latex/contrib/ocgx2/ChangeLog b/macros/latex/contrib/ocgx2/ChangeLog
index 98b07f750c..1296880342 100644
--- a/macros/latex/contrib/ocgx2/ChangeLog
+++ b/macros/latex/contrib/ocgx2/ChangeLog
@@ -1,7 +1,11 @@
+2019-11-07
+ * v0.48: ocgx2.sty
+ * fix: link-making commands failed with empty option arg
+
2019-11-04
* v0.47: ocgx2.sty
- * v0.17: ocgx2.sty
- * fix: 2020 deprecations (fixocgx.sty)
+ * v0.17: ocgbase.sty
+ * fix: output driver set-up
2019-10-01
* v0.46: ocgx2.sty
diff --git a/macros/latex/contrib/ocgx2/ocgx2.sty b/macros/latex/contrib/ocgx2/ocgx2.sty
index 84d7cc855f..bd2e4cb96a 100644
--- a/macros/latex/contrib/ocgx2/ocgx2.sty
+++ b/macros/latex/contrib/ocgx2/ocgx2.sty
@@ -40,8 +40,8 @@
\RequirePackage{xparse}
\RequirePackage{l3keys2e}
-\def\g@ocgxii@date@tl{2019/11/04}
-\def\g@ocgxii@version@tl{0.47}
+\def\g@ocgxii@date@tl{2019/11/07}
+\def\g@ocgxii@version@tl{0.48}
\ProvidesExplPackage{ocgx2}{\g@ocgxii@date@tl}{\g@ocgxii@version@tl}
{ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx}
@@ -748,19 +748,19 @@
% adding optional 2nd argument -> Button Widget (non-breakable) with one of
% various mouse triggers (`troggerocgs` option from ocg-p)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\DeclareDocumentCommand\switchocg{s o m +m}{
+\DeclareDocumentCommand\switchocg{s O{} m +m}{
\ocgxii_actionsocg:nnnnnn{#1}{#2}{#3}{}{}{#4}
}
-\DeclareDocumentCommand\showocg{s o m +m}{
+\DeclareDocumentCommand\showocg{s O{} m +m}{
\ocgxii_actionsocg:nnnnnn{#1}{#2}{}{#3}{}{#4}
}
-\DeclareDocumentCommand\hideocg{s o m +m}{
+\DeclareDocumentCommand\hideocg{s O{} m +m}{
\ocgxii_actionsocg:nnnnnn{#1}{#2}{}{}{#3}{#4}
}
-\DeclareDocumentCommand\actionsocg{s o m m m +m}{
+\DeclareDocumentCommand\actionsocg{s O{} m m m +m}{
\ocgxii_actionsocg:nnnnnn{#1}{#2}{#3}{#4}{#5}{#6}
}
@@ -786,21 +786,21 @@
%
%process *all* mouse triggers (e,d,u,x)
\ocgxii_ocglist_process_idlist:nn{
- \IfValueTF{#2}{#2}{onmouseup}
+ \tl_if_blank:oTF{#2}{onmouseup}{#2}
}{#3}
\tl_set_eq:NN\l_ocgxii_toswitch_e_tl\l_ocgxii_e_list_tl
\tl_set_eq:NN\l_ocgxii_toswitch_x_tl\l_ocgxii_x_list_tl
\tl_set_eq:NN\l_ocgxii_toswitch_d_tl\l_ocgxii_d_list_tl
\tl_set_eq:NN\l_ocgxii_toswitch_u_tl\l_ocgxii_u_list_tl
\ocgxii_ocglist_process_idlist:nn{
- \IfValueTF{#2}{#2}{onmouseup}
+ \tl_if_blank:oTF{#2}{onmouseup}{#2}
}{#4}
\tl_set_eq:NN\l_ocgxii_toshow_e_tl\l_ocgxii_e_list_tl
\tl_set_eq:NN\l_ocgxii_toshow_x_tl\l_ocgxii_x_list_tl
\tl_set_eq:NN\l_ocgxii_toshow_d_tl\l_ocgxii_d_list_tl
\tl_set_eq:NN\l_ocgxii_toshow_u_tl\l_ocgxii_u_list_tl
\ocgxii_ocglist_process_idlist:nn{
- \IfValueTF{#2}{#2}{onmouseup}
+ \tl_if_blank:oTF{#2}{onmouseup}{#2}
}{#5}
\tl_set_eq:NN\l_ocgxii_tohide_e_tl\l_ocgxii_e_list_tl
\tl_set_eq:NN\l_ocgxii_tohide_x_tl\l_ocgxii_x_list_tl
diff --git a/macros/latex/contrib/ucsmonograph/README.md b/macros/latex/contrib/ucsmonograph/README.md
index 4884b35df0..066d57d604 100644
--- a/macros/latex/contrib/ucsmonograph/README.md
+++ b/macros/latex/contrib/ucsmonograph/README.md
@@ -114,11 +114,19 @@ Fixes:
* Paragraph first line indent.
v1.2.0 (2018-11-22, Henrique Baron):
-* Added macros `\areadoconhecimento`, `\avaliadori`, `\avaliadorii`, `\avaliadorext` and `\incluirimagem*`;
+* Added macros `\areadoconhecimento`, `\avaliadori`, `\avaliadorii`, `\avaliadorext` and `\incluirimagem`;
* Layout changes in the content generated by the `\imprimircapa`, `\imprimirfolhaderosto` and `\imprimirfolhadeaprovacao` macros;
* The `\imprimirfolhadeaprovacao` macro now takes only one mandatory argument;
* Package `\icomma` automatically included;
-* Page vertical layout improved with `\raggedbottom` instead of `\flushbottom`.
+
+v1.2.1 (Henrique Baron):
+* Compatibility fix due to an update of the package `enumerate`;
+
+v1.3.0 (2019-11-07, Henrique Baron):
+* Improvements on the `epigrafe` environment;
+* Fix on the `\imprimirfolhaderosto` macro;
+* Multi-language support for the `resumo` environment and the `\palavraschave` macro;
+* Created macro `\imprimirpalavraschave`.
# ucsmonograph - Português (BR)
Esta é uma classe LaTeX para formatação de trabalhos acadêmicos segundo o Guia para Elaboração de Trabalhos Acadêmicos da Universidade de Caxias do Sul.
diff --git a/macros/latex/contrib/ucsmonograph/ucsmonograph.dtx b/macros/latex/contrib/ucsmonograph/ucsmonograph.dtx
index ffd226be48..059f16c76c 100644
--- a/macros/latex/contrib/ucsmonograph/ucsmonograph.dtx
+++ b/macros/latex/contrib/ucsmonograph/ucsmonograph.dtx
@@ -33,7 +33,7 @@
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{ucsmonograph}
%<*class>
- [2018/12/10 v1.2.1 Padrao de monografias da UCS]
+ [2019/11/07 v1.3.0 Padrao de monografias da UCS]
%</class>
%
%<*driver>
@@ -56,7 +56,7 @@
%</driver>
%\fi
-% \CheckSum{648}
+% \CheckSum{771}
% \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
@@ -77,6 +77,7 @@
%\changes{v1.0.0}{2018/07/31}{Versão inicial}
%\changes{v1.1.0}{2018/08/16}{Configuração automática do pacote hyperref; correção na necessidade de chamar o pacote glossaries-extra; geração automática dos bookmarks do PDF}
%\changes{v1.2.0}{2018/11/22}{inclusão do pacote icomma; posicionamento vertical com raggedright}
+%\changes{v1.2.1}{2018/12/10}{Correção de compatibilidade com o pacote substr}
%
%\GetFileInfo{ucsmonograph.dtx}
%
@@ -183,7 +184,7 @@
%
%\section{Introdução}
% Esta classe foi desenvolvida para formatar monografias segundo o Guia para Elaboração de Trabalhos Acadêmicos da Universidade de Caxias do Sul.
-% Este código foi desenvolvido tendo por base a versão 2018 do documento, e tem por objetivo simplificar o uso do \LaTeX~por alunos da UCS que têm pouca experiencia na linguagem, abstraindo algumas configurações de formatação e comandos mais complexos.
+% Este código foi desenvolvido tendo por base a versão 2018 do documento, e tem por objetivo simplificar o uso do \LaTeX\ por alunos da UCS que têm pouca experiencia na linguagem, abstraindo algumas configurações de formatação e comandos mais complexos.
%
% A classe |ucsmonograph| é baseada na classe |abntex2|, que formata documentos acadêmicos segundo as normas ABNT.
% O código desenvolvido realiza alterações em algumas macros e expõe outros que são necessários para antender requisitos da UCS, mas que não são oferecidos pela classe |abntex2| por padrão.
@@ -191,7 +192,7 @@
%\subsection{Se seu documento possui fórmulas}
% Pode ser necessário compilar o trabalho com Lua\LaTeX.
% Mesmo para iniciantes no \LaTeX, essa não é uma mudança complicada, e pode ser necessária para atender uma exigência da UCS.
-% Isso porque o padrão da universidade diz que a fonte deve ser a mesma em \emph{todo} o documento, inclusive nas fórmulas, onde o \LaTeX e até mesmo outros editores como o Microsoft Word utilizam uma fonte diferente.
+% Isso porque o padrão da universidade diz que a fonte deve ser a mesma em \emph{todo} o documento, inclusive nas fórmulas, onde o \LaTeX\ e até mesmo outros editores como o Microsoft Word utilizam uma fonte diferente.
% Isso serve para deixar o documento de fato mais legível e mais ''bonito'', e é possível negociar com os responsáveis se existe margem para manter essa diferença de fontes entre texto e equações.
%
% Caso não seja permitido, é o ponto onde o Lua\LaTeX~entra.
@@ -214,7 +215,7 @@
% Para utilizar a classe |ucsmonograph|, é recomendado consultar os manuais da classe |abntex2| e do pacote |abntex2cite|, que é utilizado para as referências bibliográficas.
% Este manual descreve apenas os comandos desenvolvidos na própria classe |ucsmonograph| e outras redefinições de comandos que podem ser pertinentes ao usuário.
%
-%\subsection{Chamada da classe e opções}
+%\subsection{Chamada da classe e opções}\label{sec:chamada-classe}
%\DescribeMacro{\documentclass}
% A classe pode ser chamada com as opções-padrão que são nativas do \LaTeX~e são encaminhadas para a classe |abntex2|.
% Um exemplo típico para chamar a classe ao iniciar o documento pode ser
@@ -252,6 +253,42 @@
%
% Também para o caso dos editores online, a lista de símbolos pode ser feita manualmente no ambiente |simbolos|, documentado no manual da classe |abntex2|.
%
+%\subsection{Exemplo básico}
+% Para o desenvolvimento de uma monografia com a classe |ucsmonograph|, algumas propriedades do documento devem ser definidas, como o autor, título, entre outros.
+% Existem macros implementadas nesta classe e na classe |abntex2| (que é utilizada como base) disponibilizadas para atribuir estas propriedades,
+% e que devem ser chamadas no começo do documento.
+% Seja neste manual ou no manual da classe |abntex2|, estas funções estão documentadas.
+% De toda forma, um exemplo básico da chamada destas, para servir como ponto de partida, é exibido abaixo:
+%\begin{verbatim}
+% \documentclass[12pt,oneside,english,brazil,lmodern,cite=num]{ucsmonograph}
+% \usepackage[utf8]{inputenc}
+% \usepackage[T1]{fontenc}
+%
+% \titulo{Modelagem numérica de vibração em rolamentos defeituosos}
+% \autor{Henrique Baron}
+% \data{2018}
+% \instituicao{Universidade de Caxias do Sul}
+% \local{Caxias do Sul}
+% \preambulo{Trabalho de conclusão de curso apresentado à Universidade de Caxias do Sul
+% como requisito parcial à obtenção do grau de Engenheiro Mecânico.}
+% \areadoconhecimento{Área do conhecimento de ciências exatas e engenharias}
+% \orientador{Prof. Me. Pedro da Silva} % Orientador do trabalho
+% \avaliadori{Prof. Me. Paulo Oliveira} % Avaliador da banca, da instituição
+% \avaliadorii{Profa. Dra. Maria Pereira} % Avaliador da banca, da instituição
+% \avaliadorext[Empresa X]{Cristiane Silveira} % Avaliaodr da banca, de instituição externa
+% % Palavras-chave que aparecem no resumo em português
+% \palavraschave{Vibra\c{c}\~ao. Modelagem. Defeito. Rolamento.}
+% % Palavras-chave em idioma estrangeiro (o mesmo configurado nas opções da classe!)
+% \palavraschave[english]{Vibration. Modelling. Defect. Bearing.}
+%
+% \begin{document}
+% \imprimircapa
+% \imprimirfolhaderosto
+% \imprimirfolhadeaprovacao{29/11/2018}
+%
+% \end{document}
+%\end{verbatim}
+%
%\subsection{Quadros e lista de quadros}
% Por padrão, o \LaTeX~já oferece meios de criar tabelas e a lista de tabelas.
% Para o caso dos quadros, que são um elemento obrigatório pelo Guia da UCS, não há nenhum recurso desenvolvido, nem na classe |abntex2|.
@@ -268,6 +305,10 @@
%\DescribeMacro{\listofquadros*}
% Gera a lista de quadros, sem colocar essa entrada no sumário.
%
+%\section{Macros redefinidas e implementadas}
+% As subseções seguintes descrevem macros e ambientes que foram implementados na classe |ucsmonograph|,
+% ou redefinições de comandos da classe |abntex2| que foram realizadas nesta classe.
+%
%\subsection{Redefinições da classe abn\TeX 2}
% Alguns comandos e ambientes expostos pela classe |abntex2| foram redefinidos ou modificados na classe |ucsmonograph|, e essas alterações são apresentadas a seguir.
%
@@ -286,6 +327,36 @@
%\DescribeMacro{\orientador}
% A função da macro |\orientador|\marg{nome} foi estendida de maneira semelhante à macro |\autor|.
%
+%\DescribeEnv{resumo}
+% O ambiente |resumo| foi totalmente redefinido na classe |ucsmonograph|.
+% Ele continua recebendo um parâmetro opcional, no entanto, agora este parâmetro deve receber o nome da língua em que o resumo será escrito,
+% caso seja diferente do idioma padrão do documento.
+% Com isso, o padrão de hifenização do idioma selecionado é aplicado a todo o texto contido no ambiente.
+%
+% Conforme a norma ABNT, o resumo do trabalho deve ser apresentado no idioma vernáculo (no caso da UCS, o português brasileiro),
+% e em um idioma estrangeiro.
+% Dessa maneira, o ambiente |resumo| deve ser utilizado duas vezes no documento: uma delas não leva o argumento opcional,
+% enquanto a outra deve receber o idioma em que o resumo é apresentado.
+% Um exemplo com as duas chamadas do ambiente é mostrado abaixo:
+%\begin{verbatim}
+% \begin{resumo}
+% O presente trabalho demonstra a aplicação da Teoria da Relatividade...
+% \end{resumo}
+%
+% \begin{resumo}[english]
+% The present work demonstrates the application of the Relativity Theory...
+% \end{resumo}
+%\end{verbatim}
+% Com isso, o título \emph{RESUMO} e a expressão \emph{Palavras-chave} também são adaptados ao idioma escolhido.
+% É importante que o idioma estrangeiro selecionado tenha sido incluído \emph{também nas opções da classe},
+% como é mostrado na Seção \ref{sec:chamada-classe}.
+%
+% Por fim, as palavras-chave do documento, definidas com a macro\\
+%|\palavraschave|\oarg{idioma}\marg{palavras},
+% são incluídas automaticamente no fim do resumo.
+% As palavras-chave também devem ser definidas para os dois idiomas do resumo, o que fará com que o conjunto certo
+% de palavras-chave seja exibido.
+%
%\DescribeEnv{dedicatoria}
% O ambiente |dedicatoria| foi modificado para que não seja necessário aplicar qualquer formatação, nem escrever dentro de um ambiente |minipage|, como sugere o manual da classe |abntex2|.
% Dessa maneira, a dedicatória pode ser escrita simplesmente como:
@@ -295,6 +366,22 @@
% \end{dedicatoria}
%\end{verbatim}
%
+%\DescribeEnv{epigrafe}
+% O ambiente |epigrafe| foi modificado da mesma forma que o ambiente |dedicatoria|, para que o posicionamento do texto seja feito automaticamente como pede o Guia da UCS.
+% Portanto, o ambiente pode ser utilizado da seguinte maneira:
+%\begin{verbatim}
+% \begin{epigrafe}
+% ''Uma mente que se abre a uma nova ideia nunca mais volta ao tamanho
+% original.''
+% \vspace{12pt}
+%
+% \textbf{Albert Einstein}
+% \end{epigrafe}
+%\end{verbatim}
+%
+% O guia solicita que o nome do autor seja destacado em negrito.
+% A mudança desta parte e o espaçamento do nome para o resto do texto devem ser feitos manualmente, como mostrado no exemplo acima.
+%
%\DescribeMacro{\fonte}
% Essa macro foi redefinida para que o texto seja alinhado à esquerda -- e não centralizado como na definição original na classe |abntex2| -- e para que o texto ''Fonte'' seja separado do argumento passado pelo usuário por dois pontos, e não por um travessão.
%
@@ -323,6 +410,26 @@
% Esta macro foi criada para ser utilizada de maneira similar às macros |\autor|, |\titulo|, |\preambulo| e |\orientador| que são fornecidas pela classe |abntex2|.
% Ela deve ser chamada, portanto, \emph{no preâmbulo do seu código}, isto é, antes de |\begin{document}|.
%
+% A macro |\palavraschave| recebe também um argumento opcional, que define o idioma das palavras-chave fornecidas.
+% Como as palavras-chave são exibidas no \emph{resumo}, que deve ser incluído em dois idiomas,
+% esta macro também deve ser chamada duas vezes: uma sem o parâmetro opcional,
+% que indica que são as palavras-chave no idioma principal do documento;
+% e outra com o nome do idioma estrangeiro que é utilizado no resumo do trabalho.
+% A chamada duplicada desta macro é exibida no exemplo abaixo:
+%\begin{verbatim}
+% \palavraschave{Vibração. Modelagem. Defeito. Rolamento.}
+% \palavraschave[english]{Vibration. Modelling. Defect. Bearing.}
+%\end{verbatim}
+%
+% É importante que o segundo idioma que é passado como parâmetro para a macro tenha sido declarado como opção ao chamar a classe,
+% como é mostrado na Seção \ref{sec:chamada-classe}.
+%
+%\DescribeMacro{\imprimirpalavraschave}
+% Esta macro simplesmente exibe as palavras-chave configuradas com o comando\\
+% |\palavraschave|\oarg{idioma}\marg{palavras},
+% precedidas da expressão \emph{Palavras-chave}, destacada em negrito,
+% conforme especificado pelo guia da UCS.
+%
%\DescribeMacro{\aredoconhecimento}
% Define a área do conhecimento do trabalho desenvolvido, que é impressa na capa do trabalho.
% Esta macro possui apenas um argumento.
@@ -557,6 +664,25 @@
% \end{macrocode}
%\end{macro}
%
+%\subsection{Definição de constantes}
+%Declaração das constantes de texto da classe.
+%\begin{macro}{\palavraschavename}
+% Constante que armazena a expressão \textit{Palavras-chave}, no idioma em que o texto estiver sendo escrito.
+% \begin{macrocode}
+\newcommand{\palavraschavename}{Palavras-chave:}
+\addto\captionsenglish{
+ \renewcommand\palavraschavename{Keywords:}
+}
+\addto\captionsgerman{
+ \renewcommand\palavraschavename{Stichw\"orter:}
+}
+\addto\captionsspanish{
+ \renewcommand\palavraschavename{Palabras-llave:}
+}
+
+% \end{macrocode}
+%\end{macro}
+%
%\subsection{Lista de quadros}
% Mostra a implementação da lista de quadros, que é um elemento obrigatório em monografias da UCS, mas não é implementado na classe |abntex2|.
%\begin{macro}{Quadros}
@@ -823,6 +949,30 @@
% \end{macrocode}
%\end{macro}
%
+%\begin{environment}{folhaderosto}
+%\changes{v1.3.0}{2019/08/29}{Redefinir os ambientes internos de folha de rosto}
+% Os ambientes |folhaderosto| e |folhaderosto*| da classe |abntex2| foram redefinidos para corrigir um erro provocado por comandos frágeis.
+% Um erro era gerado se não fosse deixada uma linha em branco (quebra de parágrafo) após o comando |imprimirfolhadefosto|.
+% \begin{macrocode}
+\renewenvironment{folhaderosto}[1]{\clearpage\PRIVATEbookmarkthis{#1}}{\cleardoublepage}
+\renewenvironment{folhaderosto*}[1]{\clearpage\PRIVATEbookmarkthis{#1}}{\newpage}
+
+% \end{macrocode}
+%\end{environment}
+%
+%\begin{macro}{\imprimirfolhaderosto}
+%\changes{v1.3.0}{2019/08/29}{Redefinir o comando para imprimir a folha de rosto}
+% O comando |\imprimirfolhaderosto| da classe |abntex2| foi redefinido para corrigir um erro provocado por comando frágil.
+% Um erro era gerado se não fosse deixada uma linha em branco após o comando.
+% \begin{macrocode}
+\renewcommand{\imprimirfolhaderosto}[1][\folhaderostoname]{%
+ \@ifstar{\imprimirfolhaderostostar#1}{%
+ \imprimirfolhaderostonostar#1}
+}
+
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\folhaderostocontent}
%\changes{v1.1.1}{2018/09/18}{Corrigir justificação do nome do orientador}
%\changes{v1.1.2}{2018/09/28}{Mudar o conteúdo para negrito}
@@ -907,6 +1057,75 @@
% \end{macrocode}
%\end{environment}
+%
+%\begin{environment}{epigrafe}
+%\changes{v1.3.0}{2019/08/29}{Redefinição do ambiente de epígrafe}
+% Extensão do ambiente |epigrafe| para isentar o usuário da necessidade de formatar manualmente a posição do texto.
+% \begin{macrocode}
+\let\@oldepigrafe\epigrafe
+\let\@oldendepigrafe\endepigrafe
+\def\epigrafe{%
+ \@oldepigrafe %
+ \vspace*{\fill}%
+ \hspace{0.5\textwidth}%
+ \begin{minipage}[b]{.45\textwidth}%
+ \SingleSpacing\itshape\raggedleft%
+}
+\def\endepigrafe{%
+ \end{minipage}%
+ \@oldendepigrafe
+}
+
+% \end{macrocode}
+%\end{environment}
+%
+%\begin{environment}{resumo}
+%\changes{v1.3.0}{2019/09/02}{Redefinição do ambiente resumo}
+% O ambiente |resumo| foi totalmente redefinido para que o idioma do resumo seja selecionado como um argumento opcional.
+% \begin{macrocode}
+\renewcommand\abstractnamefont\chaptitlefont
+\newboolean{@abstractotherlanguage}
+\setboolean{@abstractotherlanguage}{false}
+\DeclareRobustCommand\resumo{\@ifnextchar[{\@@resumo}{\@resumo}}
+\def\@resumo{%
+ \let\@oldabstractname\abstractname
+ \PRIVATEbookmarkthis{\abstractname}
+ \def\abstractname{\MakeUppercase{\@oldabstractname}}
+ \begin{abstract}
+ \SingleSpacing
+}
+\def\@@resumo[#1]{%
+ \begin{otherlanguage}{#1}
+ \setboolean{@abstractotherlanguage}{true}
+ \let\@oldabstractname\abstractname
+ \PRIVATEbookmarkthis{\abstractname}
+ \def\abstractname{\MakeUppercase{\@oldabstractname}}
+ \begin{abstract}
+ \SingleSpacing
+}
+\def\endresumo{%
+ \vspace{\onelineskip}\par
+ \imprimirpalavraschave
+ \end{abstract}
+ \PRIVATEclearpageifneeded
+ \ifthenelse{\boolean{@abstractotherlanguage}}{\end{otherlanguage}}{}
+ \setboolean{@abstractotherlanguage}{false}
+ \def\abstractname\@oldabstractname
+}
+
+% \end{macrocode}
+%\end{environment}
+%
+%\begin{macro}{\imprimirpalavraschave}
+%\changes{v1.3.0}{2019/11/07}{Criação do comando}
+% O comando |\imprimirpalavraschave| foi criado para formatar o texto que contém as palavras-chave do documento.
+% \begin{macrocode}
+\newcommand\imprimirpalavraschave{%
+ \textbf{\palavraschavename}\ \@palavraschavecontent}
+
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\autor}
% Extensão da macro que define o nome do título, para que isso seja automaticamente passado para o pacote |hyperref|.
% \begin{macrocode}
@@ -1058,22 +1277,31 @@
%\subsection{Comandos específicos desta classe}
% No final do código são definidos os comandos produzidos pela classe |ucsmonograph| propriamente dita.
%
-%\begin{macro}{\@palavraschave}
+%\begin{macro}{\@palavraschavecontent}
% É uma macro utilizada como variável, que armazena as palavras-chave definidas pelo usuário.
% \begin{macrocode}
-\newcommand{\@palavraschave}{}
+\newcommand{\@palavraschavecontent}{}
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{\palavraschave}
-% Redefine o conteúdo da macro |\@palavraschave| e configura também esse conteúdo no pacote |hyperref|.
-% \begin{macrocode}
-\newcommand{\palavraschave}[1]{%
- \renewcommand{\@palavraschave}{#1}
+%\changes{v1.3.0}{2019/11/07}{Adicionar parâmetro opcional de idioma ao comando}
+% Redefine o conteúdo da macro |\@palavraschavecontent| e configura também esse conteúdo no pacote |hyperref|.
+% Se o parâmetro opcional for utilizado, o conteúdo é armazenado para ser utilizado no resumo em outros idiomas,
+% e o hyperref não é configurado neste caso.
+% \begin{macrocode}
+\DeclareRobustCommand\palavraschave{\@ifnextchar[{\@@palavraschave}{\@palavraschave}}
+\def\@palavraschave#1{%
+ \renewcommand\@palavraschavecontent{#1}
\hypersetup{%
pdfkeywords={#1}
}
}
+\def\@@palavraschave[#1]#2{
+ \expandafter\addto\csname captions#1\endcsname{
+ \renewcommand\@palavraschavecontent{#2}
+ }
+}
% \end{macrocode}
%\end{macro}
@@ -1301,4 +1529,4 @@
%
%\Finale
%\PrintChanges
-%\PrintIndex \ No newline at end of file
+%\PrintIndex
diff --git a/macros/latex/contrib/ucsmonograph/ucsmonograph.pdf b/macros/latex/contrib/ucsmonograph/ucsmonograph.pdf
index 822cbb874a..a3555c499d 100644
--- a/macros/latex/contrib/ucsmonograph/ucsmonograph.pdf
+++ b/macros/latex/contrib/ucsmonograph/ucsmonograph.pdf
Binary files differ