部分的编号仅出现在第一部分中

时间:2016-03-24 15:03:00

标签: latex

我对乳胶中的部分编号有问题。

我希望章节的编号为

1第一章

1.1第一节

1.2秒节

问题是该部分的编号仅出现在第一部分中,我不知道为什么会发生这种情况!

这是我使用的代码。

\documentclass [a4paper,12pt]{report}
\usepackage{times}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage[utf8]{inputenc} % for numbering of pages
\usepackage{ragged2e}
\usepackage{indentfirst}
\usepackage{setspace}
 \usepackage{titlesec}
\usepackage[english]{babel}
\renewcommand\thesection{\arabic{section}} % for the chapters numbering 

%margins 
%1 inch from top, buttom and right side of the page and 1.5 inch from left side of the page

 \geometry{
 a4paper,
left=1.5in,right=1in,top=1in,bottom=1in
 }



\onehalfspacing
\centering
\pagenumbering{roman}



\titleformat{\section}
  {\normalfont\fontsize{16}{15}\bfseries}{\thesection}{1em}{}

  \titleformat{\subsection}
  {\normalfont\fontsize{14}{15}\bfseries}{\thesection}{1em}{}

  \titleformat{\subsubsection}
  {\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}



\renewcommand{\thesection}{\thechapter.\number\numexpr\value{section}\relax}
\renewcommand{\thesubsection}{\thesection.\number\numexpr\value{subsection}\relax}
\renewcommand{\thesubsubsection}{\thesubsection.\number\numexpr\value{subsubsection}\relax}
\setcounter{secnumdepth}{3}

\setcounter{chapter}{1}% Not using chapters, but they're used in the counte

\begin{document}

% this is the table of contents of the document 

\renewcommand*\contentsname{Table of Contents}
%--------------------------------------------------
\tableofcontents
\newpage
\listoffigures
\newpage
\listoftables

% this is the introduction chapter
\newpage
\pagenumbering{arabic}

\chapter*{\centering \vspace{80 mm} Chapter One: Introduction}
\addcontentsline{toc}{chapter}{\numberline{}Chapter One: Introduction}%
\newpage

\justify
 \setlength{\parindent}{5 ex} 
\section{Introduction}
%write introduction here 

\section{Problem Definition}
%write Problem Definition here


\section{Aim and Objectives}
%write Aim and Objectives here 

\section{Methodology}

%write Methodology here 


\section{Project Scope}

%write Project Scope here 

\section{Project Timeline}

%write Project Timeline  here 

\section{Conclusion}

%write Conclusion  here 

\end{document}

contentes表显示数字,但数字仅出现在第一部分(介绍)中。如何才能使数字出现在其他部分?

enter image description here enter image description here

1 个答案:

答案 0 :(得分:0)

由于某种原因,以下包和代码会影响该部分的编号(我不知道为什么会发生这种情况)。当我删除以下代码时,标题中的部分编号也会出现。

\usepackage{titlesec}

\titleformat{\section}
  {\normalfont\fontsize{16}{15}\bfseries}{\thesection}{1em}{}

  \titleformat{\subsection}
  {\normalfont\fontsize{14}{15}\bfseries}{\thesection}{1em}{}

  \titleformat{\subsubsection}
  {\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}

现在我需要找到另一种方法来改变标题的字体大小。如果有人发布更好的方法来调整字体大小而不使用titlesec包,我将不胜感激。