我目前正在使用书法字体,它工作正常,但有一个例外:章节/节和标题不受它影响。如何才能使它们也受到影响(如果这是一种通用方法,如何才能使标题不受影响,但章节和节受影响)?
\documentclass[10pt,a4paper,BCOR10mm,DIV11,toc=listof,parskip=full, openany]{scrbook}
\usepackage{etoolbox}
\usepackage{xpatch}
\makeatletter
\renewcommand{\chapterheadstartvskip}{\vspace{0pt}}
\renewcommand{\chapterheadendvskip}{\vspace{\baselineskip}}
\patchcmd{\section}{-3.5ex \@plus -1ex \@minus -.2ex}{-\z@}{}{}
\patchcmd{\section}{2.3ex \@plus .2ex}{1sp}{}{}
\patchcmd{\subsection}{-3.25ex\@plus -1ex \@minus -.2ex}{-\z@}{}{}
\patchcmd{\subsection}{1.5ex \@plus .2ex}{1sp}{}{}
\patchcmd{\subsubsection}{-3.25ex\@plus -1ex \@minus -.2ex}{-\z@}{}{}
\patchcmd{\subsubsection}{1.5ex \@plus .2ex}{1sp}{}{}
\patchcmd{\@xsect}{\ignorespaces}{\vspace*{-.5\baselineskip}\ignorespaces}{}{}
\xpatchcmd{\maketitle}{\if@twoside\next@tpage}{\iffalse}{}{}
\makeatother
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{multicol}
\usepackage[usenames,svgnames, dvipsnames]{xcolor}
\usepackage{graphicx,eso-pic}
\usepackage{ulem}
\usepackage[pages=some]{background}
\newenvironment{calligraphic}%
{\usefont{T1}{pzc}{m}{it}}%
{}%
\begin{document}
\begin{calligraphic}
\maktetitle
\tableofcontents
\chapter{test1}
mytesttext
\end{calligraphic}
\end{document}
答案1
这是因为KOMA 脚本发出单独的字体选择来设置章节标题。具体来说\sectfont
,默认为
\newcommand*{\sectfont}{\normalcolor\sffamily\bfseries}
将其更改为
\renewcommand*{\sectfont}{\normalcolor\usefont{T1}{pzc}{m}{it}}
产生所需的输出: