csquotes 中 blockquotes 的行距

csquotes 中 blockquotes 的行距

我想用 csquotes 为我的 blockquote 设置单行间距。在 blockquote 之后,我想切换回使用 setspace 包设置的正常间距。我尝试了以下方法(参见关联):

\newenvironment*{singlespcquote}
{\quote\SingleSpacing}
 {\endquote}

\SetBlockEnvironment{singlespcquote}

但我只收到一条错误,指出该\SingleSpacing命令未知。

编辑:感谢 Bernard 的评论,我将其改为\SingleSpacing\singlespacing现在它工作正常。如果有人想测试它,我还添加了 MWE。

梅威瑟:

\documentclass{scrbook}
\usepackage{csquotes}
\usepackage{setspace}

\newenvironment*{singlespcquote}
    {\quote\singlespacing}
    {\endquote}

\SetBlockEnvironment{singlespcquote}

\begin{document}
\begin{spacing}{1.5}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
\blockquote{Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
nulla pariatur. Duis aute irure. dolor in reprehenderit in voluptate velit esse 
cillum dolore eu fugiat nulla pariatur} Duis aute irure dolor in reprehenderit 
in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Duis aute irure dolor in reprehenderit 
in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
\end{spacing}
\end{document}

答案1

举一个极端的例子来说明你可以做什么:

http://i.imgur.com/32ACwXI.png?1

环境打开的组解释了为什么这样做有效。发出命令时\begin{<environment>},在大多数情况下,您会打开一个具有本地化定义的组。行距就是这样一个定义,因此,当您发出命令时\begin{<environment>},声明将从此本地化为您的输入直到你再次发出\end{<environment>}命令,这将关闭该组。当该组关闭时,编译器再次遵循现有的定义你发出了\begin{<environment>}

在此示例中,在您(再次)打开spacing环境之前,您的行距为 5,然后您将间距声明为 1,此时该间距位于辅助命令\begin{spacing}\end{spacing}命令之间。您可以无限期地执行此操作,并且它也可以应用于文本(例如\textit{This is some text that is all italicized, \textrm{but now we're using the roman style for a little bit,} to then again go back to italicized text}.- 这使用相同的原理,但实际上不会打开新组*)。

* = 如果我错了请纠正我

\documentclass{scrbook}
\usepackage{csquotes}
\usepackage{setspace}

\newenvironment*{singlespcquote}
    {\begin{spacing}{1}\quote}
    {\endquote\end{spacing}}

\SetBlockEnvironment{singlespcquote}

\begin{document}
\begin{spacing}{5}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
\blockquote{Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
nulla pariatur. Duis aute irure. dolor in reprehenderit in voluptate velit esse 
cillum dolore eu fugiat nulla pariatur} Duis aute irure dolor in reprehenderit 
in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Duis aute irure dolor in reprehenderit 
in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
\end{spacing}
\end{document}

相关内容