View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000807 | luatex | luatex bug | public | 2013-02-16 14:05 | 2015-10-21 11:56 |
Reporter | Taco | Assigned To | Hans Hagen | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Summary | 0000807: Bad position equation number Lualatex | ||||
Description | As reported here: http://tex.stackexchange.com/questions/97819/bad-position-equation-number-lualatex | ||||
Steps To Reproduce | \hsize=2cm $$a^2+b^2=c^2\eqno(1)$$ \bye Ouput after compilation with luatex: eqno in the left (should be on the right). | ||||
Additional Information | Hendrik Vogt's analysis: This appears to be a bug in the LuaTeX engine, see below. For a workaround, use align instead of equation; the align environment doesn't rely on the TeX engine for placement of the equation number. This fixes your problem (but can influence the vertical spacing for shorter equations). I think I could locate the bug in texmath.w, lines 2220 to 2225. There it says if ((eqno_box != null) && (eqno_w == 0) && !l) { tail_append(new_penalty(inf_penalty)); shift_amount(eqno_box) = line_s; append_to_vlist(eqno_box); g2 = 0; } Of interest is the third line: the shift amount of the box containing the equation number is line_s, which previously was set to \displayindent (which usually is zero). Thus, the equation number is flush left. Here's the corresponding lines from Knuth's tex.web, lines 22580 to 22585: if (a<>null)and(e=0)and not l then begin tail_append(new_penalty(inf_penalty)); shift_amount(a):=s+z-width(a); append_to_vlist(a); g2:=0; end; You can see that this is the very same code in a different language, eqno_box != null translates to a<>null, and so on. Here, the shift amount of the box containing the equation number is s+z-width(a), where s is the same as line_s above, z is the line width and width(a), well, the width of the box a with the equation number. And this is the correct shift amount for having the equation number flush right! Maybe I should explain the conditions in the first line of the code: the box with the equation number should be non-empty, it should have width 0(!), and we shouldn't be in the case of a left equation number as in \leqno. And why the width 0? This is the "flag" that was set before to indicate that the box should be placed in the next line because it didn't fit into the line with the equation. | ||||
Tags | No tags attached. | ||||
|
It should be partially fixed in trunk, rev. 5244 |
|
And again fixed a bit better for r2l cases. A few node mem leaks were fixed too, as well as prev links. |
|
there has been fixes to the eqno placement so it looks ok now |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-02-16 14:05 | Taco | New Issue | |
2015-05-15 19:05 | luigi scarso | Note Added: 0001375 | |
2015-05-21 13:41 | Hans Hagen | Note Added: 0001381 | |
2015-10-21 11:56 | Hans Hagen | Note Added: 0001456 | |
2015-10-21 11:56 | Hans Hagen | Status | new => closed |
2015-10-21 11:56 | Hans Hagen | Assigned To | => Hans Hagen |
2015-10-21 11:56 | Hans Hagen | Resolution | open => fixed |