如何修复 Latex 中的报告编号

问题描述

我正在使用 Latex 写我的论文,它具有以下编号结构,当我参考前几章时,这很令人困惑。例如,如果我在第 3 章并想引用第 2 章中的一个小节,我使用 section \ref{section 1} 并且不清楚我想要哪个第 1 节(第 1 章或第 2 章)。

enter image description here

那么,我如何像下图一样更改上面的内容

enter image description here

下面是我的标题中的代码,然后在文档中我使用 \chapter、\section 和 \subsection 来区分它们。

\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}

解决方法

是这一行:

\renewcommand\thesection{\arabic{section}}

它将章节编号更改为从 1 开始,就像章节一样。只需删除该行,部分编号为 1.1、1.2 等。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...