pku-typst / pkuthss-typst

Typst template for dissertations in Peking University (PKU).
MIT License
81 stars 16 forks source link

无法正确处理空目录导致数学公式序号出错 #7

Closed TeddyHuang-00 closed 1 year ago

TeddyHuang-00 commented 1 year ago

如题,当附录为空时,此处逻辑会进入 else 分支 https://github.com/lucifer1004/pkuthss-typst/blob/5009798cc83b597a2293b08a8ea733e54f2eb0c6/template.typ#L475-L479

然后(我也不理解为什么)会报一个错:array is empty,指向 chaptercounter.at(loc).first() ,导致无法编译

奇怪的是同样的逻辑处理图片的序号就没问题,猜测可能是一个更上游的问题,不知道能不能绕过这个错误

TeddyHuang-00 commented 1 year ago

一个猜想是和typst编译时候的处理顺序有关,可能是数学公式的处理比较靠前,才导致的这个问题

lucifer1004 commented 1 year ago

附录为空具体是指?我这边没复现出来

TeddyHuang-00 commented 1 year ago

不好意思可能没表示清楚,就是只保留了#appendix()但是此后不包含一级标题的时候就会报错,如果把 #appendix 也一起去掉就没事,不是会影响使用的bug就是了