为了反驳 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