Latex 用乳胶为该小节编号

Latex 用乳胶为该小节编号,latex,Latex,在第3章(第节)中,我希望将小节编号为3.1、3.2、3.3等等。但它看起来是2.4,2.5。我尝试使用\setcounter{subsection}{3},但没有任何帮助 代码如下: %previous code \cleardoublepage \section*{Chapter 3} \subsection*{Product Design} \line(1,0){400} \setcounter{subsection}{3} \subsection{Product Perspective

在第3章(第节)中,我希望将小节编号为3.1、3.2、3.3等等。但它看起来是2.4,2.5。我尝试使用
\setcounter{subsection}{3}
,但没有任何帮助

代码如下:

%previous code

\cleardoublepage
\section*{Chapter 3}
\subsection*{Product Design}
\line(1,0){400}
\setcounter{subsection}{3}
\subsection{Product Perspective}

%rest of the code

输出如下所示:


这个答案可能很长,但从这个问题和答案来看,我想我知道你真正想要的是什么。如果这是完全错误的,请让我知道,我会删除这个答案

我假设您希望您的文档如下所示:

要实现这一点,您应该使用
报告
文档类,它为您提供了一个额外的剖切级别,即
\chapter
。每个章节包含多个章节,每个章节包含子章节、子章节、段落等。文档的基本设置是

\documentclass{report}
\begin{document}

% Frontmatter
\tableofcontents

% Main part
\chapter{Introduction}
    My project is awesome! In this chapter, I am telling you why.

\chapter{Product Design}
    \section{Product Perspective}
    The product is supposed to be very nice and cool.
    It shall satisfy all conditions and look awesome.

\end{document}
现在,为了实现您在这个问题中要求的标题格式,我们加载包并配置
\chapter
,如下所示:

% Title formating
\usepackage{titlesec}
    \titleformat{\chapter}[display]
        {\normalfont\Large\bfseries}    % Make title \large and bold
        {\huge Chapter~\thechapter}     % Write Chapter X in \huge font
        {20pt}                          % 20pt distance between Chapter X and title
        {}
        [\vspace{1ex}\titlerule]        % Add a line below chapter title
如果您双面打印文档,并且希望所有章节都从一个双页的右侧开始,那么您只需将replace
\documentclass{report}
更改为以下行,并且不需要在每个章节之前调用
\cleardoublepage
。这也使得边缘对称

\documentclass[twoside, openright]{report}
然后,在上一个问题中,你还有一个摘要和确认书,它们有罗马页码。 默认情况下,LaTeX不会将“摘要”之类的未编号章节放在目录中,因此我们必须手动执行此操作。 具体做法如下:

% Frontmatter
\pagenumbering{roman}    % Frontmatter with roman page numbering

\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}    % Add unnumbered chapter to table of contents
    This is the short version of my work.

\chapter*{Acknowledgement}
\addcontentsline{toc}{chapter}{Acknowledgement}    % Add unnumbered chapter to table of contents
    I would like to thank everybody who helped me.
当然,在第一章之前,您必须切换回阿拉伯语页码。下面显示了包含上面讨论的部分的完整代码

\documentclass{report}

% Title formating
\usepackage{titlesec}
    \titleformat{\chapter}[display]
        {\normalfont\Large\bfseries}    % Make title \large and bold
        {\huge Chapter~\thechapter}     % Write Chapter X in \huge font
        {20pt}                          % 20pt distance between Chapter X and title
        {}
        [\vspace{1ex}\titlerule]        % Add a line below chapter title

\begin{document}

% Frontmatter
\pagenumbering{roman}    % Frontmatter with roman page numbering

\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}    % Add unnumbered chapter to table of contents
    This is the short version of my work.

\chapter*{Acknowledgement}
\addcontentsline{toc}{chapter}{Acknowledgement}    % Add unnumbered chapter to table of contents
    I would like to thank everybody who helped me.

\tableofcontents

% Main part
\cleardoublepage
\pagenumbering{arabic} % Main part with arabic page numbering

\chapter{Introduction}
    My project is awesome! In this chapter, I am telling you why.

\chapter{Product Design}
    \section{Product Perspective}
    The product is supposed to be very nice and cool.
    It shall satisfy all conditions and look awesome.

\end{document}
我希望这就是您希望文档的外观。如果没有-或者如果你对我在这里展示的内容有任何其他问题,请写评论。
最后,还有一个单独的网站,只提供关于乳胶的问题,关于乳胶的问题应该发布在那里

这个答案可能很长,但从这个问题和答案来看,我想我知道你真正想要的是什么。如果这是完全错误的,请让我知道,我会删除这个答案

     \section*{Chapter 3}
     \setcounter{section}{2}
        \subsection*{Product Design}
       \line(1,0){400}
       \setcounter{subsection}{0}
       \subsection{Product Perspective}
我假设您希望您的文档如下所示:

要实现这一点,您应该使用
报告
文档类,它为您提供了一个额外的剖切级别,即
\chapter
。每个章节包含多个章节,每个章节包含子章节、子章节、段落等。文档的基本设置是

\documentclass{report}
\begin{document}

% Frontmatter
\tableofcontents

% Main part
\chapter{Introduction}
    My project is awesome! In this chapter, I am telling you why.

\chapter{Product Design}
    \section{Product Perspective}
    The product is supposed to be very nice and cool.
    It shall satisfy all conditions and look awesome.

\end{document}
现在,为了实现您在这个问题中要求的标题格式,我们加载包并配置
\chapter
,如下所示:

% Title formating
\usepackage{titlesec}
    \titleformat{\chapter}[display]
        {\normalfont\Large\bfseries}    % Make title \large and bold
        {\huge Chapter~\thechapter}     % Write Chapter X in \huge font
        {20pt}                          % 20pt distance between Chapter X and title
        {}
        [\vspace{1ex}\titlerule]        % Add a line below chapter title
如果您双面打印文档,并且希望所有章节都从一个双页的右侧开始,那么您只需将replace
\documentclass{report}
更改为以下行,并且不需要在每个章节之前调用
\cleardoublepage
。这也使得边缘对称

\documentclass[twoside, openright]{report}
然后,在上一个问题中,你还有一个摘要和确认书,它们有罗马页码。 默认情况下,LaTeX不会将“摘要”之类的未编号章节放在目录中,因此我们必须手动执行此操作。 具体做法如下:

% Frontmatter
\pagenumbering{roman}    % Frontmatter with roman page numbering

\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}    % Add unnumbered chapter to table of contents
    This is the short version of my work.

\chapter*{Acknowledgement}
\addcontentsline{toc}{chapter}{Acknowledgement}    % Add unnumbered chapter to table of contents
    I would like to thank everybody who helped me.
当然,在第一章之前,您必须切换回阿拉伯语页码。下面显示了包含上面讨论的部分的完整代码

\documentclass{report}

% Title formating
\usepackage{titlesec}
    \titleformat{\chapter}[display]
        {\normalfont\Large\bfseries}    % Make title \large and bold
        {\huge Chapter~\thechapter}     % Write Chapter X in \huge font
        {20pt}                          % 20pt distance between Chapter X and title
        {}
        [\vspace{1ex}\titlerule]        % Add a line below chapter title

\begin{document}

% Frontmatter
\pagenumbering{roman}    % Frontmatter with roman page numbering

\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}    % Add unnumbered chapter to table of contents
    This is the short version of my work.

\chapter*{Acknowledgement}
\addcontentsline{toc}{chapter}{Acknowledgement}    % Add unnumbered chapter to table of contents
    I would like to thank everybody who helped me.

\tableofcontents

% Main part
\cleardoublepage
\pagenumbering{arabic} % Main part with arabic page numbering

\chapter{Introduction}
    My project is awesome! In this chapter, I am telling you why.

\chapter{Product Design}
    \section{Product Perspective}
    The product is supposed to be very nice and cool.
    It shall satisfy all conditions and look awesome.

\end{document}
我希望这就是您希望文档的外观。如果没有-或者如果你对我在这里展示的内容有任何其他问题,请写评论。 最后,还有一个单独的网站,只提供关于乳胶的问题,关于乳胶的问题应该发布在那里

     \section*{Chapter 3}
     \setcounter{section}{2}
        \subsection*{Product Design}
       \line(1,0){400}
       \setcounter{subsection}{0}
       \subsection{Product Perspective}
%您必须设置计数器部分并为子部分设置计数器。如果你把1放进去,它会加上1,然后开始2.2等等,在这里完成


%您必须设置计数器部分并为子部分设置计数器。如果你把1放进去,那么它会把1加到它上面,然后开始2.2,依此类推。

这属于on。用
\setcounter{subsection}{3}
替换
\setcounter{section}{3}
使用它,它从3.6开始,而不是从3.1开始,然后你还必须设置
\setcounter{subsection}{1}
。如果这没有帮助,尝试询问或搜索Ok。它通过使用它所属的\setcounter{subsection}{0}来工作。将
\setcounter{subsection}{3}
替换为
\setcounter{section}{3}
使用它,它从3.6开始,而不是从3.1开始,然后还必须设置
\setcounter{subsection}{1}
。如果这没有帮助,尝试询问或搜索Ok。它通过使用\setcounter{subsection}{0}工作。答案正是我想要的并且解释得很好。答案正是我想要的并且解释得很好。