Table of Contents entries from styles vs index entries

Discuss the word processor
Post Reply
FJCC
Moderator
Posts: 9313
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Table of Contents entries from styles vs index entries

Post by FJCC »

I'm helping someone on the Spanish forum who is setting up a document to match the APA style guide. Headings at the fourth and fifth level need to be in the same paragraph as the text they label. This prevents using a paragraph style to format the heading. It is easy enough to format the heading with a character style and then make an index entry mapped to the table of contents so that the heading is picked up when the ToC is inserted. However, the user noted that when the document is exported to PDF, the fourth and fifth level headings are not included in the outline of the document that the PDF viewer can display. I see that outline displayed to the left of the document in Firefox and I confirmed this behavior on my system. I then noted that even within the odt file, if I make a hyperlinked ToC, the fourth and fifth level entries do not become hyperlinks.

Is there a way to get the PDF export to recognize the ToC entries defined by index entries as document outline marks in the same way it recognizes ToC entries from paragraph styles? Is there a better way to get the fourth and fifth level headings into the ToC?

The OP is using LO 7.5.8.2 and I've seen the same results on OpenOffice 4.1.15 (pre-release, RC1).

The attached file is the one I've used for testing. The fourth level heading is "Cuarto nivel" and the fifth level is "Quinto nivel".
Attachments
APA_7.odt
(12.65 KiB) Downloaded 288 times
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
cwolan
Posts: 131
Joined: Sun Feb 07, 2021 3:44 pm

Re: Table of Contents entries from styles vs index entries

Post by cwolan »

FJCC wrote: Tue Nov 14, 2023 2:24 am The OP is using LO 7.5.8.2 and I've seen the same results on OpenOffice 4.1.15 (pre-release, RC1).
As regards LibreOffice behavior:
According to tfd#65463, version 7.2 fixed the non clickable index in Writer and in exported PDF.

I opened the file you had attached (APA_7.odt) with LO 7.5.8.2, and updated the ToC. The fourth and fifth level entries do become hyperlinks.
No problem with PDF.

Am I missing something?
OpenOffice 1.1.5 – 4.1.15
LibreOffice 3.3.0.4 – 7.6.7
Windows 7,10,11 64-bit
User avatar
Hagar Delest
Moderator
Posts: 32712
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Table of Contents entries from styles vs index entries

Post by Hagar Delest »

I confirm that the PDF bookmarks are not exported (using LO 7.6.1.2 portable):
PDF_bookmarks.png
PDF_bookmarks.png (8.33 KiB) Viewed 1870 times

The only trick I see would be that one (to keep using the heading styles): [Tutorial] "In-line" or "run-in" headings.

I guess it's worth an enhancement request: the index entries for table of content should be exported as bookmarks in PDF.
LibreOffice 24.2 on Xubuntu 24.04 and 7.6.4.1 portable on Windows 10
cwolan
Posts: 131
Joined: Sun Feb 07, 2021 3:44 pm

Re: Table of Contents entries from styles vs index entries

Post by cwolan »

Hagar Delest wrote: Tue Nov 14, 2023 9:50 am I confirm that the PDF bookmarks are not exported (using LO 7.6.1.2 portable):
Indeed.
Sorry for the confusion. I misinterpreted the question in the context of the description.
OpenOffice 1.1.5 – 4.1.15
LibreOffice 3.3.0.4 – 7.6.7
Windows 7,10,11 64-bit
gpgrego
Posts: 39
Joined: Fri Jan 31, 2020 4:04 pm

Re: Table of Contents entries from styles vs index entries

Post by gpgrego »

It seems that the problem is in the setting of the Styles.
"Cuarto Nivel" and "Quinto Nivel" are not Styles "Heading", they are Styles "Text body".
Styles "Heading" can be changed, but "Text body" that follows must be separate on another line/paragraph.
I did a test and this is the result.
Attachments
APA_7_new.odt
(13.75 KiB) Downloaded 263 times
APA_7_new.pdf
(89.08 KiB) Downloaded 258 times
openoffice 4.1.6 - Windows 10
FJCC
Moderator
Posts: 9313
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Table of Contents entries from styles vs index entries

Post by FJCC »

FJCC wrote: Tue Nov 14, 2023 2:24 am Headings at the fourth and fifth level need to be in the same paragraph as the text they label.
gpgrego wrote: Sat Nov 25, 2023 5:30 am Styles "Heading" can be changed, but "Text body" that follows must be separate on another line/paragraph.
The root of the problem is that the style guide requires that the headings be in the same paragraph as the subsequent text.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
JeJe
Volunteer
Posts: 2835
Joined: Wed Mar 09, 2016 2:40 pm

Re: Table of Contents entries from styles vs index entries

Post by JeJe »

They could use a text frame anchored as character for the heading (with the text frame paragraph set the Heading 4/5).

Fiddly to create the text frame but the pdf is fine.

Edit: Creating an autotext for each of the two headings would remove the fiddliness for subsequent headings.
Attachments
with text frame.odt
(13.44 KiB) Downloaded 258 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
gpgrego
Posts: 39
Joined: Fri Jan 31, 2020 4:04 pm

Re: Table of Contents entries from styles vs index entries

Post by gpgrego »

Or create a table for levels 4 and 5?
Attachments
APA_7_apa.odt
(59.64 KiB) Downloaded 268 times
APA_7_apa.pdf
(104.01 KiB) Downloaded 270 times
openoffice 4.1.6 - Windows 10
User avatar
Hagar Delest
Moderator
Posts: 32712
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Table of Contents entries from styles vs index entries

Post by Hagar Delest »

Tables give a hanging indent, which is not the intent I guess.
LibreOffice 24.2 on Xubuntu 24.04 and 7.6.4.1 portable on Windows 10
JeJe
Volunteer
Posts: 2835
Joined: Wed Mar 09, 2016 2:40 pm

Re: Table of Contents entries from styles vs index entries

Post by JeJe »

I get some vertical positioning glitches with anchoring to character in OO with my suggestion (Edit: i.e. aligning the frame text with the text after it). Anchoring to paragraph and making the border white to hide the grey outline for the text frame seems to work.

Edit: Oops it needs some spaces added in that version at the start of the normal paragraph to make room for the frame.

Edit 2:
The positioning glitches with anchoring to character are possibly associated with having a border. The positioning kept being redrawn slightly differently without even editing the document.

Its possibly best to anchor as character after all and set the border to zero, which meaning keeping the light grey surround showing there's a frame. I don't know any way to get rid of that apart from the trick of giving the frame a white border. It won't be there after converting to pdf but while still in Writer it might be annoying.

Edit 3
And vertically position the frame as Top and to Character in the Frame dialog.

Edit 4
Found it - untick Tools/options/OpenOffice/Appearance General/Object Boundaries
Attachments
with text frame 2.odt
(13.21 KiB) Downloaded 259 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
gpgrego
Posts: 39
Joined: Fri Jan 31, 2020 4:04 pm

Re: Table of Contents entries from styles vs index entries

Post by gpgrego »

Ok. Table Hanging indent removed.
Attachments
APA_7_ToC.odt
(15.29 KiB) Downloaded 267 times
APA_7_ToC.pdf
(70.26 KiB) Downloaded 259 times
openoffice 4.1.6 - Windows 10
User avatar
Hagar Delest
Moderator
Posts: 32712
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Table of Contents entries from styles vs index entries

Post by Hagar Delest »

gpgrego wrote: Sun Nov 26, 2023 3:04 pm Ok. Table Hanging indent removed.
But it breaks the flow of the first "line" of the paragraph. Don't get me wrong, I've nothing against your proposals but they don't meet all the requirements I think.
If the run-in headers trick is not good enough (it adds the string of the heading; even if not visible (white font), it still can be selected in the PDF), then I vote for the frame.
LibreOffice 24.2 on Xubuntu 24.04 and 7.6.4.1 portable on Windows 10
Post Reply