我正在使用修改后的章节格式http://zoonek.free.fr/LaTeX/LaTeX_samples_chapter/0.html我遇到了一个问题,因为它为目录、图表和表格列表创建了章节编号。
以下是 MWE:
\documentclass[11pt,journal,twoside]{book}
\usepackage{blindtext}
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
\vspace*{10\p@}%
{\parindent \z@ \centering \reset@font
\thickhrulefill\quad
\scshape \@chapapp{} \thechapter
\quad \thickhrulefill
\par\nobreak
\vspace*{10\p@}%
\interlinepenalty\@M
\hrule
\vspace*{10\p@}%
\Huge \bfseries #1\par\nobreak
\par
\vspace*{10\p@}%
\hrule
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
\vspace*{10\p@}%
{\parindent \z@ \centering \reset@font
\thickhrulefill
\scshape \thechapter
\thickhrulefill
\par\nobreak
\vspace*{10\p@}%
\interlinepenalty\@M
\hrule
\vspace*{10\p@}%
\Huge \bfseries #1\par\nobreak
\par
\vspace*{10\p@}%
\hrule
\vskip 40\p@
}}
\begin{document}
\tableofcontents
\chapter{Title1}
\blindtext
\chapter{Title2}
\blindtext
\chapter{Title3}
\blindtext
\listoffigures
\listoftables
\end{document}
虽然它在章节标题上方给出了章节编号,但正如预期的那样,它还在目录、图表列表和表格列表上方放置了一个数字;如下所示:
有没有办法可以删除这些数字而不影响章节数量?
答案1
目录等用作\chapter*
其标题。您对的重新定义\chapter*
包括章节编号。
% toctitleprob.tex SE 615965
\documentclass[11pt,journal,twoside,openany]{book}
\usepackage{blindtext}
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
\vspace*{10\p@}%
{\parindent \z@ \centering \reset@font
\thickhrulefill\quad
\scshape \@chapapp{} \thechapter
\quad \thickhrulefill
\par\nobreak
\vspace*{10\p@}%
\interlinepenalty\@M
\hrule
\vspace*{10\p@}%
\Huge \bfseries #1\par\nobreak
\par
\vspace*{10\p@}%
\hrule
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
\vspace*{10\p@}%
{\parindent \z@ \centering \reset@font
\thickhrulefill
%%% \scshape \thechapter %%% I think you don't want this
\thickhrulefill
\par\nobreak
\vspace*{10\p@}%
\interlinepenalty\@M
\hrule
\vspace*{10\p@}%
\Huge \bfseries #1\par\nobreak
\par
\vspace*{10\p@}%
\hrule
\vskip 40\p@
}}
\begin{document}
\tableofcontents
\chapter{Title1}
\blindtext
\chapter*{Starred Title}
\blindtext
\end{document}
\chapter{Title2}
\blindtext
\end{document}
\chapter{Title3}
\blindtext
\listoffigures
\listoftables
\end{document}