3
\documentclass[b5paper, 11pt]{article}    
\usepackage[lmargin=2cm, rmargin=2cm,tmargin=2cm,bmargin=2cm]{geometry}
\usepackage{graphicx} % for pdf, bitmapped graphics files
\usepackage{indentfirst}
\usepackage{amsmath} % assumes amsmath package installed
\usepackage{amssymb}  % assumes amsmath package installed
%\usepackage{deleq} % to divide on equation
%\usepackage{bbm} % to represent the space dimension
%\usepackage{bbding} % to represent the space dimension
\usepackage{dsfont} %to represent the space dimension
\usepackage{color}
\usepackage{algorithm}
%\usepackage{algorithms}
%\usepackage{latexsym}
%\setcounter{secnumdepth}{3}
\setcounter{secnumdepth}{3}
%\setcounter{tocdepth}{3}
\usepackage{multicol}%%%%%%%%%%%%
\usepackage{lipsum}%%%%%%%%%%%%%%%%%%%
\usepackage{theorem}
\newtheorem{theorem}{Theorem}
\newcounter{tempcount}
\graphicspath{{figures/}}

%\usepackage{titlesec}
%\titleformat{\section}[block]
%{\Large\bfseries\filcenter}{}{1em}{}
%\titleformat{\subsection}[hang]{\bfseries}{}{1em}{}

\usepackage{titlesec}
\titleformat{\section}[block]
  {\fontsize{12}{15}\bfseries\sffamily\filcenter}
  {\thesection}
  {1em}
  {\MakeUppercase}
\titleformat{\subsection}[hang]
  {\fontsize{12}{15}\bfseries\sffamily}
  {\thesubsection}
  {1em}
  {}
\titleformat{\subsubsection}[hang]
  {\fontsize{12}{15}\bfseries\sffamily}
  {\thesubsection}
  {1em}
  {}  
\usepackage[T1]{fontenc}
\usepackage{mathptmx}



\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
\newcommand{\ParGraph}{\\ \indent}
\usepackage[noblocks]{authblk}
\title{\bf
title}
%\author[ ]{}
\author[ ]{Mustafa Rabeei }
\affil[ ]{Electrical Engineering Department
 E-mails: {\tt eng.mustafa.rabeay}}
%##############################################################################
\begin{document}
\section{a}
\subsection{b}
\subsubsection{c}
\end{document}

I got

1 A

1.1 b

1.1 c

I need

1 A

1.1 b

1.1.1 c

  • The problems lies in your last \titleformat command: you should replace \thesubsection by \thesubsubsection. – jub0bs Jun 27 '13 at 0:23
3

The third mandatory argument of

\titleformat{<command>}[<shape>]{<format>}{<label>}{<sep>}{<before-code>}[<after-code>]

identifies how the <label> is set. For \subsubsection, you've used \thesubsection and it should be \thesubsubsection.

enter image description here

%...
\usepackage{titlesec}% http://ctan.org/pkg/titlesec
\titleformat{\section}[block]
  {\fontsize{12}{15}\bfseries\sffamily\filcenter}
  {\thesection}
  {1em}
  {\MakeUppercase}
\titleformat{\subsection}[hang]
  {\fontsize{12}{15}\bfseries\sffamily}
  {\thesubsection}
  {1em}
  {}
\titleformat{\subsubsection}[hang]
  {\fontsize{12}{15}\bfseries\sffamily}
  {\thesubsubsection}% <-------------------- updated
  {1em}
  {}
%...
  • it works properly now, thank you very much. – user16558 Jun 27 '13 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.