https://bugs.documentfoundation.org/show_bug.cgi?id=167851
ajlittoz <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW --- Comment #6 from ajlittoz <[email protected]> --- (In reply to Mike Kaganski from comment #1) > Clarification for expected / actual observations: > … > Page 4 shows unexpected value for header: 5 (author expectation is 4). This > might need discussion; ajlittoz explains that as "if only one variable > occurs in the middle of the paragraph, we get this value, which is not the > value in effect at start of paragraph". I don't have a personal view on this > - i.e., I can see both the "Only use field, when it's the first element in > the first paragraph" idea, as well as "use the first occurrence in the first > paragraph". Technically, the latter is easier. … > Setting to NEEDINFO: please provide arguments for page 4 expectation. My expectation for header information retrieval is header reports value defined by the context at beginning of page. Since "beginning of page" is ambiguous, I'll compare to the heading case available through _Chapter_ field. The first paragraph is taken into account. But is position at left of first character inside or not the first paragraph? If we consider it outside the paragraph, we get the the same context as the one at bottom of left page, i.e. the heading does not exist yet. So "first" position of page must definitely be considered inside the paragraph. However, this is not sufficient. Scanning the paragraph is necessary to get the number induced by the list style. So, in case of variable, we must also access paragraph contents. If the variable is located at the very beginning of the paragraph, we're done. However, if the variable reference is located further inside the paragraph (there is untagged text before the variable), there are two possibilities. A) Either author really wants the state at beginning of paragraph, then we must retrieve the state of the variable before its change, i.e. same value as at bottom of previous page. This case can be considered equivalent the the heading case. Suppose we have a short, say 2-3 lines, narrative paragraph, then a heading. The present implementation returns the heading number controlling the narrative paragraph (according to "first paragraph only sccan" principle), though many authors would prefer to show the first "explicit" heading of the page, i.e the one set by the second paragraph. This is presently ruled out, likely for performance reason. B) Alternatively, with a paragraph scan (necessary at bottom of page to retrieve the LAST variable value), we can get the first variable change, be it in first position or not. I think there is no general agreement on the choice between A and B. Even the same author may prefer one of them depending on circumstances. For example, if text is short before the variable change, say up to a line and a half, B was be chosen. But if the paragraph is rather long, with variable change near the end of the paragraph, option A is preferred because most of the paragraph is tagged with the value coming from previous page. For consistency with heading case, I suggest to retain option A. Proposing choice to user between A and B would be a must, but it is more urgent to fix the bug. Anyway, IMHO, different algorithms are needed for header and footer instead of a single one as presently. -- You are receiving this mail because: You are the assignee for the bug.
