简体   繁体   中英

how to fix report numbering in latex

I am using latex to write my thesis and it has the following numbering structure which is quite confusing when I make reference to previous chapters. For example, if am in chapter 3 and want to reference a subsection in chapter 2, I use section \ref{section 1} and it's not clear which section 1 I want (chapter 1 or 2).

在此处输入图像描述

So, how do I change the above like the image below

在此处输入图像描述

Below is the code in my header then inside the document I use \chapter, \section and \subsection to distinguish them.

\documentclass[a4paper,11pt]{report}
% Preamble
\usepackage[utf8x]{inputenc}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\usepackage{subfig}
\usepackage{fullpage}
\usepackage{tabularx}
\usepackage{comment}
\usepackage{color, colortbl}
\usepackage{graphicx}
\usepackage{url}
\usepackage{setspace}
\usepackage{float}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{varioref}
\usepackage{multirow}
\usepackage{hhline}
\renewcommand\thesection{\arabic{section}}
\usepackage{parskip}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{caption}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\renewcommand{\arraystretch}{1.3}
\usepackage{lscape}
 \usepackage{multirow}
 
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}


\usepackage{longtable}

\setlength{\parindent}{0pt}

  [1]: https://i.stack.imgur.com/tsJLC.png
  [2]: https://i.stack.imgur.com/xNruu.png

\renewcommand\bibname{References}  % change title of references section
\newcommand{\myquote}[2]{\begin{center}\fbox{\begin{minipage}{.95\linewidth}#1\hfill #2\end{minipage}}\end{center}}
\newcommand{\source}[1]{\caption*{{#1}} }

\usepackage{natbib} \input{natbib-add}
\bibliographystyle{named}
\bibpunct{[}{]}{;}{a}{}{}
%\setlength{\skip\footins}{1.5cm}
\setlength{\intextsep}{10pt plus 2pt minus 2pt}

It's this line:

\renewcommand\thesection{\arabic{section}}

It changes the section numbering to start from 1, like the chapters already are. Just delete the line and the sections are numbered 1.1, 1.2, etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM