将章节和部分的标题从半倍行距更改为单倍行距

将章节和部分的标题从半倍行距更改为单倍行距

有没有一个简单的解决方案,可以让部分和章节的标题名称单倍行距,但文本为半倍行距,而不必\SingleSpace在每个标题名称中添加内容。我找到了一个适用于各部分的解决方案,即:

\renewcommand\secheadstyle{\setSpacing{0.95}\Large\bfseries\memRTLraggedright}

我需要它不要超越目录、页眉等的任何定制。它应该只影响部分和章节标题在页面上的显示方式,而不是目录、页眉或任何其他地方。

最小功能文档:

\documentclass[12pt,a4paper,onecolumn,twoside,final]{memoir}
\usepackage[english]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{newcent}
\usepackage[utf8x]{inputenc}
\usepackage[textwidth=14cm,textheight=22cm]{geometry} 

\chapterstyle{hangnum}
\OnehalfSpacing

\begin{document}

\chapter{A Long title of the chapter, that breaks the line and should be single  spaced instead of onehalfspaced}
Text that is onehalfspaced just like it should be. Nothing like a piece of text that is like it should be. Text that is onehalfspaced just like it should be. Nothing like a piece of text that is like it should be. Text that is onehalfspaced just like it should be. Nothing like a piece of text that is like it should be.
\section{A Long section title of the chapter, with the same problem as the title}

\end{document}

答案1

教导memoir在标题中使用单倍行距:

\documentclass[12pt,a4paper,onecolumn,twoside,final]{memoir}
\usepackage[english]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{newcent}
\usepackage[utf8]{inputenc}
\usepackage[textwidth=14cm,textheight=22cm]{geometry} 
\usepackage{etoolbox}
\usepackage{color} % just for the example

\chapterstyle{hangnum}
\preto\chaptitlefont{\linespread{1}}
\setsechook{\linespread{1}}

\OnehalfSpacing

\begin{document}

\chapter{A Long title of the chapter, that breaks the line and 
should be single spaced instead of onehalfspaced}

Text that is onehalf spaced just like it should \textit{\textbf{\textcolor{red}{not}}} be. Nothing 
like a piece of text that is like it should be. Text that is onehalfspaced just like it 
should be. Nothing like a piece of text that is like it should be. Text that is onehalfspaced 
just like it should be. Nothing like a piece of text that is like it should be.

\section{A Long section title of the chapter, with the same problem as the title}

\end{document}

您可能希望对小节和更低级别执行类似操作。

在此处输入图片描述

如果可以的话,请避免扩大行距。

相关内容