0

I use

%% Use CHAPTER ONE instead of CHAPTER 1
\renewcommand{\thechapter}{\NUMBERstring{chapter}}

to change CHAPTER 1 to CHAPTER ONE.

However, for Equation, Table and Figure. I want to use arabic for chapter number. I try this code:

\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}

It works fine for Equation, but, not for Figure and Table.

enter image description here

This is the minimal code:

\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
  • 2
    That probably means that you're not using a table or figure environment. Or, if you are, you're using some other package that redefines things. Can you create a minimal example that replicates your problem? Something that starts with \documentclass and ends with \end{document} that allows us to copy-and-paste-and-compile and see exactly what you're seeing. Can you do that? – Werner Mar 5 at 5:16
1

Don't redefine \thechapter, but \printchapternum and \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
}
0
0

I have solved the problem by moving these two lines:

\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}

outside the preamble, and put them after \mainmatter.

However, is there a way to put them inside the preamble?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.