[Cjk] ***SPAM*** Let the \today command to give the chinese format of the data.

Hongsheng Zhao zhaohscas at yahoo.com.cn
Tue Nov 25 05:17:20 CET 2008


Dear Werner,

I want to use the \date{} or \today command in the title page of my
Chinese beamer presentation, so the date format should be better in
Chinese.  In detail, I want the following data format something like the following are given:

二零零八年十一月二十四日 星期一


In addition, Andrew <andmos at gmail.com> from the C.T.T. give me the following example tested by him using XeLaTeX:

---------------------
\documentclass{article}
\usepackage{fontspec}
\setmainfont{KaiTi_GB2312}

\makeatletter
\newcounter{tempa}
\newcounter{tempb}
\newcounter{tempc}
\newcounter{tempd}

\setcounter{tempa}{\the\year}
\setcounter{tempb}{\thetempa}
\divide\c at tempa by 1000
\addtocounter{tempb}{-\thetempa000}
\setcounter{tempc}{\thetempb}
\divide\c at tempb by 100
\addtocounter{tempc}{-\thetempb00}
\setcounter{tempd}{\thetempc}
\divide\c at tempc by 10
\addtocounter{tempd}{-\thetempc0}

\def\zhnum#1{%
  \ifcase#1 零\or
  一\or 二\or 三\or 四\or 五\or
  六\or 七\or 八\or 九\or 十\or
  十一\or 十二\or 十三\or 十四\or 十五\or
  十六\or 十七\or 十八\or 十九\or 二十\or
  二十一\or 二十二\or 二十三\or 二十四\or 二十五\or
  二十六\or 二十七\or 二十八\or 二十九\or 三十\or
  三十一\fi}

\usepackage{eukdate}
\addtocounter{euk at date}{-1}
\ifnum\theeuk at date<1
  \addtocounter{euk at date}{7}
\fi

\edef\today{%
  \zhnum\thetempa\zhnum\thetempb%
  \zhnum\thetempc\zhnum\thetempd 年%
  \zhnum{\number\month}月%
  \zhnum{\number\day}日%
  星期\zhnum\theeuk at date}

\begin{document}
\today
\end{document} 
---------------------

But, I want to fulfill it within CJK, would you like give me some hints?  Thanks in advance.

Regards,
-- 
Hongsheng Zhao <zhaohscas at yahoo.com.cn> 
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences 
GnuPG DSA: 0xD108493
2008-11-25
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xelatex_date.tex
Type: application/octet-stream
Size: 1110 bytes
Desc: not available
Url : http://lists.ffii.org/pipermail/cjk/attachments/20081125/b417362e/attachment.obj 


More information about the Cjk mailing list