如果您希望所有 \io 段落都以这种方式工作,并且仅在 PTXprint 输出中生效,那么,
是的,可以做到…… 这甚至并不太难,类似于以下未测试的代码:
\newcoutner\ioparnum
\def\ioparstart#1{#1.~} % How should it be formatted?
\sethook{start}{io}{\advance\ioparnum by 1 \leavevmode \ioparstart{\the\ioparnum}}
\sethook{after}{c}{\ioparnum=0 } % Reset each chapter, just in case
问题在于您现在正在寻找一些不寻常的情况。例如,如果某种外围部分有多个大纲,上述代码会继续计数…… 如果您能保证每个 \io 段落块之前都有一个 \is1,那么您可以使用 \setbetweenhook{is}{io}{\ioparnum=0 } 来执行重置,然后您又要寻找更多不寻常的情况。在某个时刻,您寻找意外情况所花的时间将与手动编号所花的时间一样多。
If you wanted all \io paragraphs to work in this way, and only in PTXprint output, then,
Yes, it can be done… It’s not even very hard, something along the lines of this untested code:
\newcoutner\ioparnum
\def\ioparstart#1{#1.~} % How should it be formatted?
\sethook{start}{io}{\advance\ioparnum by 1 \leavevmode \ioparstart{\the\ioparnum}}
\sethook{after}{c}{\ioparnum=0 } % Reset each chapter, just in case
The problem is you are now looking for unusual cases. E.g. if for some kind of periphery section there are multiple outlines, the above will just keep on counting… If you could guarantee that every block of \io paragraphs was preceded by an \is1 then you could use \setbetweenhook{is}{io}{\ioparnum=0 } to do the reset, and then you’re looking for even more unusual cases. At some point your searching out unexpected situations takes as much time as numbering them by hand.
机器翻译自 English