To get the best advice, always mention OS name, LO version and save format. Be aware that most of the recipes are valid only when save format is native, i.e. .odt.
Your question needs also information on how you number your chapters (beware, ‘section’ has a special technical meaning in
Writer parlance and is not related to chapters – I assume you’re talking about chapters, sub-chapters, sub-sub–…). Many newbies make the mistake of adding chapter numbering by pressing the “toggle list numbering” button. This creates a conflict from which it is very difficult to recover. So, check that your headings are numbered according to the specification.
Chapter numbering is controlled by Tools
>Chapter Numbering
exclusively where you can configure each level individually.
A chapter heading has several component which are referenced separately: chapter number, heading contents, page number, relative position (above/below).
You insert a cross-reference to one of the components with Insert
>Cross-reference
, Cross-references
tab; Type Headings; Selection: click on the desired heading; information to insert chosen in Refer using. You must use one cross-reference per component (number, heading text, page number).