我的子节与子节采用相同的编号

我的子节与子节采用相同的编号
\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}

我有

1.1b

1.1 一

我需要

1.1b

1.1.1

答案1

第三个强制参数

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

标识如何<label>设置。对于\subsubsection,您已使用\thesubsection,并且它应该是\thesubsubsection

在此处输入图片描述

%...
\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}
  {}
%...

相关内容