这是我的代码
\documentclass[a4paper,15pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{graphicx}
\graphicspath{ {images/} }
\usepackage[top=30pt,bottom=40pt,left=100pt,right=100pt]{geometry}
\begin{document}
%=============================First article
\title{AAAAAAAAAAAAAAAAA}
\author{GH}
\maketitle
\section{introduction1}
\section{result1}
\section{conclusion1}
%============================= The following is the second article
\title{BBBBBBBBBBBBBBBBBBBBBB}
\author{Se}
\maketitle
\section{introduction2}
\section{result2}
\section{conclusion2}
\end{document}
我想把两篇文章放在一个文档文件中,所以两篇文章应该有不同的介绍部分。我想要的是:
title 1
1, introduction
2, result
3, conclusion
title 2
1, introduction
2, result
3, conclusion
但是从我的代码中可以看出,部分编号是连续的。如何解决这个问题?
title 1
1, introduction
2, result
3, conclusion
title 2
4, introduction
5, result
6, conclusion
答案1
将我的评论转换为答案:您可以使用计数器控制分段命令的计数。对于您来说,分段计数器很重要,因此您可以使用 重置\setcounter{section}{0}
。
\documentclass[a4paper,15pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{graphicx}
\graphicspath{ {images/} }
\usepackage[top=30pt,bottom=40pt,left=100pt,right=100pt]{geometry}
\begin{document}
%=============================First article
\title{AAAAAAAAAAAAAAAAA}
\author{GH}
\maketitle
\section{introduction1}
\section{result1}
\section{conclusion1}
%============================= The following is the second article
\title{BBBBBBBBBBBBBBBBBBBBBB}
\author{Se}
\maketitle
\setcounter{section}{0}
\section{introduction2}
\section{result2}
\section{conclusion2}
\end{document}