子节的编号失败,带有自己的.cls

如何解决子节的编号失败,带有自己的.cls

不幸的是,我想尽一切办法获得各小节的编号。

\documentclass[a4paper,10pt,openright]{unibe-msc}
...
\setcounter{secnumdepth}{3} %numbering 3 levels also subsubsections,\setcounter{section}{3}
\setcounter{tocdepth}{2} % Visiblity depth in TableOfContent

该小节以下列代码出现在目录和文档中,但没有编号(请参见图片)。章节编号神秘地起作用。

简单的乳胶测试,例如使用\documentclass[a4paper,10pt]{scrartcl}时,小节编号可以正常工作。

系统:

  • MacTex 2020
  • MacOS Catalina
  • texmaker

pdf output

简化的测试文件(scrartcl VS unibe-msc):

%\documentclass[a4paper,10pt] {scrartcl}
\documentclass[a4paper,openright]{unibe-msc}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}

\tableofcontents

\section{Section}

\subsection{Test Numbering of Subsection with own class}

\end{document}

unibe-msc.cls:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is unibe-msc document class file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Date:     10/28/2009
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat{LaTeX2e}[2001/01/01]
\ProvidesClass{unibe-msc}
              [2009/10/28 v2.1 Document Class for UniBE MSc Theses]
\newif\if@uthesis@electronic \@uthesis@electronicfalse
\DeclareOption{electronic}{\@uthesis@electronictrue}
\def\@uthesis@setpapersize@afour{%
  \setstocksize{297mm}{210mm}
  \settrimmedsize{297mm}{210mm}{*}
  \settypeblocksize{49pc}{33pc}{*}}
\def\@uthesis@setpapersize@gfive{%
  \if@uthesis@electronic
    \setstocksize{239mm}{169mm}
    \settrimmedsize{239mm}{169mm}{*}
    \ifpdf
    \else
      \special{papersize=169mm,239mm}
    \fi
  \else
    \setstocksize{297mm}{210mm}
    \settrimmedsize{239mm}{169mm}{*}
    \setlength{\trimtop}{\stockheight}
    \addtolength{\trimtop}{-\paperheight}
    \setlength{\trimtop}{0.5\trimtop}
    \setlength{\trimedge}{\stockwidth}
    \addtolength{\trimedge}{-\paperwidth}
    \ifpdf
      \AtBeginDocument{%
        \setlength{\pdfpagewidth}{\stockwidth}
        \setlength{\pdfpageheight}{\stockheight}}
    \fi
  \fi
  \settypeblocksize{43pc}{30pc}{*}}
\DeclareOption{g5paper}{\def\uthesis@trimmedsize{gfive}}
\DeclareOption{a3paper}{\OptionNotUsed}
\DeclareOption{a4paper}{\def\uthesis@trimmedsize{afour}}
\DeclareOption{a6paper}{\OptionNotUsed}
\DeclareOption{a5paper}{\OptionNotUsed}
\DeclareOption{b3paper}{\OptionNotUsed}
\DeclareOption{b4paper}{\OptionNotUsed}
\DeclareOption{b5paper}{\OptionNotUsed}
\DeclareOption{b6paper}{\OptionNotUsed}
\DeclareOption{letterpaper}{\OptionNotUsed}
\DeclareOption{legalpaper}{\OptionNotUsed}
\DeclareOption{executivepaper}{\OptionNotUsed}
\DeclareOption{ebook}{\OptionNotUsed}
\DeclareOption{landscape}{\OptionNotUsed}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}
\ExecuteOptions{g5paper}
\ProcessOptions\relax
\LoadClass[a4paper]{memoir}
\AtBeginDocument{\RequirePackage{graphics}}
\@nameuse{@uthesis@setpapersize@\uthesis@trimmedsize}
\setlrmargins{*}{*}{*}
\setulmargins{*}{*}{*}
\checkandfixthelayout
\def\subtitle{\gdef\thesubtitle}
\def\frontsignature{\gdef\thefrontsignature}
\def\unibelogo{\gdef\theunibelogo}
\def\htilogo{\gdef\thehtilogo}
\def\place{\gdef\theplace}
\def\faculty{\gdef\thefaculty}
\def\affiliation{\gdef\theaffiliation}
\def\examiner{\gdef\theexaminer}
\def\discipline{\gdef\thediscipline}
\def\supervisor{\gdef\thesupervisor}
\def\origin{\gdef\theorigin}
\let\thesubtitle\relax
\let\theunibelogo\relax
\let\thehtilogo\relax
\let\theplace\relax
\let\thefaculty\relax
\let\theaffiliation\relax
\let\thediscipline\relax
\let\thesupervisor\relax
\let\theorigin\relax
\def\maketitle{%
  \begingroup
  %\sffamily
  \pagestyle{empty}
  \renewcommand*{\thepage}{title-\arabic{page}}
  \vspace*{-30mm}
  \noindent
  \scaleBox{0.84}{\includegraphics{\thehtilogo}}  \hfill
    \scaleBox{0.35}{\includegraphics{\theunibelogo}}
  \parBox[b][0.65\textheight]{\textwidth}{\centering\noindent
    \vskip1.5cm %2cm default
    {\large\mdseries \thefaculty \par \thediscipline}\par
    \vskip0.7cm %1cm default
    \Large\mdseries\thesubtitle\par
    \vskip1.5cm %2cm default
    \huge\bfseries\thetitle\par
    \vskip2cm %2cm default
    \large\mdseries by
    \vskip1.6cm %2cm default
    \LARGE\bfseries\theauthor %\par\vfill
    \vskip0.5cm %1cm default
    \large\mdseries of \theorigin\par\vfill
  }
  \vfill\noindent
  \parBox[b]{\textwidth}{\centering\noindent
    \large\mdseries Supervisors \\ \thesupervisor\par
    \vskip0.7cm %1cm default
    \large\mdseries Institutions \\ \vskip0.1cm \theaffiliation\par
    \vskip0.7cm %1cm default
    \large\mdseries examiners \\ \theexaminer
    \vskip0.7cm %1cm default
    \large\mdseries\thefrontsignature\\ 
    {\color{red}This report is confidential.} %{\tiny(Delete this statement in the file ``unibe-msc.cls'' if the report is not confidential.)}
  }
  \cleardoublepage
  \endgroup
}
\endinput

解决方法

您的课程基于回忆录,因此您可以使用

\documentclass[a4paper,10pt,openright]{unibe-msc}

\maxtocdepth{subsection}
\setsecnumdepth{subsection}

\begin{document}

\tableofcontents

\section{Section}

\subsection{Test Numbering of Subsection with own class}

\end{document}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?