center text vertically on page

how does libreoffice center text vertically on page

Pages do not exist as primary objects in Writer. They are a consequence of text flow. A new page is allocated when text overflows the current one. During it formatting, Writer does no look ahead.

You have then two solutions.

##Manually position your text

The paragraph to be vertically centered has a specific paragraph style, e.g. built-in Title intended for the title of the book/document in the cover page. Modify the Spacing Above and Below parameters until you are satisfied. Both parameters must be adjusted if you have a sub-title after the title.

In case your page shows only the title, only spacing Above paragraph needs to be set because you can force a page break after it.

##Insert your line outside the text flow

As mentioned above, text flow discovers page boundary when text overflows. You must then associate your line to objects which are inherently page geometry aware, i.e. frames.

Use an empty paragraph at top of your page (preceded by a page break) followed by a page break.

In this empty paragraph, Insert>Frame>Frame. In the Type tab, ensure it is anchored To paragraph. In the Position section, set both horizontal and vertical Centered relative to Page text area. Set the Width to match your page width to avoid having to adjust it later painfully. Remove the default border in Borders tab.

Type your line inside the frame and style it as usual.

I recommend you enable View>Formatting Marks and View>Text Boundaries so that you can easily locate the objects.

To show the community your question has been answered, click the āœ“ next to the correct answer, and ā€œupvoteā€ by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

1 Like

Same idea as a frame, a table consisting of a single cell sized to a height that fits within margins, Allow Table to breaks across pages unticked, and Vertical alignment set to Centred, would do a similar job although without the need for page breaks.

Or is OP asking about the dreadful Direct Cursor Mode, a Microsoft inspired kludge?

@EarnestAl: your suggestion is really simpler for newbies. The drawback for advanced users like me is the need to update the cell (table) size in case margins are changed. But, really very good suggestion. Make it an alternate answer.

Following the frame idea:

Set the Width to match your page width 

Set Width 100 % and ckeck Relative to Paragraph area.

Following the one cell table idea: If Alignment is set to Automatic left and right margin page changes are no problem.

@LeroyG: I meant vertical size for which there is no automatic update as far as I know.

@ajlittoz, What you have written is not wrong. I just added some values to the idea.

@LeroyG: Ā”gracias!

Thanks guys. As an alternative, I suggest a table consisting of a single cell sized to a height that fits within margins.

In the main menu click Table > Insert Table (Ctrl+F12), in the dialog under Columns set counter to 1, under Rows set counter to 1, click Insert.

Right-click on the table and select Table Properties.

  • In the tab labelled Table leave
    alignment set at Automatic.
  • In the tab Text Flow untick the
    box that says Allow row to break
    across pages and columns
    .
  • In the same tab Text Flow under the Heading Alignment change the field Vertical alignment to Centred
  • OK out

With the cursor still in the table, click in the menu Table > Size > Row height..., a small dialog will open, set the row height to the distance between top and bottom margins, so for A4 paper with 20mm margins (my default) set height to 257 mm, OK.

The table will fill your text area and the cursor will be vertically centred. If, subsequently, you increase the margin widths and heights the table will adapt. If you reduce margin widths the table will adapt. If you reduce margin height the table will not increase to match and you will have set the height again in Row Height.

Note 1. That because the row cannot break then a page break is not required.

Note 2. You can make the table create a new cell with the same layout on the next page by Table > Insert > Rows below.

Note 3. Text will not flow from this page to the next, if you need that then use Frames as described by @ajlittoz above and Link the frames

This layout is not a common requirement so it is likely that only one page is needed with vertical centering. Cheers, Al

1 Like

This was great! May I also suggest that after creating the table, just resize it by using the cursor keys to fill the entire page. Maybe this wasnā€™t possible at the time.

like, uh, itā€™s the proverbial question
how many times, and how many years do users have to ask this question before the document foundation notices ?
how many times ?
how many years ?
itā€™s as if document foundation programmers are becoming just as incompetent as the hoi polloi
i mean, how many years, and how many times do users have to complain to mozilla to stop using the ā€˜backspaceā€™ key to ā€˜go backā€™, destroying all of your typed work on a webform

1 Like

This is not an answer to your question. In a Question & Answer site, there is nothing like a conversation or thread. Either you delete it or if you consider this is a valuable addition, you edit your question to incorporate it. Note that a double-Enter creates a line break.