gb4e 示例之前和之后的额外间距

gb4e 示例之前和之后的额外间距

我正在使用gb4e包。当我有一个示例列表时,在散文之后和第一个枚举项之前有一个很大的跳跃。我不希望那里有跳跃;相反,我希望那里有双倍行距,就像整个文档一样。列表结束后,我还希望在最后一个例子和它下面的其余散文之间有双倍行距。

\documentclass[12pt]{article}
\usepackage[margin=1in, left=1.25in, right=1.25in]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\rhead{Name \thepage}
\cfoot{}
\usepackage{setspace}
\doublespacing
\usepackage{geometry}
\usepackage{url}
\usepackage{gb4e}


\begin{document}

Some prose goes here and goes on for a while.  The spacing, as you can see, is double, but the space between the prose and the items below is more than double.  It should not be.
\begingroup
\singlespace{
\begin{exe}[nosep]
\ex xyz
\ex xyz
\end{exe} 
}
\endgroup

The prose resumes here and goes on for a while.  Again, the spacing is double, as it should be.

\end{document}

答案1

附加\singlespacing到每个环境的启动代码exe

\documentclass[12pt]{article}
\usepackage[margin=1in, left=1.25in, right=1.25in,headheight=14.5pt]{geometry}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{url}
\usepackage{gb4e}
\usepackage{etoolbox}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyhead[R]{Name \thepage}

\doublespacing

\makeatletter
\apptocmd{\@exe}{\singlespacing}{}{}
\makeatother

\begin{document}

Some prose goes here and goes on for a while.  The spacing, as you can see, is double, but 
the space between the prose and the items below is more than double.  It should not be.
\begin{exe}
\ex xyz
\ex xyz
\end{exe} 
The prose resumes here and goes on for a while.  Again, the spacing is double, as it should be.

\end{document}

我还对您的代码进行了一些修复:您缺少正确的头部高度设置,并且还混淆了包加载和设置命令。请注意\fancyhf{}清除页眉和页脚中的所有字段。

在此处输入图片描述

答案2

你可以把它放在\singlespacing里面\begin{exe},这样效果就是局部的

\documentclass[12pt]{article}
\usepackage[margin=1in, left=1.25in, right=1.25in,headheight=16pt]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\rhead{Name \thepage}
\cfoot{}
\usepackage{setspace}
\doublespacing
\usepackage{geometry}
\usepackage{url}
\usepackage{gb4e}

\begin{document}

Some prose goes here and goes on for a while.  The spacing, as you can see, is double, but the space between the prose and the items below is more than double.  It should not be.
%
\begin{exe}
\singlespacing
\ex xyz
\ex xyz
\end{exe}
%
The prose resumes here and goes on for a while.  Again, the spacing is double, as it should be.

\end{document}

在此处输入图片描述

我还修改了头部高度,只是为了消除警告。

相关内容