答案1
您可以使用tikz
画出角落和titlesec
自定义标题格式:
\documentclass{article}
\usepackage{tikz}
\usepackage{titlesec}
\newcommand{\sectionformat}[1]{%
\begin{tikzpicture}[baseline=(title.base)]
\node (title) {\thesection\hspace{1em}#1};
\draw[double] (title.west) |- (title.south) (title.north) -| (title.east);
\end{tikzpicture}
}
% default values copied from titlesec documentation page 23
% parameters of \titleformat command are explained on page 4
\titleformat%
{\section}% <command> is the sectioning command to be redefined, i. e., \part, \chapter, \section, \subsection, \subsubsection, \paragraph or \subparagraph.
{\normalfont\Large\bfseries}% <format>
{}% <label> the number
{0em}% <sep> length. horizontal separation between label and title body
{\sectionformat}% code preceding the title body (title body is taken as argument)
\usepackage{blindtext}
\begin{document}
\Blinddocument
\end{document}
编辑:请注意,长标题将不是[align=left]
自动换行。如果您在 后添加,\node
则可以使用 手动插入换行符\\
。