ExPex - 隐藏示例号码

ExPex - 隐藏示例号码

我正在努力阻止艾克斯隐含数字。我尝试将数字格式定义为不可见字符,但失败了,因为该字符似乎X必须存在于格式字符串中。还有其他方法可以完全隐藏数字吗?

我的尝试:

\ex[exnoformat=\hphantom]
\begingl
\gla Something here//
\glc The gloss//
\glft ‘Something here’//
\endgl
\xe

答案1

确实,您可以使用 创建一个未编号的示例,\begingl...\endgl而无需在周围添加\ex...\xe。但是,您不会像使用编号示例那样在其周围获得额外的垂直空间。您也无法向其传递任何示例级样式命令,并且您想要应用于所有示例(使用\lingeveryex\lingEveryex)的任何全局命令都不会应用于它。

expex软件包提供了一个命令\exdisplay,当您想要一个未编号的示例时,可以使用该命令代替\ex,该示例的作用类似于普通示例,只是它没有编号或缩进。这是文档在第 71 页上对此的说明(这有点埋在关于纯 TeX 表格的部分中,大多数 LaTeX 用户都不会费心阅读):

与 类似\ex\exdisplay必须以 结束\xe\exdisplay...\xe类似于,只是\ex...\xe不打印示例编号,并且水平尺寸\numoffset\textoffset无关。aboveexskipbelowexskip起同样的作用,取消段落缩进,\lingeveryex\lingEveryex执行,并\excnt前进。

\noexno是为防止用户想要使用\exdisplay除编号示例之外的其他东西而提供的。它取消 的自动前进\excnt。您可以说\exdisplay\noexno\exdisplay[...]\noexno来取消\excnt前进。

以下是其工作原理的说明,以便您了解省略\ex...\xe和使用之间的区别\exdisplay...\xe。您可以决定哪一个更适合您的需求。

\documentclass{article}

\usepackage{expex}

\begin{document}
    
Here's an example without a surrounding \verb|\ex...\xe| environment. Notice the lack of vertical space before and after:

\begingl % this works, but you are missing the vertical space you typically get with \ex
\gla Something here//
\glb The gloss//
\glft `Something here'//
\endgl

When you put a normal numbered example using \verb|\ex...\xe| after unnumbered ones that only have \verb|\begingl...\endgl|, the numbers start at the beginning because the \verb|\excnt| count has not been incremented:

\ex % this is (1) and not (2) because the \excnt count does not advance when you use \begingl / \endgl without a surrounding environment
\begingl
\gla Something here//
\glb The gloss//
\glft `Something here'//
\endgl
\xe

Here's an unnumbered example with \verb|\exdisplay...\xe|. Notice that the vertical space surrounding the example is maintained.

\exdisplay % includes the spacing above and below a normal \ex, but without the numbered label; it also advances the \excnt, unless you use \noexno
\begingl
\gla Something here//
\glc The gloss//
\glft `Something here'//
\endgl
\xe
    
When you put a normal numbered example using \verb|\ex...\xe| after unnumbered ones that with \verb|\exdisplay...\endgl|, the number may be higher than you expect because the \verb|\excnt| count is incremented by \verb|\exdisplay| unless you put \verb|\noexno| inside the example.

\ex % this is numbered (3) instead of (2) because \exdisplay advanced the \excnt; use \noexno if you want your unnumbered examples to not advance the \excnt count
\begingl
\gla Something here//
\glb The gloss//
\glft `Something here'//
\endgl
\xe

\end{document}

在此处输入图片描述

答案2

我搞明白了 -\ex命令提供了数字。它和结尾的\xe可以简单地省略,注释就会被正确格式化。

相关内容