0

I used the answers given here Replace (change) “Chapter 1” to “Chapter ONE” without affecting lof and lot but it does not work for me as I want. I an typing report class and I will like to reference chapters and will not want "Chapter ONE" to show up where I reference it within text but I will prefer "Chapter 1" instead.

 \documentclass[a4paper,12]{report}
 \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} 
  \usepackage{amssymb,amsfonts,amsmath,graphicx,autobreak}
 \usepackage{changepage,mathtools,amsthm,tikz,blindtext}
 \usepackage{inputenc,float,caption,subcaption,enumitem}
 \usepackage[font=large,labelfont=bf,font=bf,labelsep=space]{caption}
 \usepackage[font=small,labelfont=bf,font=bf,labelsep=space]{subcaption}
 \usepackage{csquotes} %for single quoatation mark
 \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
 \linespread{1.5}
 \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
 \usepackage[authoryear]{natbib}
 \usepackage[]{color}
 \usepackage[english]{babel}
 % the below format chapter header
 \usepackage{titlesec}
 \usepackage[tracking=true]{microtype}
 \titleformat{\chapter}[display]
 {\centering\normalfont\huge\bfseries}
 {\filcenter{\MakeUppercase{\textls[400]
 {\chaptertitlename}}\ \thechapter}}{20pt}{\Huge}
 \usepackage{tocloft}
 \usepackage{fmtcount}
 \renewcommand{\bibname}{References}

 %%% fit Table 4.3 to page %%%%%
 \usepackage{adjustbox}
 \usepackage[section]{placeins}
 \usetikzlibrary{shapes.geometric,arrows}
 \renewcommand{\bibname}{REFERENCES}
 \DeclareMathOperator{\var}{\mathbb{V}ar}
 \DeclareMathOperator{\cov}{\mathbb{C}ov}
 \DeclareMathOperator{\expect}{\mathbb{E}}
 \DeclareMathOperator{\corr}{Corr}
 \DeclareMathOperator{\ARIMA}{\mathbb{ARIMA}}
 \DeclareMathOperator{\AR}{\mathbb{AR}}
 \DeclareMathOperator{\MA}{\mathbb{MA}}
 \DeclareMathOperator{\ARMA}{\mathbb{ARMA}}
 \DeclareMathOperator{\R}{\mathbb{R}}
 \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
 \linespread{1.5}
 \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
 \usepackage{amsmath}
 \usepackage[T1]{fontenc}
 \usepackage{lmodern}

 \def\bsq#1{%both single quotes
\lq{#1}\rq}
 %%%the below with \tag{\stepcounter{equation}\theequation}\\ in the 
 %document allow page brake for equation
 %\usepackage[b]{esvect} %
 %\allowdisplaybreaks

 % the below changes chapter 1 to chapter one
 \usepackage{xpatch}% http://ctan.org/pkg/etoolbox
 \usepackage{fmtcount}% http://ctan.org/pkg/fmtcount
 \renewcommand{\thechapter}{\NUMBERstring{chapter}}
 \renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
 \renewcommand\theequation{\arabic{equation}}
 \makeatletter
 \xpatchcmd{\@chapter}% <cmd>
 {\numberline{\thechapter}}% <search>
 {\@chapapp~\thechapter\quad}% <replace>
 {}{}% <success><failure>
 \makeatother

 \usepackage{afterpage}
 %to add page on top of page numbers in toc after its first page
 \usepackage{tocloft}


 % patch \@makechapterhead
 \usepackage{etoolbox}
 \makeatletter
 \patchcmd{\@makechapterhead}
  {\thechapter}
  {\NUMBERstring{chapter}}
  {}{}
  \makeatother
  \begin{document}

  \newpage\pagenumbering{arabic}
  \newpage
  \renewcommand\contentsname{\hfill Table of  Contents \hfil}
  \tableofcontents
  \addtocontents{toc}{~\hfill\textbf{Page}\par}
  \addtocontents{toc}{\protect\afterpage{~\hfill\textbf{Page}\par\medskip}}%
  \newpage
  \listoftables
  \newpage
  \listoffigures
  \begin{abstract}
   \blindtext
  \end{abstract}

  \chapter{INTRODUCTION} \label{ch1}
  \section{Background of Study} \label{sc1}

 \begin{figure}[H]
 A
 \caption{A figure} \label{fg1}
 \end{figure}

 \begin{table}[H]
    \centering
    \caption{Table A}
    \label{tab1}
    \resizebox{\textwidth}{!}{%
 \begin{tabular}{|c|c|}
     \hline 
     \rule[-1ex]{0pt}{2.5ex} A & B \\ 
     \hline 
     \rule[-1ex]{0pt}{2.5ex} 1 & 2 \\ 
     \hline 
 \end{tabular}
  } 
\end{table}
 \section{Brief Overview of the study } \label{sc11}

 \begin{figure}[H]
    AA
    \caption{A figure} \label{fg11}
 \end{figure}

 \begin{table}[H]
    \centering
    \caption{Table AA}
    \label{tab11}
    \resizebox{\textwidth}{!}{%
        \begin{tabular}{|c|c|}
            \hline 
            \rule[-1ex]{0pt}{2.5ex} AA & BB \\ 
            \hline 
            \rule[-1ex]{0pt}{2.5ex} 11 & 22 \\ 
            \hline 
        \end{tabular}
    } 
 \end{table}
 \chapter{LITERATURE REVIEW} \label{ch2}
  \section{Introduction} \label{sc2}

 \begin{figure}[H]
 B
 \caption{B figure} \label{fg2}
 \end{figure}

 \begin{table}[H]
    \centering
    \caption{Table B}
    \label{tab2}
    \resizebox{\textwidth}{!}{%
 \begin{tabular}{|c|c|}
     \hline 
     \rule[-1ex]{0pt}{2.5ex} C & D \\ 
     \hline 
     \rule[-1ex]{0pt}{2.5ex} 3 & 4 \\ 
     \hline 
 \end{tabular}
 }
 \end{table} 

 \chapter{METHODOLOGY} \label{ch3}
  \section{Introduction} \label{sc3}

 \begin{figure}[H]
 C
 \caption{C figure} \label{fg3}
 \end{figure}

    \begin{table}[H]
    \centering
    \caption{Table C}
    \label{tab3}
    \resizebox{\textwidth}{!}{%
 \begin{tabular}{|c|c|}
     \hline 
     \rule[-1ex]{0pt}{2.5ex} E & F \\ 
     \hline 
     \rule[-1ex]{0pt}{2.5ex} 5 & 6 \\ 
     \hline 
 \end{tabular}
 }
 \end{table} 

 \chapter{CONCLUSION}
 \section{Introduction}
 I shall refer to Table \ref{tab1} of Section \ref{sc1} as well as Figure 
\ref{fg11} and Table \ref{tab11} of Section \ref{sc11} all in Chapter 
\ref{ch1} and Table \ref{tab2} of Section \ref{sc2} in Chapter \ref{ch3} 
which will show Figure \ref{fg3} of Section \ref{sc3} in Chapter \ref{ch3}
 \end{document}

it works in your MWE but when I put it in my own complete working environment it does run without error yet the list of tables, the list of figures and the inline references look like this pictures attached as you can see in when you run my MWE.

enter image description here

the list of figures looks like this

enter image description here

and the in-text reference looks like this

enter image description here

I want the in-text reference of chapters to carry Arabic numbering like "chapter 1", "chapter 2" and so on while the chapter header numbering to be in word like "CHAPTER ONE", "CHAPTER TWO" and so on and my inline reference of chapter to be in arabic and not in words.

please help me

5
  • 1
    Please add a MWE then, if none of the answers in the given link work for you
    – user31729
    Sep 10, 2017 at 11:07
  • I have included it
    – economia
    Sep 10, 2017 at 12:58
  • I can't repeat your problem using your MWE. So long as \thechapter is not redefied, the toc, lof and lot should not be affected. Your MWE redefines \@makechapterhead. Sep 10, 2017 at 15:52
  • @economia: Please provide the minimal document that has the issue and not a document that doesn't have this problem
    – user31729
    Sep 11, 2017 at 3:10
  • @economia: You're screwing up the change of \@makechapterhead by the usage of titlesec -- none of the linked answers however uses titlesec -- no wonder that you get into problems
    – user31729
    Sep 11, 2017 at 13:25

1 Answer 1

1

Introduce a new counter based on the requirement, i.e., ONE, TWO,...and don't modify \thechapter, example, refer the below code:

 \documentclass[a4paper,12]{report}
 \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} 
  \usepackage{amssymb,amsfonts,amsmath,graphicx,autobreak}
 \usepackage{changepage,mathtools,amsthm,tikz,blindtext}
 \usepackage{inputenc,float,caption,subcaption,enumitem}
 \usepackage[font=large,labelfont=bf,font=bf,labelsep=space]{caption}
 \usepackage[font=small,labelfont=bf,font=bf,labelsep=space]{subcaption}
 \usepackage{csquotes} %for single quoatation mark
 \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
 \linespread{1.5}
 \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
\makeatletter%%Here is the counter introduced
\def\numinwords#1{\expandafter\@numinwords\csname c@#1\endcsname}
\def\@numinwords#1{%
  \ifcase#1\or ONE\or TWO\or THREE\or FOUR\or FIVE\or SIX\or SEVEN\else\@ctrerr\fi}
\makeatother
 \usepackage[authoryear]{natbib}
 \usepackage[]{color}
 \usepackage[english]{babel}
 % the below format chapter header
 \usepackage{titlesec}
 \usepackage[tracking=true]{microtype}
 \titleformat{\chapter}[display]
 {\centering\normalfont\huge\bfseries}
 {\filcenter{\MakeUppercase{\textls[400]
 {\chaptertitlename}}\ \numinwords{chapter} }}{20pt}{\Huge}
 \usepackage{tocloft}
 \usepackage{fmtcount}
 \renewcommand{\bibname}{References}

 %%% fit Table 4.3 to page %%%%%
 \usepackage{adjustbox}
 \usepackage[section]{placeins}
 \usetikzlibrary{shapes.geometric,arrows}
 \renewcommand{\bibname}{REFERENCES}
 \DeclareMathOperator{\var}{\mathbb{V}ar}
 \DeclareMathOperator{\cov}{\mathbb{C}ov}
 \DeclareMathOperator{\expect}{\mathbb{E}}
 \DeclareMathOperator{\corr}{Corr}
 \DeclareMathOperator{\ARIMA}{\mathbb{ARIMA}}
 \DeclareMathOperator{\AR}{\mathbb{AR}}
 \DeclareMathOperator{\MA}{\mathbb{MA}}
 \DeclareMathOperator{\ARMA}{\mathbb{ARMA}}
 \DeclareMathOperator{\R}{\mathbb{R}}
 \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
 \linespread{1.5}
 \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
 \usepackage{amsmath}
 \usepackage[T1]{fontenc}
 \usepackage{lmodern}

 \def\bsq#1{%both single quotes
\lq{#1}\rq}
 %%%the below with \tag{\stepcounter{equation}\theequation}\\ in the 
 %document allow page brake for equation
 %\usepackage[b]{esvect} %
 %\allowdisplaybreaks

 % the below changes chapter 1 to chapter one
 \usepackage{xpatch}% http://ctan.org/pkg/etoolbox
 \usepackage{fmtcount}% http://ctan.org/pkg/fmtcount
% \renewcommand{\thechapter}{\NUMBERstring{chapter}}
 \renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
 \renewcommand\theequation{\arabic{equation}}
 \makeatletter
 \xpatchcmd{\@chapter}% <cmd>
 {\numberline{\thechapter}}% <search>
 {\@chapapp~\thechapter\quad}% <replace>
 {}{}% <success><failure>
 \makeatother

 \usepackage{afterpage}
 %to add page on top of page numbers in toc after its first page
 \usepackage{tocloft}


 % patch \@makechapterhead
 \usepackage{etoolbox}
 \makeatletter
 \patchcmd{\@makechapterhead}
  {\thechapter}
  {\NUMBERstring{chapter}}
  {}{}
  \makeatother
  \begin{document}

  \newpage\pagenumbering{arabic}
  \newpage
  \renewcommand\contentsname{\hfill Table of  Contents \hfil}
  \tableofcontents
  \addtocontents{toc}{~\hfill\textbf{Page}\par}
  \addtocontents{toc}{\protect\afterpage{~\hfill\textbf{Page}\par\medskip}}%
  \newpage
  \listoftables
  \newpage
  \listoffigures
  \begin{abstract}
   \blindtext
  \end{abstract}

  \chapter{INTRODUCTION} \label{ch1}
  \section{Background of Study} \label{sc1}

 \begin{figure}[H]
 A
 \caption{A figure} \label{fg1}
 \end{figure}

 \begin{table}[H]
    \centering
    \caption{Table A}
    \label{tab1}
    \resizebox{\textwidth}{!}{%
 \begin{tabular}{|c|c|}
     \hline 
     \rule[-1ex]{0pt}{2.5ex} A & B \\ 
     \hline 
     \rule[-1ex]{0pt}{2.5ex} 1 & 2 \\ 
     \hline 
 \end{tabular}
  } 
\end{table}
 \section{Brief Overview of the study } \label{sc11}

 \begin{figure}[H]
    AA
    \caption{A figure} \label{fg11}
 \end{figure}

 \begin{table}[H]
    \centering
    \caption{Table AA}
    \label{tab11}
    \resizebox{\textwidth}{!}{%
        \begin{tabular}{|c|c|}
            \hline 
            \rule[-1ex]{0pt}{2.5ex} AA & BB \\ 
            \hline 
            \rule[-1ex]{0pt}{2.5ex} 11 & 22 \\ 
            \hline 
        \end{tabular}
    } 
 \end{table}
 \chapter{LITERATURE REVIEW} \label{ch2}
  \section{Introduction} \label{sc2}

 \begin{figure}[H]
 B
 \caption{B figure} \label{fg2}
 \end{figure}

 \begin{table}[H]
    \centering
    \caption{Table B}
    \label{tab2}
    \resizebox{\textwidth}{!}{%
 \begin{tabular}{|c|c|}
     \hline 
     \rule[-1ex]{0pt}{2.5ex} C & D \\ 
     \hline 
     \rule[-1ex]{0pt}{2.5ex} 3 & 4 \\ 
     \hline 
 \end{tabular}
 }
 \end{table} 

 \chapter{METHODOLOGY} \label{ch3}
  \section{Introduction} \label{sc3}

 \begin{figure}[H]
 C
 \caption{C figure} \label{fg3}
 \end{figure}

    \begin{table}[H]
    \centering
    \caption{Table C}
    \label{tab3}
    \resizebox{\textwidth}{!}{%
 \begin{tabular}{|c|c|}
     \hline 
     \rule[-1ex]{0pt}{2.5ex} E & F \\ 
     \hline 
     \rule[-1ex]{0pt}{2.5ex} 5 & 6 \\ 
     \hline 
 \end{tabular}
 }
 \end{table} 

 \chapter{CONCLUSION}
 \section{Introduction}
 I shall refer to Table \ref{tab1} of Section \ref{sc1} as well as Figure 
\ref{fg11} and Table \ref{tab11} of Section \ref{sc11} all in Chapter 
\ref{ch1} and Table \ref{tab2} of Section \ref{sc2} in Chapter \ref{ch3} 
which will show Figure \ref{fg3} of Section \ref{sc3} in Chapter \ref{ch3}
 \end{document}
2
  • 1
    @economia, if you feel my answer is fit for you, then accept the answer, thanks...
    – MadyYuvi
    Sep 11, 2017 at 13:01
  • @economia: If this answers your question accept the solution please
    – user31729
    Sep 28, 2017 at 4:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .