etoc 和 mwbk 之間的不相容性

etoc 和 mwbk 之間的不相容性

當我將etoc套件與mwbk類別一起使用時,\localtableofcontents可以工作(有錯誤),但\tableofcontents不能:

\documentclass{mwbk}

\usepackage{graphicx,xcolor}
\usepackage{hyperref}

\usepackage{etoc}

%doesn't work%%
%\etocstandardlines% ‘line entries’ as without \usepackage{etoc}
%\etocstandarddisplaystyle  % ‘toc display’ as without \usepackage{etoc}


\begin{document}

\tableofcontents

\etocsettocstyle{\section*{In this chapter you will see:}}{} % from now on only local tocs


\chapter{Chapter One}

\localtableofcontents


\section{Section One}
\subsection{Subsection One Point One}
\section{Section Two}

\end{document}

答案1

使用tocloft包來實現相容性。

\documentclass{mwbk}

\usepackage{graphicx,xcolor}
\usepackage{hyperref}
\usepackage{tocloft}
\usepackage{etoc}

%doesn't work%%
%\etocstandardlines% ‘line entries’ as without \usepackage{etoc}
%\etocstandarddisplaystyle  % ‘toc display’ as without \usepackage{etoc}


\begin{document}

\tableofcontents 

\etocsettocstyle{\section*{In this chapter you will see:}}{} % from now on only local tocs


\chapter{Chapter One}

\localtableofcontents


\section{Section One}
\subsection{Subsection One Point One}
\section{Section Two}

\end{document}

在此輸入影像描述

相關內容