语言要求章节标题采用以下布局:
b. 数字和其后的句号应采用粗体;标题文字应采用小写字母。
d. 不要使用超过两级标题:例如,1 或 2.3 可以,但 3.2.4 不行。如果需要进一步划分章节,只需使用小写字母作为子章节标题,而无需数字。方法。实验 1 在隔音实验室中进行... e. 将章节标题与章节编号和章节第一行放在一行上。1. 简介。最近的复兴...
有没有办法在不触及原文的情况下做到这一点?目前我有:
\documentclass[letterpaper,12pt]{scrartcl}
\usepackage{times}
\usepackage[T1]{fontenc} % Silbentrennung
\setkomafont{sectioning}{\normalfont\rmfamily\mdseries\upshape}
\setkomafont{paragraph}{\scshape}
\let\subsubsection=\paragraph
\begin{document}
\section{Section 1}
In this section I want to show that \ldots
\subsection{Subsection 1}
The special focus here is on \ldots
\subsubsection{Subsubsection 1}
This subsubsection is allegal and should come out as a paragraph.
\end{document}
缺少的是数字的粗体、数字后面的点和章节标题后面的点,以及将章节和小节标题视为段落的一些设置。有没有办法在 Koma Script 中做到这一点?
答案1
komascript
的标题格式化工具很棒,但如果您想要分别格式化数字和标题,这些工具还不够。以下是操作方法。这使用标题安全(顺便问一下,什么语言要求你做这一切?我觉得这很无礼,真的)
\documentclass[paper=letter,12pt]{scrartcl}
\usepackage[T1]{fontenc} % Silbentrennung
\usepackage{times}
\usepackage{titlesec}
\setcounter{secnumdepth}{2}
\let\subsubsection\paragraph
\newcommand{\periodafter}[1]{#1.}
\titleformat{\section}{\normalfont\scshape}{\textbf{\thesection.}}{1ex}{\periodafter}
\titleformat{\subsection}{\normalfont\scshape}{\textbf{\thesubsection.}}{1ex}{\periodafter}
\titleformat{\paragraph}[runin]{\normalfont\scshape}{}{1em}{}
\begin{document}
\section{Section 1}
In this section I want to show that \ldots
\subsection{Subsection 1}
The special focus here is on \ldots
\subsubsection{Subsubsection 1}
This subsubsection is allegal and should come out as a paragraph.
\end{document}
附言:不过我确实喜欢用复古的时期来结束这些标题。
答案2
titlesec
KOMA-Script 包中的类之间存在一些不兼容性;请参阅KOMA-Script 与 titlesec 之间的不兼容性.一种不涉及的解决方案titlesec
如下:
\documentclass[letterpaper,12pt]{scrartcl}
\usepackage{times}
\usepackage{etoolbox}
\usepackage[T1]{fontenc}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\makeatletter
\patchcmd{\section}{2.3ex \@plus.2ex}{0em}{}{}
\patchcmd{\subsection}{1.5ex \@plus .2ex}{0em}{}{}
\patchcmd{\subsubsection}{1.5ex \@plus .2ex}{0em}{}{}
\renewcommand\sectfont{\normalfont\scshape}
\def\@seccntformat#1{{\bfseries\csname the#1\endcsname.}\quad}
\apptocmd{\@sect}{.~}{}{}
\apptocmd{\@ssect}{.~}{}{}
\makeatother
\begin{document}
\section{Test Section One}
In this section I want to show that \ldots
\subsection{Test Subsection}
The special focus here is on \ldots
\subsubsection{Test Subsubsection}
This subsubsection is legal; it comes out as a paragraph.
\end{document}