从内容表中删除章节摘要

从内容表中删除章节摘要

我正在使用 chapterprecis 为回忆录文档类中的每个章节写一个小摘要。但是,我刚刚注意到,在目录中,它显示了本 chapterprecis 的全文。我想知道如何摆脱它。

\documentclass[12pt]{memoir}
\usepackage{lipsum}
\usepackage{amssymb}
\usepackage{pgfplots}
\usepackage{geometry}
\usetikzlibrary{shapes,arrows,arrows.meta}
\pagestyle{companion}
\setlength\prechapterprecisshift{20pt}

\definecolor{ared}{rgb}{.647,.129,.149}
\renewcommand\colorchapnum{\color{ared}}
\renewcommand\colorchaptitle{\color{ared}}
\chapterstyle{pedersen}

\begin{document}
\tableofcontents
\chapter{This is a test.}
\chapterprecis{
This is a test to show that the chapterprecis shows in the contents table and I would like to know how to get rid of this.}
\section{section 1}
\lipsum[1-2]
\section{section 2}
\lipsum[1-2]
\end{document} 

在此处输入图片描述

答案1

\chapterprecishere不会将文本添加到目录中。仅将文本添加到目录中的相应命令是\chapterprecistoc

\documentclass[12pt]{memoir}
\usepackage{lipsum}
\usepackage{amssymb}
\usepackage{pgfplots}
\usepackage{geometry}
\usetikzlibrary{shapes,arrows,arrows.meta}
\pagestyle{companion}
\setlength\prechapterprecisshift{20pt}

\definecolor{ared}{rgb}{.647,.129,.149}
\renewcommand\colorchapnum{\color{ared}}
\renewcommand\colorchaptitle{\color{ared}}
\chapterstyle{pedersen}

\begin{document}
\tableofcontents
\chapter{This is a test.}
\chapterprecishere{
This is a test to show that the chapterprecis shows in the contents table and I would like to know how to get rid of this.}
\section{section 1}
\lipsum[1-2]
\section{section 2}
\lipsum[1-2]
\end{document} 

在此处输入图片描述

相关内容