停止以 . 开头的章节编号(将 `.1 示例标题` 改为 `1 示例标题`)

停止以 . 开头的章节编号(将 `.1 示例标题` 改为 `1 示例标题`)

我正在使用 overleaf 中的 latex 编译一份文档,其中生成了附录,其位于.章节和小节编号的前面,如下图所示。

如何才能阻止这种情况的.1 Example发生1 Example

我添加了一个最小工作示例,其中包含我所拥有的所有软件包,以帮助说明问题和解决方案。

![在此处输入图片描述

最小工作示例

\documentclass[12pt,oneside,openany,a4paper,afrikaans,english,masters-t,goldenblock]{usthesis}

%% Language and font encodings
\usepackage[afrikaans, english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}

%%%%%%%%%%%%%%%%%%%%%%% Packages %%%%%%%%%%%%%%%%%%%%%%%
\usepackage{graphicx}
\usepackage{svg} % To be able to add SVG images
\usepackage{usbib}
\bibliographystyle{unsrt}
\setcitestyle{square}
\bibpunct{[}{]}{,}{n}{,}{,}
\usepackage{caption}
\usepackage{subcaption}

%%%%%%%%%%%%%%%%%%%%%%% Sets page size and margins %%%%%%%%%%%%%%%%%%%%%%%
\usepackage{geometry}
\geometry{a4paper,  total={210.2mm,297.3mm}, left=25mm, right = 25mm, top=26.3mm, bottom=43.8mm }

\begin{document}

Body.

\appendix

\section{Example 1} % error comes here (remove dot)

\subsection{Example 2} % and error also comes here (remove dot)

\bibliography{sample} % no need for bibliography

\end{document}
  • 添加numbers=noenddot无效documentclass

  • 按照@AmirParvardi 的建议,在附录之前添加章节,我得到了如下内容:

  1. 在主

在此处输入图片描述

  1. 在保存附录脚本的文件中

在此处输入图片描述

  1. 生成的输出

在此处输入图片描述

答案1

感谢您提供 MWE!发生这种情况是因为,据我所知,附录是分章的,所以如果您在附录的\chapter{}第一个前面添加一个,您就会喜欢所看到的内容。\section{}

\documentclass[12pt,oneside,openany,a4paper,afrikaans,english,masters-t,goldenblock]{usthesis}

%% Language and font encodings
\usepackage[afrikaans, english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage[title]{appendix}

%%%%%%%%%%%%%%%%%%%%%%% Packages %%%%%%%%%%%%%%%%%%%%%%%
\usepackage{graphicx}
\usepackage{svg} % To be able to add SVG images
\usepackage{usbib}
\bibliographystyle{unsrt}
\setcitestyle{square}
\bibpunct{[}{]}{,}{n}{,}{,}
\usepackage{caption}
\usepackage{subcaption}

%%%%%%%%%%%%%%%%%%%%%%% Sets page size and margins %%%%%%%%%%%%%%%%%%%%%%%
\usepackage{geometry}
\geometry{a4paper,  total={210.2mm,297.3mm}, left=25mm, right = 25mm, top=26.3mm, bottom=43.8mm }

\begin{document}
Body.
\appendix
\chapter{First Appendix Title}
\section{Section Example}
\subsection{Subsection Example}
\bibliography{sample} % no need for bibliography

\end{document}

附录

答案2

要消除第一个点,请在后面\appendix和前面插入\section

\renewcommand{\thechapter}{} 
\renewcommand{\thesection}{\arabic{section}} 

A

\begin{document}
    
    Body.
    
    \backmatter     
    \appendix
    \chapter{Back matter chapter}
    
    \renewcommand{\thechapter}{} % added <<<<<<<<<<<<<<<<<
    \renewcommand{\thesection}{\arabic{section}} % added <<<<<<<<<<<<<<<<<
    
    \section{Section Example 1} % initial dot removed 
    
    \subsection{Subsection Example 2} %  initial dot removed 
    
%   \bibliography{sample} % no need for bibliography
    
\end{document}

这是输出:

b

相关内容