Forgot password
 Register account
View 272|Reply 2

请教怎么能让带圈数字ding在公式里不用加text?

[Copy link]

414

Threads

1641

Posts

15

Reputation

Show all posts

abababa posted 2023-6-1 16:33 |Read mode
如题,我定义了一个
  1. \newcommand\mynum[1]{\ding{\numexpr171+#1\relax}}
Copy the Code

这样用的时候,在非数学环境里用\mynum{1}就打出圈1了,但在数学环境里要加\text才行。我想既然已经自定义了,能不能直接让它适合两种环境,在数学环境和非数学环境里都打\mynum{1}就能正确显示?

673

Threads

110K

Posts

218

Reputation

Show all posts

kuing posted 2023-6-1 17:03
文本模式也允许用 \text ,所以直接加 \text 就行了
  1. \newcommand\mynum[1]{\text{\ding{\numexpr171+#1\relax}}}
Copy the Code

414

Threads

1641

Posts

15

Reputation

Show all posts

original poster abababa posted 2023-6-1 20:20
kuing 发表于 2023-6-1 17:03
文本模式也允许用 \text ,所以直接加 \text 就行了
原来如此,谢谢,这么简单。

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-20 05:43 GMT+8

Powered by Discuz!

Processed in 0.011309 seconds, 22 queries