1

This is my first question in the site, I want to make the word "Chapter" all in capital letters and put ":" in front of the chapter title. I used report document class and the only packages for TOC are \usepackage[toc,page] , \usepackage[nottoc,notlof,notlot]{tocbibind} I dont know if they are for modification or not ... i am really just a user in latex and it is my first attempt to write a thesis

   \documentclass[12pt,a4paper]{report} 
   \usepackage{amsmath,amssymb,amsthm,amsfonts,mathrsfs} 
   \usepackage{graphicx,epsfig,subfig}                 
   \usepackage{geometry}                               
   \usepackage{setspace}                                 
   \usepackage{array}                                
   \usepackage[toc,page]{appendix}               
   \usepackage[labelfont=bf]{caption}                  
   \usepackage{xpatch}                              
   \usepackage{fmtcount}                       
   \renewcommand{\thechapter}{\NUMBERstring{chapter}} 
   \renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}  
   \renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}  
   \makeatletter
   \input{fc-british.def}
   \xpatchcmd{\@chapter}% <cmd>
   {\numberline{\thechapter}}% <search>
   {\@chapapp~\thechapter\quad}% <replace>
   {}{}% <success><failure>
   \makeatother
   \newcolumntype{L}[1]{>
   {\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
   \newcolumntype{C}[1]{>
  {\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
   \newcolumntype{R}[1]{>
   {\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
    \usepackage{caption}
    \usepackage[pagestyles]{titlesec}
    \titleformat{\chapter}[display]
   {\normalfont\LARGE\bfseries\centering}
   {\centering\MakeUppercase{\chaptertitlename}\ \thechapter}{20pt}{\Large}
    \titlespacing*{\chapter}
    {0pt}{50pt}{40pt}
    \geometry{verbose,a4paper,tmargin=30mm,bmargin=25mm,
     lmargin=30mm,rmargin=25mm}
    \renewcommand{\baselinestretch}{1.65}
    \usepackage{fancyhdr}
    \usepackage{psfrag}
    \usepackage{array}
    \usepackage{booktabs}
    \usepackage{float}
    \usepackage{caption}
    \usepackage{multirow}
    \usepackage[shortlabels]{enumitem}
    \usepackage[monochrome]{xcolor}
    \usepackage{pdflscape}
    \usepackage[toc,page]{appendix}
    \usepackage{titlesec}
    \usepackage{amsmath}
    \usepackage[nottoc,notlof,notlot]{tocbibind} 
    \renewcommand\bibname{References}
    \makeatletter
    \newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}
    \makeatother
    \setcounter{secnumdepth}{5} 
    \setcounter{tocdepth}{5}    
    \newtheorem{theorem}{Theorem}
    \newtheorem{acknowledgement}{Acknowledgement}
    \newtheorem{algorithm}{Algorithm}
    \newtheorem{axiom}{Axiom}
    \newtheorem{case}{Case}
    \newtheorem{claim}{Claim}
    \newtheorem{conclusion}{Conclusion}
    \newtheorem{condition}{Condition}
    \newtheorem{conjecture}{Conjecture}
    \newtheorem{corollary}{Corollary}
    \newtheorem{criterion}{Criterion}
    \newtheorem{definition}{Definition}
    \newtheorem{example}{Example}
    \newtheorem{exercise}{Exercise}
    \newtheorem{lemma}{Lemma}
    \newtheorem{notation}{Notation}
    \newtheorem{problem}{Problem}
    \newtheorem{proposition}{Proposition}
    \newtheorem{remark}{Remark}
    \newtheorem{solution}{Solution}
    \newtheorem{summary}{Summary}
    \numberwithin{equation}{chapter}
    \numberwithin{theorem}{chapter}
    \fancypagestyle{plain}{%
    \fancyhf{} % clear all header and footer fields 
    \fancyfoot[C]{\bfseries\large\thepage} % except the center
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}}

    \begin{document}

    \addcontentsline{toc}{chapter}{Contents}
    \tableofcontents 

    \chapter{General Introduction}\label{chapter:Intro} 
    \section{Introduction}
    Composite steel-concrete construction

    \end{document}  

enter image description here

6
  • Welcome to TeX.SX! Please add some working code. Related Change the word “Chapter” to something else
    – Bobyandbob
    Commented Feb 14, 2018 at 20:33
  • We really need to know which document class you use, and also if you load any package that help modify the appearance of the table of contents. Some of these packages are not mutually compatible; that's why it's important which packages (if any) you are already loading.
    – Mico
    Commented Feb 14, 2018 at 21:19
  • I used report document class and the only packages for TOC are \usepackage[toc,page] , \usepackage[nottoc,notlof,notlot]{tocbibind} I dont know if they are for modification or not ... i am really just a user in latex and it is my first attempt to write a thesis Commented Feb 14, 2018 at 22:05
  • 2
    The way this site works, one typically add a Minimal Working Example (NOT the entire document) which shows the problem, or at least what you are doing now. We play with the code until it does what you want. Commented Feb 14, 2018 at 22:36
  • That's a pretty maximal minimal example, isn't it?
    – cfr
    Commented Feb 16, 2018 at 0:44

1 Answer 1

0

I started by reducing your code to a more minimal working example. Although you obviously don't want to do that in your real document, you should prune and organise your preamble. You are loading packages multiple times, sometimes with different options, and loading conflicting packages or packages which conflict with options passed to other packages. For example, pagestyles passed to titlesec will load that package's footer/header cousin. That cousin will then compete with fancyhdr for control of that aspect of your document layout. Pick. One, other or neither. But not both. You also load titlesec without this option, which creates potential conflicts, too, if you don't happen to happen upon an order which doesn't trigger an error.

I then adjusted the \xpatch command to set 'Chapter' as 'CHAPTER' and to put a stop after the number word. I know you requested a colon, but I frankly think that looks weird. However, you can easily replace the . by a : if you really prefer (or are required to use) this format.

\documentclass{report} 
\usepackage[toc,page]{appendix}               
\usepackage{xpatch}                              
\usepackage[british]{fmtcount}% set dialect in a standard way the package recommends                
% \usepackage[pagestyles]{titlesec}% use of pagestyles conflicts with use of fancyhdr
\usepackage{titlesec}% use of pagestyles conflicts with use of fancyhdr
\usepackage{fancyhdr}
\usepackage[nottoc,notlof,notlot]{tocbibind} 

\renewcommand{\thechapter}{\NUMBERstring{chapter}} 
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}  
\makeatletter
\xpatchcmd{\@chapter}% <cmd>
{\numberline{\thechapter}}% <search>
{\MakeUppercase{\@chapapp}~\thechapter.\quad}% <replace>% <= \MakeUppercase for the capitalisation; added . for dot
{}{}% <success><failure>
\makeatother
\titleformat{\chapter}[display]
{\normalfont\LARGE\bfseries\centering}
{\centering\MakeUppercase{\chaptertitlename}\ \thechapter}{20pt}{\Large}
\titlespacing*{\chapter}
{0pt}{50pt}{40pt}
\setcounter{tocdepth}{5}    
\fancypagestyle{plain}{%
  \fancyhf{}% clear all header and footer fields 
  \fancyfoot[C]{\bfseries\large\thepage}% except the center
  \renewcommand{\headrulewidth}{0pt}%
  \renewcommand{\footrulewidth}{0pt}}

\begin{document}

\addcontentsline{toc}{chapter}{Contents}
\tableofcontents 

\chapter{General Introduction}\label{chapter:Intro} 
\section{Introduction}
Composite steel-concrete construction

\end{document} 

tweaked ToC line for chapter

0

You must log in to answer this question.

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