Creating an outline without the entire paragraph being shown

I have a LibreOffice Writer document with paragraphs in the following format:

Paragraph 1 Title. Paragraph 1 Body.
Paragraph 2 Title. Paragraph 2 Body.

I would like the outline of the document to state only the title (i.e. “Paragraph 1 Title”).

However, when I try creating the outline based on Paragraph Style, the entire paragraph appears in the outline (e.g. “Paragraph 1 Title. Paragraph 1 Body.”).

Is it possible to have an outline using only the titles? The issue is that I must keep the body on the same line as the title, so cannot apply a different Paragraph Style.

Here is a sample file (heading.odt (16.6 KB)) if helpful to understand. Press F5 to see the Navigator which shows the outline. I care about the outline text because it gets exported to PDF.

What makes N first characters in a given paragraph its “title”? I.e., how can LibreOffice know it?

How do you start a nested list on the same line as the parent list item? - #23 by mikekaganski might be relevant. Here is a modified sample, using actually different paragraphs for “title” (heading) and the rest, separated by a hidden paragraph mark (LibreOffice 7.5+).

heading1.odt (18.3 KB)

But there are problems in this new not-widely-used compatibility feature:

  1. The hidden state of the mark only shows after you do a print preview;
  2. The Navigator and PDF export still think that the whole resulting block (i.e., the header and the rest) constitute the outline text…

Worth a report.

1 Like

Here’s an idea. Have a special set of character styles called In-line heading 1 … and allow that to be added to the list of styles that you want to include in the TOC (and outlines).
For another workaround, see Apache OpenOffice Community Forum - [Tutorial] "In-line" or "run-in" headings - (View topic). Maybe that can be used as a starting point to implement in-line headings. Those things do pop up in books where the author or publisher wants to save space on a page or feels that a heading doesn’t deserve a line for itself.

To handle inline titles correctly in the TOC, you will need to use an index entry instead of an outline style.

  • Format the entire paragraph as regular text (e.g. Body Style). Otherwise, it will obviously be included in the TOC in its entirety. You may prefer to use a dedicated Character style to format the inline title.

  • Create a dedicated Index Entry instead of an outline paragraph style. From the menu, select

    Insert — Table of Contents and Index — Index Entry

  • In the “Insert Index Entry” dialog that appears, select “Table of Contents” in the “Index” dropdown, then provide the title in the “Entry” field. Assign the correct level using the “Level” spinbox. Then click “Insert”.

Limitations

  • Character formatting within the title will not be propagated in the TOC. This is mainly of concern for technical/scientific documents, where there may be a need to e.g. format a scientific plant name in Italics, or use a sub or superscript (e.g. CO₂).
  • Heading entries indicated through an Index Entry do not make it into the PDF outline upon export.
2 Likes

Thank you everyone for your ideas!

My expectation is that I would need to explicitly identify the title, rather than it being detected automatically. Perhaps like @anon87010807 suggested, by highlighting the title with a specified Character Style.

I’ve tried this (updated example: heading.odt (17.1 KB)) and although it works for a TOC, my need is for it to be exported in the PDF Document Outline. Currently the index entry does not appear there.

Perhaps re-stating my question in its most minimal form: is it possibly in LibreOffice Writer to specify a title for an entry in the PDF Document Outline other than the full paragraph text?

Hi,
have a look at that extension: Inline Headings;

HTH

1 Like

my need is for it to be exported in the PDF Document Outline. Currently the index entry does not appear there.

Thanks for identifying yet another limitation of the approach. I added it to my answer.

is it possibly in LibreOffice Writer to specify a title for an entry in the PDF Document Outline other than the full paragraph text?

Yes, I told you how. Either it is through a paragraph with an outline level header, or it is through the index entry. Unfortunately, LO has its limitations: you bumped into a few.

1 Like