4

The page here

Use of Chinese numers similar to \Roman and \Arabic

shows how to produce Chinese numerals, but according to Howard Eves' history of math textbook, these numerals should be displayed vertically. How might that be achieved? I know a similar question was posed (and solved) about Maya numerals here:

horizontal maya numerals (mathabx)

How might the same effect be achieved in regards to Chinese numerals? For a visual example of what I mean, see an example from Eves' book: https://i.stack.imgur.com/V0bpi.jpg

  • The stackengine package is adept at stacking things vertically, but your question does not indicate the context in which these vertically stacked numbers might be used, so it is hard to propose a particular solution. – Steven B. Segletes Nov 05 '14 at 16:02
  • @StevenB.Segletes How would you like me to specify the context? The last link I provided that shows a page from Eves' text is the context I want the symbols to be displayed in (i.e., set in the middle of the page). The "context", if I am understanding you correctly, is the exact same as that of the Mayan numerals question. – Daniel W. Farlow Nov 05 '14 at 16:08

2 Answers2

3

Compiled with XeLaTeX.

\documentclass{article}
\usepackage{xeCJK}
\usepackage[usestackEOL]{stackengine}
\setCJKmainfont{SimSun}
\usepackage{zhnumber}
\newcounter{Zhnum}
\def\ZH#1{\setcounter{Zhnum}{#1}{\normalsize\zhnum{Zhnum}}}
\def\nZH#1{{\scriptsize\bfseries#1} \ZH{#1}}
\begin{document}

\Longstack{
  1 \ZH{1}\\
  2 \ZH{2}\\
  3 \ZH{3}\\
  4 \ZH{4}\\
  5 \ZH{5}\\
  6 \ZH{6}\\
  7 \ZH{7}\\
  8 \ZH{8}\\
  9 \ZH{9}
} 
~~~or maybe this~~~
\Longstack{
  \nZH{1}\\
  \nZH{2}\\
  \nZH{3}\\
  \nZH{4}\\
  \nZH{5}\\
  \nZH{6}\\
  \nZH{7}\\
  \nZH{8}\\
  \nZH{9}
}
\end{document}

enter image description here

1

With XeLaTeX:

\documentclass{article}
\usepackage{xeCJK}
\usepackage{CJKnumb}
\setCJKmainfont{Apple LiSung} % or any other Chinese font 

\newcommand{\VZH}[2][c]{%
  \begin{tabular}[#1]{@{}c@{}}
  \ZHvertdigit#2\ZHvertdigit
  \end{tabular}%
}
\makeatletter
\def\ZHvertdigit#1#2\ZHvertdigit{%
  \CJKnumber{#1}%
  \if\relax\detokenize{#2}\relax
    \expandafter\@gobble
  \else
    \expandafter\@firstofone
  \fi
  {\\\ZHvertdigit#2\ZHvertdigit}%
}

\begin{document}
\VZH{123} \VZH{5468} x \VZH[t]{987}
\end{document}

enter image description here

The optional argument to \VZH specifies the vertical alignment for the tabular.

egreg
  • 1,121,712
  • Is there a way to accomplish the vertical alignment with pdfTeX? – Daniel W. Farlow Nov 05 '14 at 22:18
  • @induktio How do you produce the Chinese digits, in the first place? Sorry, but I'm not going to do research about this. – egreg Nov 05 '14 at 22:20
  • I'm guessing that requires using XeLaTeX? All I know is I'm using pdfLaTeX+MakeIndex+BibTeX with MikTeX and I'm trying to do what I described above, but I clearly have no idea what I'm doing. – Daniel W. Farlow Nov 05 '14 at 22:26
  • @induktio I'm quite sure there is a way to produce Chinese numerals with pdfLaTeX; I don't know how, but when the method is available, it should be easy to adapt the macro above. Maybe you can ask a precise question about the general problem of Chinese numerals with pdfLaTeX. – egreg Nov 05 '14 at 22:28