我在章节标题下用 画了一条线\titlerule[2pt]
。我想在“目录”、“图片列表”和“表格列表”标题下实现同样的设计。有人能告诉我怎么做吗?
我还希望该行位于大“目录”标题下。以及其他页面上的“图片列表”和“表格列表”标题下。
这是我的 MWE:
\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{microtype}
\usepackage{newtxtext}
\usepackage[a4paper, top=30mm,bottom=30mm,inner=25mm,outer=25mm]{geometry}
\usepackage{titlesec}
\usepackage{sectsty}
\usepackage{fancyhdr}
\usepackage{setspace}
\setstretch{1.36}
\usepackage{tocbibind}
\usepackage{tocloft}
\renewcommand{\cfttoctitlefont}
{\usefont{T1}{qhv}{b}{n}\selectfont\huge}
\renewcommand{\cftchapfont}
{\usefont{T1}{qhv}{b}{n}\selectfont}
\renewcommand{\cftloftitlefont}
{\usefont{T1}{qhv}{b}{n}\selectfont\huge}
\renewcommand{\cftlottitlefont}
{\usefont{T1}{qhv}{b}{n}\selectfont\huge}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\fontfamily{qhv}\selectfont}{\chaptertitlename\ \thechapter}{15pt}{\Huge}[\vspace{0.8ex}{\titlerule[2pt]}]
\allsectionsfont{\fontfamily{qhv}\selectfont}
\makeatletter % Removes the word 'Chapter'
\renewcommand{\@chapapp}{}
\makeatother
\begin{document}
\pagenumbering{roman}
\tableofcontents
\cleardoublepage
\listoffigures
\cleardoublepage
\listoftables
\cleardoublepage
\pagenumbering{arabic}
\chapter{Introduction}
\section{Example section}
\subsection{Example subsection}
\end{document}
答案1
使用titles
包选项tocloft
:
代码:
\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{newtxtext}
\usepackage[a4paper, top=30mm,bottom=30mm,inner=25mm,outer=25mm]{geometry}
\usepackage{titlesec}
\usepackage{sectsty}
\usepackage{fancyhdr}
\usepackage{setspace}
\setstretch{1.36}
\usepackage{tocbibind}
\usepackage[titles]{tocloft}
\usepackage{hyperref}% load after the other packages
\renewcommand{\cftchapfont}
{\usefont{T1}{qhv}{b}{n}\selectfont}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\fontfamily{qhv}\selectfont}{\chaptertitlename\ \thechapter}{15pt}{\Huge}[\vspace{0.8ex}{\titlerule[2pt]}]
\allsectionsfont{\fontfamily{qhv}\selectfont}
\makeatletter % Removes the word 'Chapter'
\renewcommand{\@chapapp}{}
\makeatother
\begin{document}
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\cleardoublepage
\pagenumbering{arabic}
\chapter{Introduction}
\section{Example section}
\subsection{Example subsection}
\end{document}
\cfttoctitlefont
请注意,\cftloftitlefont
和的重新定义。此外, LoF 和 LoT 之前的命令\cftlottitlefont
不再需要。\cleardoublepage
答案2
将此添加到您的序言中:
\renewcommand{\cftaftertoctitle}{\vspace{0.8ex}\endgraf\rule{\linewidth}{2pt}}
\renewcommand{\cftafterloftitle}{\vspace{0.8ex}\endgraf\rule{\linewidth}{2pt}}
\renewcommand{\cftafterlottitle}{\vspace{0.8ex}\endgraf\rule{\linewidth}{2pt}}