在使用此TOC 样式,我想更改目录的数字系统,即,我不想使用阿拉伯数字,而是使用古希腊数字系统来标记页面和章节。
我试过:
\renewcommand{\thepage}{{\greekfonttwo\atticnum{\value{page}}}}
\renewcommand*{\thechapter}{{\greekfonttwo\atticnum{\value{chapter}}}}
.toc
但所有这些都导致我文件中的所有章节和页码都为 0 。
我试图查看其定义,\chapter
但没有成功......
\documentclass{book}
\usepackage{fontspec}
\usepackage{xgreek} % package for \atticnum command
\usepackage[polutonikogreek]{babel}
\setmainfont{GFS Artemisia}
\newfontfamily\greekfonttwo[Script=Greek,Ligatures=TeX]{Quivira} % font to display attic numbers
\makeatletter
\renewcommand\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space{\greekfonttwo\atticnum{\value{chapter}}}}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
\makeatother
\begin{document}
\tableofcontents
\chapter{one two}
\chapter{two}
\chapter{three}
\chapter{four}
\chapter{five}
\chapter{six}
\chapter{seven}
\end{document}
答案1
我不会使用 xgreek 包,它太旧了。但你可以复制你的数字系统的定义:
\documentclass{book}
\usepackage{fontspec}
\usepackage[polutonikogreek]{babel}
\setmainfont{GFS Artemisia}
\newfontfamily\greekfonttwo[Script=Greek,Ligatures=TeX]{Quivira} %
\makeatletter
\newcount\@attic@num
\DeclareRobustCommand*{\@@atticnum}[1]{%
\@attic@num#1\relax
\ifnum\@attic@num<\@ne%
\space%
\PackageWarning{xgreek}{%
Illegal value (\the\@attic@num) for acrophonic Attic numeral}%
\else\ifnum\@attic@num>249999%
\space%
\PackageWarning{xgreek}{%
Value too large (\the\@attic@num) for acrophonic Attic numeral}%
\else
\@whilenum\@attic@num>49999\do{%
^^^^^^010147\advance\@attic@num-50000}%
\@whilenum\@attic@num>9999\do{%
M\advance\@attic@num-\@M}%
\ifnum\@attic@num>4999%
^^^^^^010146\advance\@attic@num-5000%
\fi\relax
\@whilenum\@attic@num>999\do{%
Χ\advance\@attic@num-\@m}%
\ifnum\@attic@num>499%
^^^^^^010145\advance\@attic@num-500%
\fi\relax
\@whilenum\@attic@num>99\do{%
Η\advance\@attic@num-100}%
\ifnum\@attic@num>49%
^^^^^^010144\advance\@attic@num-50%
\fi\relax
\@whilenum\@attic@num>9\do{%
Δ\advance\@attic@num by-10}%
\@whilenum\@attic@num>4\do{%
Π\advance\@attic@num-5}%
\ifcase\@attic@num\or Ι\or ΙΙ\or ΙΙΙ\or ΙΙΙΙ\fi%
\fi\fi}
\def\@atticnum#1{%
\expandafter\@@atticnum\expandafter{\the#1}}
\def\atticnum#1{%
\@attic@num#1\relax
\@atticnum{\@attic@num}}
\makeatother
\renewcommand {\thepage}{{\greekfonttwo \protect\atticnum{\number\value{page}}}}
\renewcommand*{\thechapter}{{\greekfonttwo \protect\atticnum{\number\value{chapter}}}}
\begin{document}
\tableofcontents
\chapter{one two}
\chapter{two}
\chapter{three}
\chapter{four}
\chapter{five}
\chapter{six}
\chapter{seven}
\end{document}