How to Align Text to the Left and Right in Header and Footer?

I want to align text to both the left and right sides of the header and footer in LibreOffice, as shown in the attached screenshots. In the header, one part of the text should appear on the left (e.g., the title), while another part should align to the right (e.g., the project type). Similarly, for the footer, I need to position the author name on the left and the page number on the right. How can I achieve this layout?

Header,

Footer,

The default header/footer setup is with a centered tab stop in the middle and a right-align tab stop at the right margin. Just press the tab key (two long arrows, one above the other ; just above the caps lock on most keyboards) so the cursor jumps to the right (you will have to push it twice unless the left content goes past the middle tab stop), enter your desired content and it will stay right aligned.

If you need better control with header/footer layout (content placement), you can insert a table, probably best to start with one row and two or three columns. Each table cell can then have content aligned independently from the other cells. You may want to have a table without borders.

2 Likes

imagen

I have created my own page styles and changed the page margins from 2 cm to 1.6. However, since LO 6, using the tab does not work any more. The whole Header / Footer alignment is a total mess. Adding a table into either Header / Footer makes the situation worse. The table is added, but below that is a gap in the size of the font of the Header / Footer, e.g. 12 pt. I can change that to 2 pt, but it stays the same mess. It appears that something got messed up in the later versions of LO Writer. I have tried for hours to solve this, but to no avail.

Attach a sample document and mention OS name and LO version.

Thank you, ajlittoz.

Please see the attached sample document.

Sample_document.odt (16.4 KB)

I see this issue with these LO versions -

Version: 7.6.7.2 (X86_64) / LibreOffice Community
Build ID: dd47e4b30cb7dab30588d6c79c651f218165e3c5
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: CL threaded

Version: 24.2.3.2 (X86_64) / LibreOffice Community
Build ID: 433d9c2ded56988e8a90e6b2e771ee4e6a5ab2ba
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: CL threaded

I have not yet tried newer releases of the v7 and v24 branch nor any of the v25.

Thank you very much for providing me with instructions on how I can resolve this issue.

Best regards,

Gaismair.

Problem 1: tab stop at right margin

In Writer, all tab stops are relative to left indent (specific left “margin” of paragraph). There is no alternate origin like right edge. Therefore when you change your margins, you must recalculate your stop position, mostly when you want to align with the right margin.


Fix: define a new stop slightly lower than 18cm and delete the one at 17 cm in Header & Footer paragraph style. The fix will be forwarded automatically to Header and Footer paragraph styles.

Problem 2: header

Your right header part is a wide string, larger than the distance between the center tab and the right tab. It is preceded by two Tab characters. The first Tab sends the cursor to the center. The second tab initially sends the cursor to the right edge and the string fills the available space, extending left. When contents reaches the center position, no more room is available on the line (because the first tab created a boundary) and new words are sent on next line.


Fix: if you have no use for the center position (no data to set there), remove the center tab in Header paragraph style and suppress one of the Tab character in the header

Problem 3: footer

Footer paragraph style has the same problem regarding stop position. If you modified Header & Footer, this issue is already fixed.


But, you applied a center alignment request as direct formatting in your footer. and this messed up aligned in all three parts of the footer.


Fix: select the whole footer and Ctrl+M to clear direct formatted. You have only one Tab character, perhaps in an earlier attempt to fix things. Make sure this is the case everywhere.

1 Like

Thank you very much, ajlittoz. I used the solution for Problem 1 and it all worked.