章節標題文字和數字

章節標題文字和數字

請我希望獲得使用下面的程式碼所獲得的結果的副本,除了我想要第一章標題而不是 1. 當我使用以下程式碼`

\usepackage{fmtcount}
\renewcommand{\thechapter}{\Numberstring{chapter}}

它有效,但它破壞了我的目錄,我開始看到一些編號,例如一.1,三。 4 等等。有什麼方法可以保留目錄中的圖形編號,同時將文件正文中的章節標題改為文字?任何幫助將不勝感激

\documentclass[a4paper,12pt]{report}
\usepackage[margin=1in, left=3.5cm, top=2.5cm, right=2.5cm, bottom=2.5cm]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage[titletoc]{appendix}
\usepackage [T1]{fontenc}
\usepackage{titletoc}
\titleformat{\chapter}[display]
{\normalfont\Large\bfseries\centering}{\centering\chaptertitlename\ \thechapter}{0pt}{\Large}
\titlespacing*{\chapter}
{0pt}{-60pt}{10pt}
\begin{document}
\begin{spacing}{1}
\tableofcontents
\end{spacing}
\addcontentsline{toc}{chapter}{\listtablename}
\listoftables
\cleardoublepage
\chapter{Introduction}
\section{Background of Study}
\lipsum[1-2]

\chapter{literature}
\section{Empirical Literature}
\lipsum[1-2]

\end{document}

答案1

不要重新定義\thechapter,但\Numberstring{chapter}在 的參數中使用\titleformat

\usepackage{titlesec}
\usepackage{fmtcount}
%\renewcommand{\thechapter}{\Numberstring{chapter}}
\titleformat{\chapter}[display]
  {\normalfont\Large\bfseries\centering}
  {\centering\chaptertitlename\ \Numberstring{chapter}}% <- changed
  {0pt}{\Large}

例子:

\documentclass[a4paper,12pt]{report}
\usepackage[margin=1in, left=3.5cm, top=2.5cm, right=2.5cm, bottom=2.5cm]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage[titletoc]{appendix}
\usepackage [T1]{fontenc}
\usepackage{setspace}% <- added
\usepackage[nottoc]{tocbibind}% <- added
\usepackage{titletoc}
\usepackage{titlesec}% <- added
\usepackage{fmtcount}% <- added
\titleformat{\chapter}[display]
  {\normalfont\Large\bfseries\centering}
  {\centering\chaptertitlename\ \Numberstring{chapter}}% <- changed
  {0pt}{\Large}
\titlespacing*{\chapter}
{0pt}{-60pt}{10pt}
\begin{document}
\begin{spacing}{1}
\tableofcontents
\end{spacing}
%\addcontentsline{toc}{chapter}{\listtablename}% <- removed
\listoftables
\cleardoublepage
\chapter{Introduction}
\section{Background of Study}
\lipsum[1-2]
\chapter{literature}
\section{Empirical Literature}
\lipsum[1-2]
\end{document}

相關內容