我正在努力阻止艾克斯隐含数字。我尝试将数字格式定义为不可见字符,但失败了,因为该字符似乎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
无关。aboveexskip
和belowexskip
起同样的作用,取消段落缩进,\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
可以简单地省略,注释就会被正确格式化。