答案1
titlesec
以下是使用包来模仿图中所示布局的示例。您可以根据自己的喜好更改字体大小。
\documentclass{article}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage[top=1in,left=1.5in,right=1.5cm,bottom=1in]{geometry}
\usepackage{titlesec}
\titleformat{\section}{\bfseries\huge}{\llap{\Huge\thesection\hspace{1.3em}}}{0pt}{}[\vspace{-10pt}\llap{\hbox{\color{gray!50}\rule{2.2em}{4pt}}}\vspace{-25pt}\hbox{\color{gray!50}\rule{\linewidth}{4pt}}\addvspace{2cm}]
\titleformat{\subsection}{\bfseries\large}{\llap{\thesubsection\hspace{2.5em}}}{0pt}{}[]
\titleformat{\subsubsection}{\bfseries}{\llap{\thesubsubsection\hspace{2.2em}}}{0pt}{}[]
\begin{document}
\section{Introduction}
\lipsum[1][1-8]
\subsection{Function}
\lipsum[1]
\subsubsection{Example}
\lipsum[2]
\section{Next Section}
\lipsum[1][1-8]
\subsection{Function}
\lipsum[1]
\subsubsection{Example}
\lipsum[2]
\end{document}