summaryrefslogtreecommitdiff
path: root/macros/generic/tex-locale/samples/sample-locale-xeltx2.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/generic/tex-locale/samples/sample-locale-xeltx2.tex
Initial commit
Diffstat (limited to 'macros/generic/tex-locale/samples/sample-locale-xeltx2.tex')
-rw-r--r--macros/generic/tex-locale/samples/sample-locale-xeltx2.tex96
1 files changed, 96 insertions, 0 deletions
diff --git a/macros/generic/tex-locale/samples/sample-locale-xeltx2.tex b/macros/generic/tex-locale/samples/sample-locale-xeltx2.tex
new file mode 100644
index 0000000000..fad6ac3800
--- /dev/null
+++ b/macros/generic/tex-locale/samples/sample-locale-xeltx2.tex
@@ -0,0 +1,96 @@
+% arara: xelatex
+\documentclass{article}
+
+\usepackage[other={pt-BR,de-CH-1996,fr-BE},timedata]{tex-locale}
+
+\setmainfont{STIX}
+
+\newcount\tmpctr
+
+\newcommand{\test}{%
+ \section{Document language \languagename\space
+ (\CurrentTrackedLanguageTag)}
+ \subsection{datetime2 commands}
+ \texttt{\string\today}: \today.
+ \texttt{\string\DTMcurrenttime}: \DTMcurrenttime.
+ \subsection{Locale Details}
+ Language: \CurrentLocaleLanguageNativeName.
+ Region: \CurrentLocaleRegionNativeName.
+ \subsection{Dates and Times (Obtained from Java)}
+ Today: \CurrentLocaleDate.
+ Time: \CurrentLocaleTime.
+ First day of the week:
+ \CurrentLocaleStandaloneDayName{\CurrentLocaleFirstDayIndex}
+ (index: \CurrentLocaleFirstDayIndex).
+ Current month:
+ \CurrentLocaleStandaloneMonthName{\month}.
+ \par
+ Days of the week:%
+ \tmpctr=1\relax
+ \loop
+ \space
+ \CurrentLocaleStandaloneDayName
+ {\CurrentLocaleDayIndexFromRegion{\tmpctr}}%
+ \advance\tmpctr by 1
+ \ifnum\tmpctr<8
+ \repeat
+ .
+ \par
+ Full date-time pattern:
+ \texttt{\LocaleGetDialectAttribute{\CurrentTrackedDialect}{fulldatetimefmt}}
+ \par
+ Apply full date-time pattern:
+ \CurrentLocaleApplyDateTimePattern{fulldatetimefmt}{\LocaleDateTimeInfo}
+ \subsection{Numeric}
+ Numeric symbols:
+ \CurrentLocaleNumericGroupSep\ (group separator)
+ \CurrentLocaleDecimalSep\ (decimal separator)
+ \CurrentLocaleMonetarySep\ (monetary separator)
+ \CurrentLocaleExponent\ (exponent)
+ \CurrentLocalePercent\ (percent)
+ \CurrentLocalePermill\ (per mill).
+ \par
+ Uses numeric group separator:
+ \CurrentLocaleIfNumericUsesGroup{yes}{no}.
+ \par
+ Currency symbol: \CurrentLocaleCurrency
+ \par
+ Integer:
+ \texosqueryfmtnumber{\CurrentLocaleIntegerPattern}{123456}{0}{0}
+ \par
+ Decimal:
+ \texosqueryfmtnumber{\CurrentLocaleDecimalPattern}{123456}{78}{0}
+ \par
+ Percentage:
+ \texosqueryfmtnumber{\CurrentLocalePercentPattern}{0}{65}{0}
+ \par
+ Currency:
+ \texosqueryfmtnumber{\CurrentLocaleCurrencyPattern}{1234567}{0}{0}
+}
+
+\renewcommand*{\localedatetimefmt}[1]{\localenopolypunct{#1}}
+
+\begin{document}
+\section{General Information}
+
+OS name: \LocaleOSname.
+OS version: \LocaleOSversion.
+OS arch: \LocaleOSarch.
+
+Default file encoding: \LocaleOScodeset.
+
+The PDF file was last built: \texttt{\LocaleNowStamp}.
+
+The source file was last modified: \texttt{\LocaleFileMod}.
+
+Main locale: \LocaleMain\ (\LocaleMainDialect).
+
+Other locales: \LocaleOther.
+
+\ForEachTrackedLanguage{\thislanguage}
+{%
+ \selectlanguage{\thislanguage}
+ \test
+}
+
+\end{document}