1

I have the following MWE:

\documentclass[a4paper,11pt,Times]{article}
\usepackage[english]{babel}
\usepackage{amsbsy}
\usepackage{sectsty}
\usepackage[scaled=1]{helvet}
\usepackage{titlesec}
\usepackage{xcolor}
\usepackage[font=small]{caption}
\usepackage{sectsty}
\titleformat{\section}                                     
  {\normalfont\sffamily\bfseries\color{black}}
  {\thesection}{1em}{}
\titleformat{\subsection}                                   
  {\normalfont\sffamily\slshape\color{black}}
  {\thesubsection}{1em}{}

\title{The title}
\begin{document}
\maketitle
\section {\sffamily \textbf{Main Section}}
Main section text here
\subsection {\sffamily \textbf{Subsection}}
Subsection text here
\end{document}

Kindly help me on how to put a "period" next to the section Numbering. Presently, the code returns as:

"1 Main Section"

whereas I want

"1. Main Section"

Thanks

1 Answers1

2

Don't load both sectsty and titlesec.

The font commands for section titles must be defined in the preamble, not in the main body of the document. Also, a priori, text color is black, unless otherwise specified, so you don't need to mention it:

\titleformat{\section}                                     
  {\sffamily\bfseries}
  {\thesection.}{1em}{}
\titleformat{\subsection}                                   
  {\sffamily\slshape\bfseries}
  {\thesubsection.}{1em}{}
Bernard
  • 271,350