banana-space / btex

MIT License
39 stars 3 forks source link

Separated theorem counters #37

Closed ldXiao closed 7 months ago

ldXiao commented 7 months ago

当用\newtheorem{exercise}{Exercise}这样的语法声明新的theorem环境时,默认生成新的独立计数器 当用\newtheorem{exercise}[theorem]{Exercise}时,两者共享同一个计数器

以上是LaTeX的默认行为

abccsss commented 7 months ago

这将影响大量现有文档,故不予采纳。另外 \newtheorem 并不是 LaTeX 自带的功能,btex 不必与之相符。

ldXiao commented 7 months ago

现有文档如此编号,不意味着独立编号的功能不应该存在

假如要维持现有文档不变,那我可以修改实现让\newtheorem{exercise}[exercise]{Exercise}首先寻找计数器\theexercise如果已经定义那么使用,否则使用\thetheorem

这样子用户在先声明\newcounter{exercise}的条件下可以使用我想要的功能,其余时候行为不变?

\newtheorem{}[]{}现有使用范围应该很小不会造成大范围影响