使用回忆录类生成目录时出现问题

使用回忆录类生成目录时出现问题

我正在尝试使用回忆录类生成目录,但没有成功。

\documentclass{memoir}

\usepackage[T1]{fontenc}%
\usepackage[utf8]{inputenc}%
\usepackage{lmodern}%
\usepackage{textcomp}%
\usepackage{lastpage}%
\usepackage{geometry}%
\geometry{margin=1in,paper=letterpaper}%
\usepackage{fancyhdr}%
\usepackage{amsmath}%
\usepackage{amssymb}%
\usepackage{microtype}%
\usepackage{multicol}%
\usepackage{xlop}%
\usepackage{enumitem}%
\usepackage{sectsty}%
\usepackage{graphic}%
\usepackage{tcolorbox}
\usepackage{pifont}
\usepackage{tikz}

\makeatletter
\newlength\dlf@normtxtw

\setlength\dlf@normtxtw{\textwidth}
\def\myhelvetfont{\def\sfdefault{mdput}}
\newsavebox{\feline@chapter}
\newcommand\feline@chapter@marker[1][4cm]{%
    \thispagestyle{empty} 
    \sbox\feline@chapter{%
        \resizebox{!}{#1}{\fboxsep=1pt%
            \colorbox{nicegray}{\color{white}\bfseries\sffamily\thechapter}%
        }}%
    \rotatebox{90}{%
        \resizebox{%
            \heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
        {!}{\scshape\so\@chapapp}}\quad%
    \raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
}
\newcommand\feline@chm[1][4cm]{%
    \sbox\feline@chapter{\feline@chapter@marker[#1]}%
    \makebox[0pt][l]{% aka \rlap
        \makebox[1cm][r]{\usebox\feline@chapter}%
    }}
\makechapterstyle{daleif1}{
    \renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}
    \renewcommand\chaptitlefont{\normalfont\HUGE\bfseries\scshape\color{black}}
    %\renewcommand\chapternamenum{}
    \renewcommand\printchaptername{}
    \renewcommand\printchapternum{\null\hfill\feline@chm[3.5cm]\par}
    %\renewcommand\afterchapternum{\par\vskip\midchapskip}
    \renewcommand\printchaptertitle[1]{\chaptitlefont\raggedleft##1\par\newpage}
    
}
\makeatother
%%chapter style
\chapterstyle{daleif1}

\begin{document}

\tableofcontents

\chapter{Chapitre 1}
\section{Section 1}
    \subsubsection{subsub1}
    \subsubsection{subsub2}
    \subsubsection{subsub3}
    \subsubsection{subsub4}
    \subsubsection{subsub5}
\section{Section 2}
\subsubsection{subsub1}
    \subsubsection{subsub2}
    \subsubsection{subsub3}
    \subsubsection{subsub4}
    \subsubsection{subsub5}
\chapter{Chapitre 2}
\section{Section 1}
\subsubsection{subsub1}
    \subsubsection{subsub2}
    \subsubsection{subsub3}
    \subsubsection{subsub4}
    \subsubsection{subsub5}
\section{Section 2}
\subsubsection{subsub1}
    \subsubsection{subsub2}
    \subsubsection{subsub3}
    \subsubsection{subsub4}
    \subsubsection{subsub5}

\chapter{Chapitre 3}
\section{Section 1}
\section{Section 2}
\chapter{Chapitre 4}
\section{Section 1}
\section{Section 2}
\end{document}

我得到一个空的 ToC,如下所示: 在此处输入图片描述

如果您能帮我找出我做错的地方,我将不胜感激。谢谢

相关内容