I’m using Libreoffice v 7.3.7.2 (x64) and Windows 11
I have an .odt file which is a book and when I make the table of contents some of the chapters include the text of the first paragraph. When I check those effected chapters, I find that I cannot align the chapter number without effecting the alignment of the first paragraph and vice versa. This must be the problem but I can’t see how to correct it. Going to the delete direct formatting doesn’t help and retyping doesn’t either.
Help needed please !
Only paragraphs styled Heading n go into the TOC. Consequently, your first paragraph after the heading is so styled.
What may have happened in an incorrect Shift+Enter at end of your heading. This is not an end of paragraph but a mere line break, meaning your heading and supposed first paragraph are in fact a single paragraph.
You can tell by enabling View
>Formatting Marks
. Line break is shown as a down-then-left arrow and a paragraph break as a pilcrow (sort of mirrored “P”).
If this is not the case, attach a reduced file (1- or 2-page maximum).
Replacing line breaks by paragraph breaks is done with Edit
>Find & Replace
:
- in Find:, enter
\n
(which in this box means line break - in Replace:, enter
\n
(which means paragraph break; this is different from preceding box!) - check *Regular expression: this is the most important to confer “meta-semantics” to the
\n
sequence
Press Replace All if you’re confident, otherwise Find All to give you the opportunity to check the hits. You can alse Replace one by one and Find Next to skip an occurrence.
You must also restyle your “first paragraphs” as Text Body to remove the heading significance.
From your screenshot, you direct format your vertical spacing with empty lines/paragraphs. This is a bad idea because you must manually sync with page breaks (which from author’s point of view occur at random locations with regard to text). Vertical spacing should be configured in the paragraph style.
Similarly, don’t horizontally space with SPACE characters. This is not reliable. Once again play with paragraph style parameters. In case of “CHAPTER TWO”, it is likely you want it centered. Then change Heading 1 for center alignment. If not centered, adjust lest indent (called Before text in the configuration dialog because it refers to the ordering relative to writing direction).
I also bet that your discourse paragraph are all Default Paragraph Style. This agian is wrong because this style is used to define default attributes shared by all other styles. The expected style for discourse is Text Body. Text Body is independent from Heading n. Thus, you can have separate looks between headings and text without undesired side effects when you tune your formatting.
I recommend you read the Writer Guide for an introduction to styles.
Thank you !