答案1
这里有一种方法可以做到这一点titlesec
:
\documentclass[11pt]{article}
\usepackage{xcolor}
\newcommand{\myblackbox}[1]{\colorbox{black}{\parbox{0.5\textwidth}{#1}}}
\usepackage{titlesec}
\titleformat{\section}{\Large\bfseries}{}{0pt}{\color{white}\myblackbox}%
[{\raisebox{1ex}[0pt]{\rule[1ex]{\textwidth}{0.8pt}}}]
\begin{document}
\section{Properties of the Series}
In former days -- that is to say, once upon a time, there lived in the Land of Gramblamble,
Seven Families. They lived by the side of the great Lake Pipple-popple (one of the Seven
Families, indeed, lived in the Lake), and on the outskirts of the City of Tosh, which,
excepting when it was quite dark, they could see plainly. The names of all these places
you have probably heard of, and you have only not to look in your Geography books to
find out all about them.
\end{document}