
答案1
正如 skpblack 評論的那樣,包titlesec
可以用於此目的:
\documentclass{article}
\usepackage{lmodern, titlesec, xcolor}
\titleformat{name=\section,numberless}
{\normalfont\Large\bfseries}
{\color{yellow}\rule{1em}{1em}}
{1em}
{}
\begin{document}
\section{Another day in paradise}
A regular numbered section
\section*{Another night in paradise}
A starred section that has a coloured box
\end{document}
這使
有關間距等的微調,請參閱titlesec
文件。