
решение1
Редактировать
Если вам не нужен номер раздела, вы можете просто использовать \section*{First Section}
или изменить пример следующим образом (это может быть затруднительно, если вам нужно оглавление):
\documentclass[a4paper]{article}
\usepackage{xcolor, blindtext}
\usepackage[explicit]{titlesec}
\newcommand{\sectionrule}[2][0ex]{\leaders\hbox{{\color{cyan}\rule[#1]{1pt}{#2}}}\hfill}
\titleformat{\section}{\Large\bfseries}{}{0pt}{#1\,\sectionrule[0.5ex]{1.5pt}}
\begin{document}
\section{First Section}
\blindtext
\section{Second Section}
\blindtext
\end{document}
Я нашел пятилетнего ребенка.ответ Бернардакоторый я лишь немного адаптировал:
\documentclass[a4paper]{article}
\usepackage{xcolor, blindtext}
\usepackage[explicit]{titlesec}
\newcommand{\sectionrule}[2][0ex]{\leaders\hbox{{\color{cyan}\rule[#1]{1pt}{#2}}}\hfill}
\titleformat{\section}{\Large\bfseries}{\thesection}{1em}{#1\,\sectionrule[0.5ex]{1.5pt}}
\begin{document}
\section{First Section}
\blindtext
\section{Second Section}
\blindtext
\end{document}