Bug 105628 - Change "Evaluate" to "Show" in the Entries tab of Table of Contents/Index dialog, when Chapter Number is selected
Summary: Change "Evaluate" to "Show" in the Entries tab of Table of Contents/Index dia...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.2.4.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL: https://help.libreoffice.org/7.1/en-U...
Whiteboard: target:7.6.0
Keywords:
Depends on: Clarify-Chapter-Heading-Outline-Level
Blocks: TableofContents-Indexes-Dialog
  Show dependency treegraph
 
Reported: 2017-01-30 22:52 UTC by Lee
Modified: 2023-02-21 23:51 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Older document, TOC OK until you tinker (delete/put back) with E# field in TOC (19.11 KB, application/vnd.oasis.opendocument.text)
2017-01-30 23:06 UTC, Lee
Details
New document, can't get page numbers right in TOC (chapter number missing on head2 pages) (10.22 KB, application/vnd.oasis.opendocument.text)
2017-01-30 23:08 UTC, Lee
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lee 2017-01-30 22:52:28 UTC
Description:
For a document which is page numbered by chapter ie 1-1,1-2,1-3,2-1,2-2 ... The TOC cannot be made to show the chapter number.  Anything below a chapter heading (h1 level) treats the E# element as nothing.

This use to work.  Previous documents do have this and it continues to work HOWEVER, if you were the delete the E# element in one of the TOC level entries and reinsert it, it would loose the chapter number for that level TOC.

Attached is an example of an older format document, which works. Taking out an E# element in the TOC would cause that level to no longer work.  New documents cannot be made to have a working E# (chapter number) in the TOC entries other than heading level 1.

Steps to Reproduce:
1.Create a document with several levels of heading
2.In tools->outline->numbering, set level one to use numbers (1,2,3)
3.Set each chapter (heading 1) to begin on a page by inserting a page break.  Be sure to specify a style (default will do) and reset page number when generating the page break
4. In the footer, set the page number to be chapter number hyphen page number
5. Create the TOC - it is here you cannot make the proper page numbers appear because the chapter entity (E#) is blank for all but the heading level 1.
----------------------------------
Using the document attached of which the TOC comes from a document created on either an early 5.0 or maybe a 4. version, the TOC works until you edit the TOC to remove chapter entity then put it back.  The entity that is put back is no good, even though it is the same thing as the entity just removed.

Actual Results:  
TOC as follows

Fish........................1-1
   Salmon....................-4
   Cod.......................-6
Bird........................2-1
   Robin.....................-3
   Turkey....................-6
   Goose.....................-8
Reptile.....................3-1
   Cobra.....................-4
   Dragon....................-9



Expected Results:
Fish........................1-1
   Salmon...................1-4
   Cod......................1-6
Bird........................2-1
   Robin....................2-3
   Turkey...................2-6
   Goose....................2-8
Reptile.....................3-1
   Cobra....................3-4
   Dragon...................3-9


Reproducible: Always

User Profile Reset: No
I did try it on Ubuntu and XP, using LibreOffice 5.2.4.2.  In away, they are different UserProfiles since, they aren't even the same computer.

Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0
Comment 1 Lee 2017-01-30 23:06:42 UTC
Created attachment 130777 [details]
Older document, TOC OK until you tinker (delete/put back) with E# field in TOC
Comment 2 Lee 2017-01-30 23:08:51 UTC
Created attachment 130778 [details]
New document, can't get page numbers right in TOC (chapter number missing on head2 pages)
Comment 3 Lee 2017-02-01 04:16:34 UTC
At some point in the past, LibreOffice writer worked correctly
That is, chapter-page format TOC could be created.
Taking a guess as to when this started, I got LO 5.0.0.2
from documentfoundation.org/libreoffice/old.  The bug is also 
present at that level
Comment 4 Lee 2017-02-02 03:23:47 UTC
There is a way to generate a Table of Contents (TOC) with page numbering by chapter. It was difficult to find the sequence that produces the desired result. It is as follows:
  
Insert a Table of Contents. Then edit that TOC.  For each of the levels, make the following changes just before the page number field (in the blank area)
1. Add the chapter number field
2. In the blank area between the E# and #, place a hyphen
3. (this is the part that is not well documented.) Select the E# field just entered.  Change the field "Evaluate up to level:" make the value a 1.

Since there is a way to create a TOC with page numbers by chapter, it remains for someone with an understanding of the architecture to determine if this is the intended solution.
Comment 5 Buovjaga 2017-02-06 09:17:09 UTC
(In reply to Lee from comment #4)
> There is a way to generate a Table of Contents (TOC) with page numbering by
> chapter. It was difficult to find the sequence that produces the desired
> result. It is as follows:
>   
> Insert a Table of Contents. Then edit that TOC.  For each of the levels,
> make the following changes just before the page number field (in the blank
> area)
> 1. Add the chapter number field
> 2. In the blank area between the E# and #, place a hyphen
> 3. (this is the part that is not well documented.) Select the E# field just
> entered.  Change the field "Evaluate up to level:" make the value a 1.
> 
> Since there is a way to create a TOC with page numbers by chapter, it
> remains for someone with an understanding of the architecture to determine
> if this is the intended solution.

Do you think this should be changed to be a documentation issue?
Do you think the UI should also be changed to make discovery easier?
I think the design team have the ToC dialog on their list of thing to revamp. They have created this Google Summer of Code idea: https://wiki.documentfoundation.org/Development/GSoC/Ideas#Table_of_Contents:_Entries_tab
Comment 6 Lee 2017-02-07 02:11:41 UTC
Some sort of documentation addition should be made explaining how to create a TOC with page numbering by chapter. Looking back, it would have been easier for the writing community to grasp a different approach to generating the TOC.  

Changing the approach at this point would introduce confusion or perhaps break documents written prior to the change.  A documentation change is preferable to a code change that might cause failure in existing documents that depend upon the current technique.
Comment 7 Lee 2017-02-12 17:20:53 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2017-02-12 17:35:15 UTC
(In reply to Lee from comment #7)
> Any idea how to get hold of the group that controls the LibreOffice Wiki or
> perhaps the user guide?  I'd be happy to create a write up on the technique
> to generate a TOC with numbering by Chapter.

http://documentation.libreoffice.org/en/join-community/

I am also on #libreoffice-doc IRC channel, when I am online. Olivier Hallot is the documentation leader.
Comment 9 Heiko Tietze 2017-02-18 11:41:05 UTC
Pretty sure this question was asked before. ToC/Index related tickets are aggregated in bug 89606.
Comment 10 Lee 2017-02-19 03:50:08 UTC
Bug 89606 is a summation of several issues.  This was a specific issue. 

It is possible to generate a TOC where page numbers are reset at the chapter level.  To accomplish generating a TOC in such a document is obscure. 

If my registration into the LibreOffice Wiki could get complete, I'd be willing to write an explanation of how to accomplish this.  Unfortunately, I have been unable to get the required confirmation email associated with setting up an ID on the LibreOffice Wiki.

Once a technique for TOC with page numbers by chapter is explained somewhere in the LibreOffice documentation, this issue could be marked resolved.
Comment 11 Lee 2018-10-09 01:33:46 UTC Comment hidden (no-value)
Comment 12 Lee 2018-10-09 01:45:03 UTC
The bug, and workaround are also applicable to Alphabetic indexes
Comment 13 Timur 2020-08-02 13:05:19 UTC
(In reply to Lee from comment #4)
> 3. (this is the part that is not well documented.) Select the E# field just
> entered.  Change the field "Evaluate up to level:" make the value a 1.

Help explanation in Entries for Evaluate up to level:
"Enter the maximum hierarchy level down to which objects are shown in the generated index."
Unclear. Here should be an explanation and an example.
Or maybe that should be renamed, because it doesn't seem to do the same as  Evaluate up to level in Type tab.
Anyway, Documentation is a proper mark for the bug and when it's updated, we can discuss about name change.
Comment 14 sdc.blanco 2023-02-18 12:51:06 UTC
I produced what was requested in the OP using LO 7.6.0.0.alpha0+

STR

1. New Writer document.
2. Open Tools - Chapter Numbering
3. Select Level 1, then set Number to 1,2,3.
4. Make a document with headings (I used outline levels 1, 2, and 3), and
spread these headings over several pages.
5.  Open Insert TOC, use Entries tab, insert a "Chapter No." before # (page number) for the number of outline levels used in step 5.  Each time after inserting the Chapter No. in the structure, then select it, and set "Evaluate up to level" = 1

Actual:  Each entry shows the heading number of the its immediately preceding outline level 1 (heading 1/chapter) paragraph.

There is an additional problem -- which may need another ticket -- 
there is a blank space between the Heading (Chapter No.) and the page number.  

The space remains, even if the "Format" is set to "Number without Separator"  (and no blanks were used in the Separator options in the Tools - Chapter Numbering dialog). I could not see any way to not have it appear.  While this problem is relevant to the task that motivated the OP, it is not relevant to the actual issue in the OP (about showing "chapter" numbers).
Comment 15 sdc.blanco 2023-02-18 13:26:18 UTC
(In reply to Timur from comment #13)
> Help explanation in Entries for Evaluate up to level:
> "Enter the maximum hierarchy level down to which objects are shown in the
> generated index."
> Unclear.
And probably wrong.  I am working on updating the help page for Entries (e.g., bug 153561), and have worked with the "Evaluate up to.." on the Type tab (bug 153596) -- so I can include this ticket as part of that work. But....

....it is still unclear to me what the "expected" behavior is.  Have tried to understand the "actual" behavior for now (and then can evaluate whether changes are needed and/or whether a question should be raised about "expected" behavior).

My best hypothesis at present is that the actual behavior of "Evaluate up to level" is to specify (from the top) how many levels of numbering are shown. 
Note that STR in comment 14 set "Evaluate..." to 1, which gave the desired result of showing the "Chapter" (outline level 1) heading number.

One way to test this hypothesis is:

1. make a document with numbered headings for (say) 5 outline levels, then
2. insert a TOC.  (Do not need to add a Chapter No., can just use the one included in the default Entry structure).  
By default, "evaluate..." is set to 10.

Actual: all numbering levels are shown for all entries  (default)

3. Edit index, change "evaluate..." to 3  (for level 2,3,4,5) -- if you have used headings at 5 levels.

Actual: Up to three levels of numbering will be shown.  (e.g., level 3, 4, and 5 entries show level 1 no./level 2 no./level 3 no., while level 2 headings show level 1 no./level 2 no., and level 1 shows level 1 no.

iow - a more accurate label of actual behavior might be:  "show up to outline level" X

But this is only an empirical hypothesis -- would be better to have someone confirm that the hypothesis is consistent with the source code.

Note: There seem to be some other quirks with these indexes, sort of like being in one state (e.g, where things don't update when options are changed), but after it comes into another "state", then changing options gives expected results.  This experience is sort of consistent with the report here about different behaviors with different versions.  In some cases, I just inserted a new index, and then things worked as expected.  Sorry -- cannot systematically reproduce this problem -- so just leaving this "warning" for those who will test the hypothesis here.
Comment 16 sdc.blanco 2023-02-18 13:42:10 UTC
Additional hypothesis in case (such as the one here) where only Chapter (outline level 1) heading is assigned numberings, but none of the lower (outline) level headings are given numbering.  

"  " [blank] is shown for headings in levels 2-9 in the index (i.e., their headings do not have numbers), and "evaluate up to..." is greater than 1.

For example, if "evaluate up to" is 2 for a level 3 entry, then rather than showing the first level (which has a number), and nothing for the second level (which has no numbering was assigned), it shows "blank" (but if Evaluate up to is 1, then shows the first level).  Feels like a "bug" for now...
Comment 17 sdc.blanco 2023-02-18 13:54:03 UTC
(In reply to Lee from comment #4)
> There is a way to generate a Table of Contents (TOC) with page numbering by
> chapter. 
I see now that I have re-invented this wheel.

> Change the field "Evaluate up to level:" make the value a 1.
> Since there is a way to create a TOC with page numbers by chapter, 
Right.  Except for the new problem mentioned in comment 14 about the unwanted space.

> it remains for someone with an understanding of the architecture to determine
> if this is the intended solution.
@Heiko?  And more generally -- is the intended behavior accurately described by the word "Show" up to level"

Because this ticket intersects with bug 153561, will drag UXEval into the picture.
Comment 18 sdc.blanco 2023-02-18 14:27:00 UTC
(In reply to @Timur from comment #13)
> "Enter the maximum hierarchy level down to which objects are shown in the
> generated index."
Note "maximum hierarchy level down to which objects  are shown" from the help page (which I believe is unchanged from 2004).

if "objects"[1] is interpreted to mean "outline levels in the heading numbering", then the key phrase is "down to which" -- because the entered number is showing the maximum number of levels (from the top of the hierarchy) that are shown.

In other words -- some circumstantial evidence that the help page  is consistent with the hypothesis that the label should be:  "Show up to outline level"

> Or maybe that should be renamed, because it doesn't seem to do the same as 
> Evaluate up to level in Type tab.
I agree.  The "Type" tab evaluate is evaluating index levels.

It would be good if Lee could write instructions for the Wiki, because this technique will only work if one outline level 1 heading is used in each chapter.
The technique would not work in a document that uses more than one outline level 1 heading in a chapter.


[1] I believe "objects" appear in help because the same text is used for the different kinds of indices (e.g., Tables, Illustrations). Fortunately there are separate help pages for these different kinds of indices, so it should be possible to use a more appropriate word for each kind of index.
Comment 19 sdc.blanco 2023-02-19 00:58:33 UTC
(In reply to sdc.blanco from comment #14)
> There is an additional problem --
> there is a blank space between the Heading (Chapter No.) and the page
> number.  
Bug 114773
Comment 20 Lee 2023-02-21 02:47:29 UTC
Rather than some comments in the WIKI, perhaps the need for setting "evaluate up to level" should be in the User's Guide discussion of the e# element for customizing the TOC?

I just sent that suggestion to the documentation area (LibreOffice Documentation <documentation@global.libreoffice.org>).
Comment 21 Lee 2023-02-21 02:55:48 UTC Comment hidden (off-topic)
Comment 22 Buovjaga 2023-02-21 07:34:39 UTC Comment hidden (off-topic)
Comment 23 Heiko Tietze 2023-02-21 11:49:19 UTC
(In reply to sdc.blanco from comment #17)
> > it remains for someone with an understanding of the architecture to determine
> > if this is the intended solution.
> @Heiko?  And more generally -- is the intended behavior accurately described
> by the word "Show" up to level"

I'm even more noobish than anyone else here ;-).

Never stumbled over "Evaluate up to level" but it seems to be equivalent to Show (a H3 is shown if level-up-to is set to 3 but not H4). However, the E# entry also has this option and I cannot wrap my mind around this multidimensional ToC definition. Guess writing a few lines of code to generate the ToC is quicker than trial and error with the existing dialog.

We could also treat the "level" as unit like "Show up to [ <n> ] levels" (not so good since it would be a l10n challenge).
Comment 24 sdc.blanco 2023-02-21 12:24:56 UTC
(In reply to Heiko Tietze from comment #23)
> cannot wrap my mind around this multidimensional ToC definition. 
As discussed Bug 153712, comment 2, the "levels" here is comparable to the "Level" control in the Field (Document) dialog for "Chapter" (now "heading").  As you have noted, the option controls how many levels of the heading number are displayed. 

> We could also treat the "level" as unit like "Show up to [ <n> ] levels"
If we agree that "Show" is the right word here, then we can use the same solution as done recently for Navigator (bug 153485, comment 10):

Show up to level:

If this label proposal is ok, then I can:
(a) change label in UI
(b) add/update a tooltip/extended tip for that control
(c) update online help page
As @Timur noted (comment 10): this option is not explained so clearly in the help page. The description is accurate, but hard to understand.

And then thanks to Lee for informing Documentation team about improving Users Guide.

Meanwhile -- this option is somewhat useless for adding heading numbers to pages in an index, as long as bug 114773 is not resolved.
Comment 25 Heiko Tietze 2023-02-21 15:20:04 UTC Comment hidden (me-too)
Comment 26 Lee 2023-02-21 21:08:27 UTC Comment hidden (off-topic)
Comment 27 Commit Notification 2023-02-21 23:26:05 UTC
Seth Chaiklin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/e9cbd8e356084c3d4b384315b6687b94080dd79b

tdf#105628  "Evaluate" -> "Show" in option label and update description
Comment 28 Commit Notification 2023-02-21 23:50:09 UTC
Seth Chaiklin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c41e872ed248f804249ecf4d65c4afc2e426e329

tdf#105628 change "Evaluate" to "Show" for Chapter Number

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.