8

When formatting sections, I see things like \renewcommand \thesection{\Roman{section}}.

I'm currently working on a set of Japanese History course notes, how would one go about defining a \Chinese command to use chinese/japanese numbering for my chapter headings?

Alternatively, if someone could point me to the place in the LaTeX codebase where I could find the particular definition that would work as well. I attempted to grep and find in my texlive installation but failed to find it.

EricR
  • 3,117
  • 9
  • 29
  • 33
  • Is this the kind of numerals that you mean? http://en.wikipedia.org/wiki/Japanese_numerals – David Carlisle Oct 06 '12 at 21:03
  • Yes those numerals, e.g., 一二三四五。。。 – EricR Oct 06 '12 at 21:07
  • @EricR Can you provide minimal working example (MWE) so that we know how you use which fonts? – Qrrbrbirlbel Oct 06 '12 at 21:54
  • Sorry @Qrrbrbirlbel, an MWE is a bit hard to extract at this point (working on a custom class), but I'm using fonts via \usepackage{xeCJK} \setCJKmainfont{DFKai-SB}. I hope this answers your question. – EricR Oct 06 '12 at 22:20
  • @EricR The reason why I was asking for that information was to reassure that my answer (zhnumber) was working with your setup. I've never used Chinese or Japanese character and I could not validate the results I got (correct numbers?). – Qrrbrbirlbel Oct 06 '12 at 22:45
  • @Qrrbrbirlbel, I've marked as correct since the documenation says that should work (my chinese is passable), however I'm getting the error for out of date l3kernel l3packages. I'm going to update to texlive2012 soon and I'll update this accordingly. – EricR Oct 07 '12 at 00:04

1 Answers1

11

There is the zhnumber package. The documentation might tell you more than me …

MWE (by Leo Liu)

\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{SimSun}
\usepackage{zhnumber}
\renewcommand\thesection{\zhnum{section}}
\renewcommand{\thesubsection}{\thesection.\zhnum{subsection}}
\begin{document}
\section{One}
\setcounter{section}{9}
\section{Ten}
\subsection{Ten.One}
\setcounter{section}{74}
\section{Seventy four}
\setcounter{section}{999}
\section{One thousand}
\end{document}

Output

enter image description here

Qrrbrbirlbel
  • 119,821