\shortmonthname 表示日期时间中的德语

\shortmonthname 表示日期时间中的德语

似乎如果您将文档设置为ngermandatetime目前仅支持星期几的缩写名称(Mo、Di、Mi ......),但不支持月份名称的缩写名称(Jan、Feb、Mär ......)。我可以在文件的前言中放入什么.tex来获取德语月份名称的三个字母的缩写?

答案1

与文档和文件中所述类似dt-ngerman.def,获取缩写月份名称的代码应如下所示:

\makeatletter
\providecommand{\shortmonthnamengerman}[1][\month]{%
\@orgargctr=#1\relax
\ifcase\@orgargctr
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{%
Month numbers should go from 1 to 12}%
\or Jan%
\or Feb%
\or M\"ar%
\or Apr%
\or Mai%
\or Jun%
\or Jul%
\or Aug%
\or Sep%
\or Okt%
\or Nov%
\or Dez%
\else
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{%
Month numbers should go from 1 to 12}%
\fi}%
\let\shortmonthnamengerman\shortmonthnamengerman
\makeatother

如果有时间可以将这个列表添加到包中就好了datetime


梅威瑟:

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{datetime}

% Customizing datetime
\makeatletter
\providecommand{\shortmonthnamengerman}[1][\month]{
\@orgargctr=#1\relax
\ifcase\@orgargctr
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}
\or Jan
\or Feb
\or M\"ar
\or Apr
\or Mai
\or Jun
\or Jul
\or Aug
\or Sep
\or Okt
\or Nov
\or Dez
\else
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}
\fi}
\let\shortmonthnamengerman\shortmonthnamengerman
\makeatother

\newdateformat{mladate}{\the\day~\shortmonthname[\the\month]~\the\year}

\begin{document}

\today

\mladate\today

\ddmmyyyydate\today

\end{document}

日期格式演示

相关内容