如何创建这样的章节标题

如何创建这样的章节标题

我需要创建这样的标题样式。请帮我创建相同的标题样式。谢谢。 在此处输入图片描述

答案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}

在此处输入图片描述

相关内容