a/LaTeX 中的替代品
我想知道是否有一个可以在乳胶中使用的条件命令(例如,\ifthenelse),它允许我在一种情况下使用单词“a”,而在另一种情况下根据是否使用单词“an”或者以下单词不是以元音开头。
I was wondering if there is a conditional command that I can use in latex (e.g., \ifthenelse) that would allow me to, in one case, use the word 'a' and in another use the word 'an' based on the whether or not the following word starts with a vowel.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这通常不起作用,因为使用 a 或 an 的决定不是机械地基于文章后面的字母,而是基于其发音。因此,“叔叔”,而是“一所大学”和“一种荣誉”。
This won't work in general, because the decision to use a or an is based, not mechanically on the letter that follows the article, but on its pronunciation. Thus 'an uncle', but 'a university' and 'an honour'.
TeX 提供了一个简单的 \if 来比较字母。以下内容将起作用,除非您执行类似 \AOrAn \myapplecommand 的操作,这会产生意外的结果。
您无法像这样手动强制执行“an”,但您应该能够通过编写 \AOrAn {}university 来抑制它。
(编辑以考虑特殊情况的评论。)
TeX provides a plain \if that compares letters. The following will work, unless you do something like \AOrAn \myapplecommand, which will give unexpected results.
You cannot manually enforce an "an" like this, but you should be able to suppress it by writing \AOrAn {}university.
(Edited to take remark re exceptional cases into account.)
这里提供了一些在 Latex 中使用条件的示例。
Here you have some examples to use conditionals in Latex.