我用
%% Use CHAPTER ONE instead of CHAPTER 1
\renewcommand{\thechapter}{\NUMBERstring{chapter}}
将第 1 章更改为第一章。
但是,对于公式、表格和图形,我想使用阿拉伯语来表示章节编号。我尝试了以下代码:
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}
它对于公式来说效果很好,但是对于图形和表格来说则不行。
这是最小代码:
\documentclass[a4paper,12pt,oneside]{memoir}
\usepackage{amsmath,amsfonts}
\usepackage{graphicx}
\usepackage{fmtcount}
\usepackage[T1]{fontenc}
\usepackage{mathptmx} %Times font
\usepackage{lipsum}
%% Format Chapter. Eg. CHAPTER ONE.
\renewcommand*{\chapterheadstart}{} %remove margin before chapter
\setlength{\midchapskip}{-2pt} % between chapter and chapter name
\renewcommand*{\chapnamefont}{\large\bfseries}
\renewcommand*{\chaptitlefont}{\large\bfseries\centering}
\renewcommand*{\chapnumfont}{\large\bfseries\centering}
\renewcommand*{\printchaptername}{%
\centering\chapnamefont\MakeUppercase{\chaptername}}%
\renewcommand*{\printchaptertitle}[1]{\chaptitlefont\MakeUppercase{#1}}
\renewcommand{\thechapter}{\NUMBERstring{chapter}}
%% Add word CHAPTER before the chapter number in TOC. Eg. CHAPTER ONE.
\renewcommand*\chapternumberline[1]{%
CHAPTER #1:\space\space
}
%% Add word Page on top of page numbers in TOC, LOT and LOF.
\addtocontents{toc}{\protect\contentsline{chapter}{}{Page}}
\addtocontents{lot}{\protect\contentsline{chapter}{Tables Title}{Page}}
\addtocontents{lof}{\protect\contentsline{chapter}{Figures Title}{Page}}
%% Format Section. Eg. 1.1.
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
%% Format Table, Figure and Equation label. Eg. Figure 4.1.
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}} % work
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}} % does not work
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}} % does not work
%% Add a new page after List of Tables / Figures.
\renewcommand{\lotheadstart}{\clearpage}
\renewcommand{\lofheadstart}{\clearpage}
\begin{document}
\tableofcontents
\listoftables
\listoffigures
\mainmatter
\chapter{Introduction}
\lipsum[1]
\begin{table}[ht]
\caption{A Table}
\label{table:atable}
\end{table}
\begin{figure}[ht]
\caption{A Figure}
\label{fig:afigure}
\end{figure}
\begin{equation}
y = mx + c
\label{eq:anequation}
\end{equation}
\section{A Section}
\lipsum[1]
\end{document}
答案1
不要重新定义\thechapter
,但是\printchapternum
和\chapternumberline
:
%% Format Chapter. Eg. CHAPTER ONE.
\renewcommand*{\chapterheadstart}{} %remove margin before chapter
\setlength{\midchapskip}{-2pt} % between chapter and chapter name
\renewcommand*{\chapnamefont}{\large\bfseries}
\renewcommand*{\chaptitlefont}{\large\bfseries\centering}
\renewcommand*{\chapnumfont}{\large\bfseries\centering}
\renewcommand*{\printchaptername}{%
\centering\chapnamefont\MakeUppercase{\chaptername}}%
\renewcommand{\printchapternum}{\chapnumfont\NUMBERstring{chapter}}
\renewcommand*{\printchaptertitle}[1]{\chaptitlefont\MakeUppercase{#1}}
%% Add word CHAPTER before the chapter number in TOC. Eg. CHAPTER ONE.
\renewcommand*\chapternumberline[1]{%
CHAPTER \NUMBERstringnum{#1}:\space\space
}
答案2
我通过移动这两行解决了该问题:
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
放在序言之外,并放在之后\mainmatter
。
但是,有没有办法将它们放入序言中呢?