1
votes

Unfortunately, I tried anything in my mind to get the numbering of the subsections.

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

The subsection appears in the TOC and in the document with the below codes, but without the numbering (see picture). Mysteriously chapter and section numbering works fine.

Simple latex tests, e.g. with \documentclass[a4paper, 10pt]{scrartcl}, subsection numbering works fine.

System:

  • MacTex 2020
  • MacOS Catalina
  • texmaker

pdf output

Simplified Testfile (scrartcl VS unibe-msc):

%\documentclass[a4paper, 10pt] {scrartcl}
\documentclass[a4paper, 10pt, 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
1
please make a compilable minimal reproducible example and not just a code fragementsamcarter_is_at_topanswers.xyz

1 Answers

0
votes

Your class is based on memoir, so you can use

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