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}

在此处输入图片描述

相关内容