转义 TeX 方程中的字符?

发布于 2024-07-14 02:26:55 字数 61 浏览 4 评论 0 原文

我想在 TeX 方程中使用包含破折号的变量名。 然而,破折号被解释为负号。 有人知道如何逃脱这个角色吗?

I want to use a variable name containing dash in TeX equation. However, dash gets interpreted as minus sign. Anyone any idea of how to escape the character?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

倾城花音 2024-07-21 02:26:55

使用 \textrm{-} 不起作用?

Using \textrm{-} does not work ?

错々过的事 2024-07-21 02:26:55

将整个变量名称放在 \text 中。

或者更好的是,为使用 \text 的变量名称创建一个宏。 使用宏将帮助您获得统一的样式,以后可以轻松更改。

Put the whole variable name inside \text.

Or better, make a macro for variable names which uses \text. Using a macro will help you get a uniform style that you can easily change later.

悍妇囚夫 2024-07-21 02:26:55

在 TeX 方程中输入 \hbox{-}。 它的编译速度比 \text{-} 更快。

Type \hbox{-} in TeX equation. It is faster to compile than \text{-}.

雾里花 2024-07-21 02:26:55

推杆

<代码>\catcode`\-=11

作为等式范围内的第一个声明将使 - 变成普通字母字符。

Putting

\catcode`\-=11

as the first declaration in the scope of the equation will make - into a normal letter character.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文