在环境中使用较小字体时减少行距

在环境中使用较小字体时减少行距

我正在排版在古腾堡计划中发现的一本短篇小说集,其中大多数故事都是由编辑的评论和/或历史注释介绍的。

在我看来,这些简介与故事的相关性较低,因此我决定将它们放在适当的环境中,并使用较小的字体排版

\documentclass[11pt]{memoir}
\chapterstyle{tandh}
\newenvironment{blurb}{\footnotesize}{\bigskip}
\begin{document}
\chapter{Charan}
\begin{blurb}
  Some think that love, strong, true, and self-sacrificing, is not to
  be found in the Orient; but the story of Charan, which comes down
  four hundred years and more, proves the contrary, for it still has
  the fresh, sweet flavour of a romance of yesterday; albeit the setting
  of the East provides an odd and interesting background.
\end{blurb}

In the days of King Sung-jong (A.D. 1488-1495) one of Korea's noted
men became governor of Pyong-an Province. Now Pyong-an stands first
of all the eight provinces in the attainments of erudition and polite
society. Many of her literati are good musicians, and show ability
in the affairs of State.
\end{document}

与类结合memoir,产生以下结果

查兰

正如您所看到的,简介中线条之间的距离太大,我已经尝试过\linespread(甚至是负值……)但没有任何变化。

另一方面,当我有一个长脚注时,我知道行距会适当减少……

如何才能减少我的环境中线条之间的距离以适应较小的字体?

答案1

我猜想环境是用于章节标题后的一些介绍性文字。

您漏掉了\par。如果您没有在结束环境形成的组之前结束段落,则在段落分成行之前会忘记\baselineskipset by的值,因此该值将是正常字体大小的值。\footnotesize\baselineskip

\documentclass[11pt]{memoir}
\chapterstyle{tandh}

\newenvironment{blurb}
  {\par\footnotesize}
  {\par\addvspace{\bigskipamount}}

\begin{document}

\chapter{Charan}

\begin{blurb}
  Some think that love, strong, true, and self-sacrificing, is not to
  be found in the Orient; but the story of Charan, which comes down
  four hundred years and more, proves the contrary, for it still has
  the fresh, sweet flavour of a romance of yesterday; albeit the setting
  of the East provides an odd and interesting background.
\end{blurb}

In the days of King Sung-jong (A.D. 1488-1495) one of Korea's noted
men became governor of Pyong-an Province. Now Pyong-an stands first
of all the eight provinces in the attainments of erudition and polite
society. Many of her literati are good musicians, and show ability
in the affairs of State.

\end{document}

在此处输入图片描述

答案2

如何在环境中更改行距

如果你查看包的源代码setspace,就会发现可以通过修改来改变行距\baselinestretch\baselinestretch。但是,如果您尝试按以下方式修改,这行不通

\begin{minipage}{\linewidth}
\renewcommand{\baselinestretch}{0.8}
Some think that love, strong, true, and self-sacrificing, is not to
  be found in the Orient; but the story of Charan, which comes down
  four hundred years and more, proves the contrary, for it still has
  the fresh, sweet flavour of a romance of yesterday; albeit the setting
  of the East provides an odd and interesting background.
\end{minipage}

为什么?答案是\par你在环境末尾缺少一个命令。也就是下面这个例子将正确修改行距。这也与命令相同\linespread:需要以 终止段落才能\par使修改生效。

\begin{minipage}{\linewidth}
\renewcommand{\baselinestretch}{0.8}
Some think that love, strong, true, and self-sacrificing, is not to
  be found in the Orient; but the story of Charan, which comes down
  four hundred years and more, proves the contrary, for it still has
  the fresh, sweet flavour of a romance of yesterday; albeit the setting
  of the East provides an odd and interesting background. 
\par
\end{minipage}

因此,您可以按如下方式重写环境。您可以更改0.8为所需的值。

\newenvironment{blurb}{\footnotesize\renewcommand{\baselinestretch}{0.8}}{\par\bigskip}

以编程方式设置行距

在下面的例子中,我定义了blurb*环境,它以字体大小命令作为参数。行距将由用户定义的数学表达式自动确定。

\documentclass[11pt]{memoir}
\usepackage{expl3}
\usepackage{xparse}

\chapterstyle{tandh}

\begin{document}


\makeatletter
\ExplSyntaxOn

% get base fontsize
\fp_new:N \l_base_fontsize_fp
\fp_set:Nn \l_base_fontsize_fp {\f@size}

\fp_new:N \l_now_fontsize_fp
\fp_new:N \l_new_baselinestretch_fp

% the command to compute new \baselinestretch based on
% base fontsize and current fontsize
\cs_new:Npn \__compute_baselinestretch {
    % set it to the sqrt of ratio between two fontsizes
    \fp_set:Nn \l_new_baselinestretch_fp { sqrt(\l_now_fontsize_fp / \l_base_fontsize_fp) }
}

\DeclareDocumentEnvironment{blurb*}{m}{
    \group_begin:
    #1
    % get current fontsize
    \fp_set:Nn \l_now_fontsize_fp {\f@size}
    % compute new \baselinestretch
    \__compute_baselinestretch
    % use new \baselinestretch
    \exp_args:NNx \renewcommand \baselinestretch {\fp_use:N \l_new_baselinestretch_fp}
    \selectfont
}{
    \par\group_end:\bigskip
}

\ExplSyntaxOff
\makeatother

\chapter{Charan}

\begin{blurb*}{\tiny}
Some think that love, strong, true, and self-sacrificing, is not to
  be found in the Orient; but the story of Charan, which comes down
  four hundred years and more, proves the contrary, for it still has
  the fresh, sweet flavour of a romance of yesterday; albeit the setting
  of the East provides an odd and interesting background.

\meaning\baselinestretch
\end{blurb*}

\begin{blurb*}{\footnotesize}
Some think that love, strong, true, and self-sacrificing, is not to
  be found in the Orient; but the story of Charan, which comes down
  four hundred years and more, proves the contrary, for it still has
  the fresh, sweet flavour of a romance of yesterday; albeit the setting
  of the East provides an odd and interesting background.

\meaning\baselinestretch
\end{blurb*}

\begin{blurb*}{\normalsize}
Some think that love, strong, true, and self-sacrificing, is not to
  be found in the Orient; but the story of Charan, which comes down
  four hundred years and more, proves the contrary, for it still has
  the fresh, sweet flavour of a romance of yesterday; albeit the setting
  of the East provides an odd and interesting background.

\meaning\baselinestretch
\end{blurb*}

\begin{blurb*}{\large}
Some think that love, strong, true, and self-sacrificing, is not to
  be found in the Orient; but the story of Charan, which comes down
  four hundred years and more, proves the contrary, for it still has
  the fresh, sweet flavour of a romance of yesterday; albeit the setting
  of the East provides an odd and interesting background.

\meaning\baselinestretch
\end{blurb*}


\end{document}

在此处输入图片描述

参考

答案3

\begin{Spacing}{factor}您可以使用...更改行距\end{Spacing},请参阅第 51 页回忆录课

例如以下代码

\documentclass[11pt]{memoir}
\chapterstyle{tandh}
\newenvironment{blurb}{\footnotesize}{\bigskip}
\begin{document}
\chapter{Charan}
\begin{blurb}
\begin{Spacing}{0.8}
  Some think that love, strong, true, and self-sacrificing, is not to
  be found in the Orient; but the story of Charan, which comes down
  four hundred years and more, proves the contrary, for it still has
  the fresh, sweet flavour of a romance of yesterday; albeit the setting
  of the East provides an odd and interesting background.
\end{Spacing}
\end{blurb}

In the days of King Sung-jong (A.D. 1488-1495) one of Korea's noted
men became governor of Pyong-an Province. Now Pyong-an stands first
of all the eight provinces in the attainments of erudition and polite
society. Many of her literati are good musicians, and show ability
in the affairs of State.
\end{document}

产生以下输出: 在此处输入图片描述

答案4

重塑\chapterprecis回忆录的命令?

\documentclass[11pt]{memoir}
\chapterstyle{tandh}
\begin{document}
\tableofcontents
\chapter{Charan}
\chapterprecis{% also in toc 
  Some think that love, strong, true, and self-sacrificing, is not to
  be found in the Orient; but the story of Charan, which comes down
  four hundred years and more, proves the contrary, for it ...}
In the days of King Sung-jong (A.D. 1488-1495) one of Korea's noted
men became governor of Pyong-an Province. 
\end{document}

但如果你对它的外观很挑剔......

\documentclass[11pt]{memoir}
\chapterstyle{tandh}
\setlength{\prechapterprecisshift}{-1\baselineskip}
\renewcommand*{\precisfont}{\slshape\bgroup\footnotesize\sffamily}
\renewcommand{\prechapterprecis}{
\bgroup\vspace*{\prechapterprecisshift}\par\precisfont}
\renewcommand{\postchapterprecis}{\par\egroup\bigskip}
\begin{document}
\mainmatter
\tableofcontents
\mainmatter
\chapter{Charan}
\chapterprecishere{ % only in text
  Some think that love, strong, true, and self-sacrificing, is not to
  be found in the Orient; but the story of Charan, which comes down
  four hundred years and more, proves the contrary, for it .....}
In the days of King Sung-jong (A.D. 1488-1495) one of Korea's noted
men became governor of Pyong-an Province. 
\end{document}

相关内容