為了稍微反駁一下 Martin,腳本可能可以修改以給出接近的結果。不過,我不確定它具體會如何顯示。如果您讓它說:
if ($v ne $verse) {
$verse=$v;
print "\\x - \\xo $v\\*";
}
那麼,類似於您獲得一個顯示 Chapter X 的空腳註,您將獲得一個顯示 Y 的空腳註(在節 Y 的第一個腳註上),然後是該節中第一個腳註的其餘部分。其他腳註將不會有章節或節號。但是您需要開啟分段註釋(paragraphed notes),並且可能需要更改一些內容,例如腳註間距(我想不起它叫什麼了,但我認為現在它在用戶界面中)。一旦您開啟了分段註釋,除非您在 perl 輸出的內容中包含一些原始 TeX 命令,否則您不會看到節 Y 單獨佔一行。(在節 Y 的腳註內容前綴 \penalty -10000\space 可能就足夠了)。
很可能,在這個練習的某個階段,這樣取巧的做法會達到其極限,此時要么 Martin 的答案將成為正確的做法,要么需要對 TeX 代碼進行非常顯著的更改(這可能會破壞其他人的項目)。
在 TeX 方面,您需要「劫持」 \xo 宏,讓它在進入輸出流之前將章節:節參數解釋為值,然後在 TeX 中進行比較和輸出重定義。危險在於,如果有人有一個 \xo 並非總是後跟 chapter:verse,而是 chapter.verse 或類似格式,代碼會給出奇怪且預料不到的錯誤。
在 TeX 中定義健壯的宏是很困難的,而且沒有標準定義人們會在 \xo 中放入什麼(也沒有保證他們只在交叉引用中使用它!)。
再想想,實際上最好定義一個帶有定義終止符的自定義宏,該宏進而解析為 \xo,而不是劫持 \xo。
例如 \def\zmyxrefstyle#1:#2\*{comparisonde} 來設置被引用標記的前綴。
當然,您仍然必須讓腳註引用標記生成器代碼在被引用標記之前放置章節號和/或節號。我猜測這至少需要半週的編程和除錯,但可能還有我忘記的事情會將其推遲到一週或三週。
除非有多個用戶非常明確地要求,否則我們不太可能在未來一年內找到時間來做這件事。
To contradict Martin (slightly), the script can probably be modified to give you something close. I’m not sure exactly how it’ll display, though. If you make it say:
if ($v ne $verse) {
$verse=$v;
print "\\x - \\xo $v\\*";
}
Then similar to how you get an empty footnote saying Chapter X, you’ll then get an empty footnote saying Y (at the first footnote on verse Y) and then the rest of the 1st footnote in that verse. Other footnotes won’t have a chapter or a verse number. BUT you will need to turn on paragraphed notes and probably need to alter some things like the inter-footnote spacing (I can’t remember what it’s called, but I think it’s in the user interface now). Once you’ve turned on paragraphed notes, you won’t be getting verse Y on its own line, unless you include some raw TeX commands in what the perl is spitting out. (prefixing the footnote contents for verse Y with \penalty -10000\space might be sufficient).
Probably, at some point in this exercise, then fudging it like this will reach its limits, and either Martin’s answer will become the right way to do it, or very significant changes to the TeX code (which would probably break other people’s projects) will be needed.
On the TeX side of things, you’d need to ‘hijack’ the \xo macro and make it interpret the chapter:verse parameters as values, before they enter the output stream, and then do the comparison and output redefinition in TeX. The danger is that if anyone had an \xo that wasn’t always followed by chapter:verse, and instead had chapter.verse or similar, the code would give strange and unexpected errors.
Defining robust macros in TeX is hard, and there is no standard that defines what people will put in \xo (nor a guarantee they only use it in cross-references!).
Thinking about it a bit more, it’d actually be far better to define your own macro with a defined terminator, that in turn resolved to \xo, rather than hijacking \xo.
e.g. \def\zmyxrefstyle#1:#2\*{comparisonde} to set any prefixes to the callee.
Of course, you’d still have to make the footnote caller generator code put the chapter number and / or verse number before the callee. I’m guessing it would take about a half a week of programming and debugging at the least, but there may be things I’ve forgotten that would push it unto a week or 3.
Without a very clear call from multiple users, it is unlikely that we will find the time to do this any time in the next year.
機器翻譯自 English