如果您希望所有 \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