我使用以下样式作为章节标题
\documentclass[12pt]{report}
\usepackage{graphicx}
\usepackage{natbib}
\usepackage[hidelinks]{hyperref}
\usepackage[%
left=1.46in,%
right=0.98in,%
top=0.98in,%
bottom=0.98in%
]{geometry}%
\usepackage{setspace}
\usepackage{titlesec}
\usepackage{fourier}
\usepackage{titletoc}
\makeatletter
\newcommand{\thechapterwords}
{\thechapter}
\def\thickhrulefill{\leavevmode \leaders \hrule height 0.6ex \hfill \kern \z@}
\def\@makechapterhead#1{%
%\vspace*{50\p@}%
\vspace*{10\p@}%
{\parindent \z@ \centering \reset@font
\thickhrulefill\quad
\scshape \@chapapp{} \thechapterwords
\quad \thickhrulefill
\par\nobreak
\vspace*{10\p@}%
\interlinepenalty\@M
\hrule
\vspace*{10\p@}%
\LARGE \bfseries \decofourleft \hspace{0.1cm} #1 \hspace{0.1cm} \decofourright \par\nobreak
\par
\vspace*{10\p@}%
\hrule
%\vskip 40\p@
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
%\vspace*{50\p@}%
\vspace*{10\p@}%
{\parindent \z@ \centering \reset@font
\thickhrulefill
\par\nobreak
\vspace*{10\p@}%
\interlinepenalty\@M
\hrule
\vspace*{10\p@}%
\Large #1\par\nobreak
\par
\vspace*{10\p@}%
\hrule
%\vskip 40\p@
\vskip 40\p@
}}
这些在 \chapter{...} 上工作得很好。我如何才能将此样式应用于目录标题以及参考书目和参考文献标题?这是我拥有的代码。
\tableofcontents
\addtocontents{toc}{~\hfill\textbf{Page}\par}
... chapters
\renewcommand\bibname{Bibliography and References}
\bibliographystyle{plain}
\bibliography{references}
非常感谢您的帮助。我对 Latex 还不熟悉,一直在寻找。
以下是标题的截图。当然,我不希望目录/参考书目有章节{章节号}
答案1
你必须添加以下行
\LARGE \bfseries \decofourleft \hspace{0.1cm} #1 \hspace{0.1cm}\decofourright\par\nobreak
代替\Large #1\par\nobreak
的定义\@makeschapterhead
。 也不是说中间没有空格\hspace{0.1cm}\decofourright
\documentclass[10pt,a4paper]{report}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm,showframe]{geometry} %% remove showframe
\usepackage{fourier-orns}
\makeatletter
\newcommand{\thechapterwords}
{\thechapter}
\def\thickhrulefill{\leavevmode \leaders \hrule height 0.6ex \hfill \kern \z@}
\def\@makechapterhead#1{%
%\vspace*{50\p@}%
\vspace*{10\p@}%
{\parindent \z@ \centering \reset@font
\thickhrulefill\quad
\scshape \@chapapp{} \thechapterwords
\quad \thickhrulefill
\par\nobreak
\vspace*{10\p@}%
\interlinepenalty\@M
\hrule
\vspace*{10\p@}%
\LARGE \bfseries \decofourleft \hspace{0.1cm} #1 \hspace{0.1cm}\decofourright\par\nobreak
\par
\vspace*{10\p@}%
\hrule
%\vskip 40\p@
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
%\vspace*{50\p@}%
\vspace*{10\p@}%
{\parindent \z@ \centering \reset@font
\thickhrulefill
\par\nobreak
\vspace*{10\p@}%
\interlinepenalty\@M
\hrule
\vspace*{10\p@}%
\LARGE \bfseries \decofourleft \hspace{0.1cm} #1 \hspace{0.1cm}\decofourright \par\nobreak
\par
\vspace*{10\p@}%
\hrule
%\vskip 40\p@
\vskip 40\p@
}}
\makeatother
\begin{document}
\tableofcontents
\addtocontents{toc}{~\hfill\textbf{Page}\par}
\chapter{Introduction}
\nocite{*}
\chapter*{Introduction}
\renewcommand\bibname{Bibliography and References}
\bibliographystyle{plain}
\bibliography{xampl}
\end{document}