答案1
使用 KOMA 脚本进行的设计。正如其他人所说,如果您需要章节,则应该使用提供章节的类。
如果您想要 a 下的描述\section
,请\sectiondescription
在 之前使用\section
。
\documentclass[]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\makeatletter
\let\KOMA@sectionlinesformat\sectionlinesformat
\renewcommand\sectionlinesformat[4]
{%
\ifstr{#1}{section}
{%
\null\hfill\parbox{.8\linewidth}
{%
\begingroup
\raggedleft
#3\par
\bigskip
#4\par
\medskip
\endgroup
\hrule
\ifx\section@description\@empty
\else
\begingroup
\medskip
\normalfont
\itshape
\footnotesize
\section@description
\endgroup
\global\let\section@description\@empty
\fi
}%
}
{\KOMA@sectionlinesformat{#1}{#2}{#3}{#4}}%
}
\newcommand\sectiondescription[1]
{%
\gdef\section@description{#1}%
}
\let\section@description\@empty
\renewcommand\sectionformat
{%
\begingroup
\bfseries
\fontsize{60pt}{72pt}\selectfont\thesection
\endgroup
}
\makeatother
\setkomafont{section}{\normalfont\rmfamily\huge\scshape}
%% only for dummy contents
\usepackage{duckuments}
\begin{document}
\sectiondescription{This section is about a duck}
\duckument
\end{document}