1

I'm writing my thesis using document class report. The chapter titles are coming as "Chapter 1": a gap then on the next line "Introduction". I want to make it "1. Introduction". Can this be done?

I'm using the following code in my main tex file.

\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{booktabs,makecell,longtable}
\usepackage[T1]{fontenc}
\graphicspath{{images/}}

\title{}
\author
    {}
        
\date{}
\begin{document}

\maketitle
\chapter*{Abstract}

\chapter{Introduction}
%\input{Chapters/Introduction}
...........
\chapter{Conclusion}
%\input{Chapters/Conclusion}
\chapter{Reference}
%\input{Chapters/Reference}

\end{document}

I would not like to change document class if possible, as I'm afraid that would create other formatting issues. Would appreciate any help.

Thanks.

2
  • 2
    You can easily do that with the titlesec package and its \titleformat command. Unrelated: loading inputenc is no more necessary, as this has been the default that latex expects for more than 3 years.
    – Bernard
    Nov 24, 2021 at 15:13
  • Thank you! it was helpful
    – Jan3
    Nov 29, 2021 at 7:06

1 Answer 1

5

Elaborating @Bernard comments, use titlesec package for formatting titles of chapters.

I give you a full example.

\documentclass[12pt]{report}

\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{booktabs,makecell,longtable}
\usepackage[T1]{fontenc}
\graphicspath{{images/}}

% I have added this
\usepackage[explicit,compact]{titlesec}
\titleformat{\chapter}[block]
    {\bfseries\huge}{\filright\huge\thechapter.}{1ex}{\huge\filright #1}
    
\title{}
\author
    {}
        
\date{}
\begin{document}

\maketitle
\chapter*{Abstract}



\chapter{Introduction}
%\input{Chapters/Introduction}
...........
\chapter{Conclusion}
%\input{Chapters/Conclusion}
\chapter{Reference}
%\input{Chapters/Reference}

\end{document}

Here in the code:

% I have added this
\usepackage[explicit,compact]{titlesec}
\titleformat{\chapter}[block]
    {\bfseries\huge}{\filright\huge\thechapter.}{1ex}{\huge\filright #1}

\huge can change the font size.

\filright can change the orientation.

3
  • thanks. it helped
    – Jan3
    Nov 29, 2021 at 7:07
  • You can accept the answer if it helps by clicking Tick mark beside the answer.
    – mmr
    Nov 29, 2021 at 7:13
  • @Jan3 The tick mark (tick sign) under like(up) and dislike(down) button.
    – mmr
    Nov 29, 2021 at 7:28

You must log in to answer this question.

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