减小目录 (TOC) 中章节标题的字体大小,而不是章节正文的标题

减小目录 (TOC) 中章节标题的字体大小,而不是章节正文的标题

我有以下代码:我的问题是我想仅减小目录中章节标题的字体大小,但保留章节正文实际标题的字体大小。我有此代码,但目录中章节的字体仍然较大。任何帮助都将不胜感激!

\documentclass[a4paper,USenglish, hidelinks,11pt,portrait,onecolumn,openany]{report}
% Packages
\usepackage{xspace}
\usepackage{url}
\usepackage[htt]{hyphenat}
\usepackage{microtype}
% \usepackage[noligatures]{microtype}
\usepackage[utf8]{inputenc}
\usepackage{parskip}
\usepackage[a4paper, inner=3.0cm, outer=2.0cm, top=2.0cm, bottom=2.0cm, bindingoffset=0cm]{geometry}
% \usepackage[a4paper, inner=3.0cm, outer=1.0cm, top=2.0cm, bottom=2.0cm, bindingoffset=1cm]{geometry}
% Chapter 7 (Table of Contents and References..)
% Packages
\usepackage{xspace}
\usepackage{url}
\usepackage[htt]{hyphenat}
\usepackage{microtype}
% \usepackage[noligatures]{microtype}
\usepackage{blindtext}
% this package sets space between lines
% \usepackage[doublespacing]{setspace}
\usepackage{setspace} % spacing inside tables...
\usepackage{fancyhdr}
\usepackage{array}
\usepackage{verbatim}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage [font=small, labelfont=bf, margin=1cm]{caption}
\usepackage{varioref}
\usepackage{cleveref}
% \usepackage{hyperref}
\usepackage{tocloft}
\usepackage{titletoc}
\usepackage{titlesec}
\usepackage{minitoc}
% nottoc option removes self referencing of Table Of Contents (TOC) 
\usepackage[nottoc]{tocbibind} 
%\usepackage[notlof]{tocbibind}
% \usepackage{biblatex}
\usepackage{natbib}
\usepackage{fixltx2e}
\usepackage{upgreek}
\usepackage{latexsym}
\usepackage{siunitx}
\usepackage{lmodern}
\usepackage{kpfonts}
\usepackage{pxfonts}

% Times New Roman 
% using both packages produces better text and math fonts...
\usepackage{mathptmx}
\usepackage{mathpazo}

\usepackage{graphicx} %\usepackage[demo]{graphicx}
\usepackage{fancyhdr}
\usepackage{verbatim}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{cleveref}
\usepackage{ragged2e}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{xcolor} % change text color

% Import math packages
\usepackage{amsmath} 
\usepackage{amssymb} 
\usepackage{amscd} 
% \usepackage{amsthm} %introduces errors .. avoid

\usepackage{float}
\usepackage{placeins}
\usepackage{afterpage}
\usepackage{adjustbox}

\usepackage{epstopdf}
\usepackage{pdfpages}
\usepackage{afterpage}
\usepackage{placeins}
\usepackage{relsize}
% math package
% \usepackage{afterpage}
% \def\oneraggedpage{\raggedbottom\afterpage{\flushbottom}}

\usepackage{sectsty} % to center the chapter or section or subsection title..
% Only center chapters and not sections and subsections..
\chapterfont{\centering} % goes with package sectsty above..

% other options..
% \sectionfont{\centering}
% \subsectionfont{\centering}
% \allsectionsfont{\centering}

% makes double quotations easier....
\usepackage [autostyle, english = american]{csquotes}
\MakeOuterQuote{"}

% drawing a circle with color
\usepackage{tikz}
\newcommand{\tikzcircle}[2][red,fill=red]{\tikz[baseline=-0.5ex]\draw[#1,radius=#2] (0,0) circle ;}%

\usepackage{multirow, booktabs, boldline, hhline}
\usepackage{morefloats}
\usepackage{textcomp}


\crefname{enumi}{position}{positions}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
% User Defined Commands
\newcommand{\uDefBfSeries}[3][\itshape]{#1}   
\newcommand{\keyword}[2][\bfseries\itshape]{{#1#2}}


\crefname{enumi}{position}{positions}
\pagestyle{empty}
\newcommand{\normal}[1]{\multicolumn{1}{l}{#1}}
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} % for centering of columns with justify

% Scales the spaces within the table to 100% of their original..
\renewcommand{\arraystretch}{1.0}

% scales the default interline space to 1.5 its default value. Of course that number can be set to any value.
\renewcommand{\baselinestretch}{2.0} % for 2.0 double spacing between lines..

\graphicspath{{D:/RESEARCH\_2/Dissertation/Final\_Results}} % Note: the delimiter should be '/' instead of '\' to work...

\everymath{\displaystyle}
\DeclareMathOperator{\dis}{d} % for writing norm operator


% \titleformat{\section}
% {\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}


% titlespacing{\section}{0pt}{0pt}{0pt} % this reduces space between (sub)sections to 0pt, for example
\titlespacing\section{0pt}{11pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsection{0pt}{11pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsubsection{0pt}{8pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\paragraph{0pt}{6pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}

%% this will reduce spaces between parts (above and below) of texts within a (sub)section to 0pt, for example - like between an 'eqnarray' and text
\AtBeginDocument{
\setlength\abovedisplayskip{6pt}
\setlength\belowdisplayskip{8pt}
}

% Modify paragraph to make it a sub-section..
% \makeatother
\setcounter{secnumdepth}{4} % how many sectioning levels to assign numbers to
\setcounter{tocdepth}{4}    % how many sectioning levels to show in ToC

% Using \setlength is highly recommended..
\setlength{\extrarowheight}{4pt}
\setlength{\heavyrulewidth}{1.2pt} %default for top and bottom rule
\setlength{\lightrulewidth}{0.2pt} %thickness of \midrule
\setlength{\cmidrulewidth}{0.5pt} %thickness of \cmidrule

\setlength{\abovetopsep}{0pt} %space above top rule
\setlength{\belowbottomsep}{0pt} %space below bottom rule
\setlength{\aboverulesep}{0pt} %for space above \midrule \cmidrule and \bottomrule
\setlength{\belowrulesep}{0pt} %for space below \midrule, \cmidrule and \toprule

\setlength{\cmidrulekern}{0pt}  %for trimming in \cmidrule
\setlength{\abovetopsep}{0pt} %leaves 'x'pt space below caption and start of table otherwise use \vspace{10pt} to LEAVE SPACE BET CAP AND TAB.

% \setlength\abovedisplayskip{4pt}
% \setlength\belowdisplayskip{4pt}
% \setlength\abovedisplayshortskip{2pt}
% \setlength\belowdisplayshortskip{2pt}

% Pargraph settings
\setlength{\parindent}{4em}
\setlength{\parskip}{1em}

% \makeatletter
% \makeatother

\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\pagestyle{fancy} %for fancy headers
\rhead{\thepage}

%Fix headers on Table of Contents and List of Figures:
\fancypagestyle{plain}{}
%\pagenumbering{roman}

%\fancyfoot[R]{\thepage}
%\fancyhead[R]{\thepage}

% Overriding fancy header
%\lhead{Left header}
%\rhead{Right header}
%\chead{Center header}

%\lfoot{Left footer}
%\rfoot{Right footer}
%\cfoot{Center footer}

% Enable these 3
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}
\titleformat*{\section}{\small}
\renewcommand{\chaptertitlefont}{\normalfont\sffamily\small}

% From natbib package....reduces font size for bibliography entries
% \def\bibfont{\footnotesize}
\def\bibfont{\normalsize}

\usepackage{abstract}
\renewcommand{\abstractnamefont}{\normalfont\huge}
\renewcommand\abstractname{\uppercase{abstract}}
\renewcommand\abstractname{\normalfont\textsc{abstract}}

\begin{document}
  \renewcommand{\contentsname}{\fontsize{18}{2}\selectfont\ TABLE OF CONTENTS}
  \centering{\tableofcontents}
  \chapter{\fontsize{15}{10}\selectfont\ INTRODUCTION}
  \chapter{\fontsize{15}{10}\selectfont\ LITERATURE SURVEY}
\end{document}

答案1

欢迎来到本网站。请注意,在 5 分钟内使用不同的主题行没有什么帮助——你可以编辑你的第一个问题。

正如@WillieWong 提到的,加载您需要的包并且您知道它们的作用——加载尽可能多的包只会有助于解决冲突。

解决您的问题的一个方法是本地更改标题的格式\tableofcontents,这里有一个解决方案titlesec.sty

\documentclass[a4paper,11pt,openany]{report}

\usepackage{titlesec}

\usepackage[utf8]{inputenc}

\begin{document}
\begingroup
  \titleformat{\chapter}[display]
    {\filright}
    {}
    {0pt}
    {\large\bfseries}% <== Adjust to your needs
  \tableofcontents
\endgroup
\chapter{Introduction}
\chapter{Literature Survey}
\end{document}

在此处输入图片描述

相关内容