Forgot password?
 Register account
View 275|Reply 3

exam.cls 题目留空时,编号缩进的问题

[Copy link]

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2025-3-4 03:36 |Read mode
exam.cls 题目留空时,只写solution,则编号缩进有问题:
  1. \documentclass[answers]{exam}
  2. \begin{document}
  3. \begin{questions}
  4. \question foobar
  5. \begin{solution}
  6. solution to q1
  7. \end{solution}
  8. \question
  9. \begin{solution}
  10. solution to q2
  11. \end{solution}
  12. \question foobar
  13. \begin{solution}
  14. solution to q3
  15. \end{solution}
  16. \end{questions}
  17. \end{document}
Copy the Code
如何使第二个 \question 的编号保持相同的缩进?

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

 Author| hbghlyj Posted 2025-3-4 03:41
如果改为
  1. \question\
Copy the Code
会多出一个空行。

如何使第二个 \question 的编号保持相同的缩进,且不多出空行?

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

kuing Posted 2025-3-4 15:08
怎么会没题目就有解答呢?人家压根没想过会像你这样用啊,真需要这样的就自定义一个命令或环境来写吧。

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

 Author| hbghlyj Posted 2025-3-5 05:23
kuing 发表于 2025-3-4 07:08
真需要这样的就自定义一个命令或环境来写吧
我用
  1. \question\fbox{\makebox[\textwidth][l]{solution to q2}}
Copy the Code
但是宽度 \textwidth 不对

怎样才能与 solution 环境的宽度相等呢

Mobile version|Discuz Math Forum

2025-6-4 17:17 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit