删除示例中的垂直空格(Linguex)

删除示例中的垂直空格(Linguex)

我使用该linguex包对我的示例进行编号。我希望每个示例后都有一个引用,在下一行右对齐。这是我的代码

\documentclass [a4paper, 12 pt]{memoir}

\usepackage[cyr]{aeguill}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}

\usepackage[francais]{babel}

\usepackage{linguex}

\begin{document}

\ex. This is an example that is too long for me to use the hfill-command. This is an example that is too long for me to use the hfill-command This is an example that is too long for me to use the hfill-command   \begin{flushright}(Reference 2014)\end{flushright}

\ex. This is an example that is too long for me to use the hfill-command This is an example that is too long for me to use the hfill-command This is an example that is too long for me to use the hfill-command \begin{flushright}(Reference 2014b)\end{flushright}

\end{document}

问题是示例之间的引用与前面和后面的示例之间的距离相等。我希望引用遵循示例,没有额外的垂直空间,这样唯一增加的空间就是示例之间。

我曾尝试使用\raggedright而不是flushright,但问题仍然存在。

最好的,克里斯汀

答案1

在环境内添加一些负垂直空间flushright应该可以解决问题。

就像是:

\begin{flushright}\vspace*{-.65\baselineskip}(Reference 2014)\end{flushright}

梅威瑟:

\documentclass [a4paper, 12 pt]{memoir}

\usepackage[cyr]{aeguill}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}

\usepackage[francais]{babel}

\usepackage{linguex}

\begin{document}

\ex. This is an example that is too long for me to use the hfill-command 
This is an example that is too long for me to use the hfill-command 
This is an example that is too long for me to use the hfill-command 
\begin{flushright}\vspace*{-.65\baselineskip}(Reference 2014)\end{flushright}

\ex. This is an example that is too long for me to use the hfill-command 
This is an example that is too long for me to use the hfill-command 
This is an example that is too long for me to use the hfill-command 
\begin{flushright}\vspace*{-.65\baselineskip}(Reference 2014b)\end{flushright}

\end{document} 

输出:

在此处输入图片描述

顺便说一下,“命令形式”是flushright\raggedleftnot \raggedright


编辑

最好的办法是定义一个新命令,比如说\flushfill,当有足够空间时,该命令能够填充该行,否则它必须在下一行中刷新文本。

按照本文描述的技巧回答大卫·卡莱尔,我们可以定义:

\newcommand{\flushfill}[1]{\hspace{\fill}\mbox{}\linebreak[0]\hspace*{\fill}\mbox{#1}}

并按如下方式使用:

\documentclass [a4paper, 12 pt]{memoir}

\usepackage[cyr]{aeguill}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}

\usepackage[francais]{babel}

\usepackage{linguex}

\newcommand{\flushfill}[1]{\hspace{\fill}\mbox{}\linebreak[0]\hspace*{\fill}\mbox{#1}}

\begin{document} 

\ex. This is an example that is too long for me to use the hfill-command
This is an example that is too long for me to use the hfill-command
This is an example that is too long 
\flushfill{(Reference 2014)}

\ex. This is an example that is too long for me to use the hfill-command
This is an example that is too long for me to use the hfill-command
This is an example that is too long for me to use the
\flushfill{(Reference 2014a)}

\ex. This is an example that is too long for me to use the hfill-command
This is an example that is too long for me to use the hfill-command
This is an example that is too long for me to use the hfill-command
\flushfill{(Reference 2014b)}

\end{document} 

输出:

在此处输入图片描述

相关内容