I found about the titlesec package to format titles of sections and subsections.
Currently based on a snippet I found on the web the following snippet works nicely, but the section numbering is turned off. How do turn on section numbering?
With my current latex settings, I get the following document with the sections and subsections not numbered as below.
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{minted}
\usepackage[margin=0.8in]{geometry}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{mdframed}
\newcommand\mycommfont[1]{\footnotesize\ttfamily\textcolor{blue}{#1}}
\SetCommentSty{mycommfont}
\usepackage{tikzsymbols}
\usepackage{needspace}
\hypersetup{colorlinks=true,linkcolor=blue}
\usepackage{multicol}
\setlength{\columnsep}{1cm}
\usepackage{titling}
\usepackage{xcolor}
\usepackage{titlesec}
\titleformat{\section}[block]{\color{black}\normalfont\sffamily\Large\bfseries\filcenter}{}{0.3em}{}
\titleformat{\subsection}[block]{\color{black}\normalfont\sffamily\large\bfseries\filcenter}{}{0.3em}{}
\setlength{\headsep}{0pt}
\setlength{\topskip}{0pt}
\setlength{\topmargin}{0pt}
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}
\setlength{\droptitle}{-5em} % Eliminate the default vertical space
\author{John Doe}
\date{}
\title{Dummy Title}
\hypersetup{
pdfauthor={John Doe},
pdftitle={Dummy Title},
pdfkeywords={},
pdfsubject={},
pdfcreator={Emacs 25.3.1 (Org mode 9.1.7)},
pdflang={English}}
\begin{document}
\maketitle
\tableofcontents
\begin{multicols}{2}
\section{Introduction}
\label{sec:orgbe11d3e}
\subsection{Lorem}
\label{sec:orgcfab93a}
Et nam fugit torquatos reprehendunt, id malis scripta eum. Duo ea nisl dicat. Ea ancillae mentitum sadipscing per, ad harum dolore has. An pri quod case clita. Exerci posidonium per no, ut ius lobortis laboramus reprehendunt.
sed ea. Sint ludus eu mea, in postulant honestatis interpretaris per. In vix natum mentitum disputationi, natum sapientem ne duo.
\section{Ipsum}
\label{sec:orgc59abd3}
Et nam fugit torquatos reprehendunt, id malis scripta eum. Duo ea nisl dicat. Ea ancillae mentitum sadipscing per, ad harum dolore has. An pri quod case clita.
\end{multicols}
\end{document}
\filcenter#1
– Johannes_B Apr 22 '18 at 5:59\filcenter\thesection
Sorry, it was before my first cofee this morning. – Johannes_B Apr 22 '18 at 11:05