答案1
像这样吗?
\documentclass[a4paper, 12pt, fleqn]{article}
\usepackage{titlesec}
\usepackage{xcolor}
\renewcommand{\familydefault}{\sfdefault}
\titleformat{\section}[display]{\centering\Large\bfseries}{}{0pt}{\underline}
\titleformat{\subsection}{\large\bfseries\color{darkgray}}{}{0pt}{\underline}
\titleformat{\subsubsection}{\bfseries\color{gray}}{}{0pt}{}
\setcounter{secnumdepth}{0}
\begin{document}
\section{Section Title}
\subsection{Subsection Title}
\subsubsection{Subsubsection Title}
Text
\end{document}