行距、\linespread、pt 和 \titlespacing 混淆

行距、\linespread、pt 和 \titlespacing 混淆

我的大学要求段落内使用双倍行距,段落之间使用三倍行距。它还要求每个部分标题前和章节标题后使用三倍行距。我使用了:

\documentclass [12pt, a4paper, twoside, openany]{report}

...

%Triple spacing between paragraphs
\setlength\parskip{36pt}

%For double spacing, add \doublespacing after \begin{document}
\usepackage[nodisplayskipstretch]{setspace}

...

%For centering of chapter titles:
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{1em}{\Huge}

%Change Section Headings and lower headings' font size to 12pt
\titleformat{\section}
{\normalfont\normalsize\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\normalsize\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}
{\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}

%Change spacing between chapter titles and text
\titlespacing*{\chapter}{0pt}{0pt}{27pt}

%Change spacing between section titles and text
\titlespacing*{\section}{0pt}{36pt}{24pt}
\titlespacing*{\subsection}{0pt}{36pt}{24pt}
\titlespacing*{\subsubsection}{0pt}{36pt}{24pt}

输出如下:

在此处输入图片描述

在此处输入图片描述

我对 12pt 普通字体的文档类报告的行距定义感到困惑。Linespread 和 baselineskip 只会增加混乱。

从网上搜集的信息来看,如果普通字体是 12 pt,那么双倍行距就不是 24 pt。此外,行与段落之间的间距或间隔的计算方式也不同。请帮我解决这个困惑。谢谢。

PS 我们如何删除“章节号”和“章节标题”之间所有不必要的空格?

答案1

双倍行距或三倍行距没有明确的定义。

请参阅“双倍行距”是什么意思?

\baselineskip是长度命令。指定段落中两行底部之间的最小间距。

\baselinestretch缩放 的值\baselineskip。其默认值为 1.0,但最佳值取决于字体、大小和样式、线条长度等。LaTeX 的标准类独立\baselinestretch于这些因素设置 。

该包setspace将一倍半基线间距设为字体大小(以 pt 为单位)的 1.5 倍(对于 12pt 字体大小,设为 18pt),将双倍间距设为字体大小(以 pt 为单位)的两倍(对于 12pt 字体大小,设为 24pt)。因此,我们可以将三倍基线间距定义为字体大小的三倍 = 12pt 字体的 36pt。

您可以询问您的大学他们所说的双倍行距和三倍行距是什么意思:LaTeX 惯例还是 ms word?或者在最终报告之前向他们展示一个打印的章节样本以供批准。

正如您所知,该titlesec包将帮助您格式化标题。使用\titlespacing它可以控制前后空间。您应该添加一些负空间来抵消段落之间三倍间距的影响。

图表也可能出现类似的问题。

A

b

用此代码。

\documentclass [12pt, a4paper, twoside, openany]{report}
    
\usepackage{kantlipsum} % dummy text

\usepackage{titlesec} % added <<<<<<

\usepackage{setspace} % added <<<<<<
\doublespacing

%%%%%%%%%% chapters
\titleformat
{\chapter} % command to format
[display] % shape: hang, display, block, frame etc
{\normalfont\huge\bfseries\centering}  % format of label + chapter title
{\chaptertitlename\ \thechapter} % label "Chapter 1:"
{-2ex} % separation label - chapter title <<<<<<<<<<<<<<<<<<<<<
{} % code before

\titlespacing{\chapter}
{0pt} %left of the label + title
{-6ex plus .3ex minus .1ex } % vertical space before the title
{-1ex plus .1ex} % idem after title (in ex units + glue)


%%%%%%%%%%%%%%  sections
\titleformat{\section}
[block] % shape 
{\normalfont\large\bfseries}% format (keep the chapter font family!)
{\thesection.} % label "1.1."
{0.8ex}% separation label -  section title 
{}

\titlespacing{\section}
{0pt} %left of label + section title
{-5ex plus .3ex minus .1ex } % before the label + section title
{-5ex plus .1ex} % after 

%%%%%%%%%%%%%  subsections
\titleformat{\subsection}
[block] % shape 
{\normalfont\bfseries}% format (keep the chapter font family!)
{\thesubsection.} % label "1.1.1,"
{0.8ex}% separation label -  section title 
{}

\titlespacing{\subsection}
{0pt} %left of label + subsection title
{-5ex plus .3ex minus .1ex } % before the label + subsection title
{-5ex plus .1ex} % after 

\setlength{\parskip}{36pt} % added, triple space(?) <<<<<<<<<<<<<

\begin{document}
    
    \chapter{Computational Techniques}  
    1. \kant[1] 
    \section{Density functional theory}
    2. \kant[9]
    \subsection{Electron Density}
    3. \kant[3-5]   
 
\end{document}

相关内容