如何更改不同章节中小节标题的字体大小

如何更改不同章节中小节标题的字体大小

在我的项目中,我想更改第 1 章和第 2 章中子节标题的字体大小,其中第 1 章中的子节应为大号,第 2 章中的子节应为大号。我该怎么做?谢谢

\documentclass[13pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}
\usepackage{amsfonts}
\usepackage[titles]{tocloft}
\usepackage{sectsty}
\usepackage{titlesec}


% for the chapter
\renewcommand{\thechapter}{\arabic{chapter}.}
\newlength\mylength
\renewcommand\cftchappresnum{\large{\hspace{0.04cm}}}
\settowidth\mylength{\bfseries\cftchappresnum\cftchapaftersnum}
\addtolength\cftchapnumwidth{\mylength}

% for the section
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\renewcommand{\cftsecnumwidth}{2em}
\titleformat*{\section}{\LARGE\bfseries}

% for the subsection
\renewcommand{\thesubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}.\hspace{-.55cm} }
\titleformat*{\subsection}{\Large\bfseries}

% for the subsubsection
\renewcommand{\thesubsubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.\hspace{-.45cm} }
\titleformat*{\subsubsection}{\large\bfseries}
\setcounter{secnumdepth}{5}

\begin{document}
{\large
\chapter{Knowledge}
\section{Algebra}
\subsection{Matrix.}
\subsubsection{Definition.}
\subsubsection{Proposition.}
\subsection{Vector space.}
\subsubsection{Definition.}

\vspace{.5cm}
\section{Analysis}
\subsection{Metric space.}
\subsubsection{Definition.}
\subsection{Continuous map.}
\subsubsection{Definition.}
\vspace{.5cm}
\section{Topology}
\subsection{Manifold.}
\subsubsection{Definition.}
\subsubsection{Lemma.}

\chapter{Spacetime}
\section{Space and time}
\subsection{Definition.}
\subsection{Proposition.}
\vspace{.5cm}
\section{Inertial frames}
\subsection{Definition.}
\subsection{Theorem.}

}
\end{document}

相关内容