Uwe Lück <[log in to unmask]> writes: > Dear Erik Luijten, > > At 01:00 16.04.05, Erik Luijten wrote: >>2. As a physicist, I frequently use the widely-used package "revtex". I >>found that this breaks lineno completely (both version 3 and version 4). I >>was wondering whether there is a chance that lineno.sty can be made >>compatible with revtex? > > This is due to a mistake in revtex's way of changing the output routine. > After a \newtoks\output, the new output routine invokes \the\output, > it should use a private string instead (\let\rev@output\output ...). > lineno.sty tries the same trick, but due to revtex's \the\output, > lineno's output routine is entirely ignored. > > This was pointed out by David Kastrup recently. I had made the > mistake myself, and so has lineno.sty done up to now. David Kastrup > called it a "standard mistake", I wondered who made it else, now > I find it funny to see another instance. Perhaps the most glaring instance: latex.ltx \let\frozen@everymath\everymath \let\frozen@everydisplay\everydisplay \newtoks\everymath \newtoks\everydisplay \frozen@everymath = {\check@mathfonts \the\everymath} \frozen@everydisplay = {\check@mathfonts \the\everydisplay} I have reported this as a bug several years ago, IIRC including examples of stuff that breaks because of this. I think it was more or less declined to fix this because of "bug compatibility". If you take a look at amsmath.sty, it sometimes uses \everymath and \everydisplay, sometimes \frozen@everymath and \[log in to unmask] The resulting code is rather opaque, and it is hard to imagine that it can be both correct and _recognizable_ as correct. All of this would be unnecessary if latex.ltx redirected the hooks in the proper manner described. > "Mistake" may be inappropriate, but David Kastrup's proposal is > a helpful convention. A programming practise that will break if anybody else will use it too, is a mistake. Call it a violation of a programmer's "Kategorischer Imperativ". You can see that as a result amsmath.sty broke in several places, and a fragile pseudofix has been applied at those places that actually triggered a bug report up to now. I think "mistake" is quite appropriate to characterize such coding practices. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum