[Solved] Centre only part of a document

Discuss the word processor
Locked
DavidGYoung
Posts: 23
Joined: Sat Apr 25, 2015 2:02 pm

[Solved] Centre only part of a document

Post by DavidGYoung »

When I use OpenOffice Writer to write letters and other documents, I can centre pieces of text and have the rest aligned with either the left or right side of the page.

However, I am currently using this program and for some reason it now only allows me to centre the entire document, start to finish, and not just the part that I have highlighted.

Which settings do I need to adjust to make it go back to the way it had originally worked?
Last edited by DavidGYoung on Sun Jun 29, 2025 7:38 pm, edited 1 time in total.
FJCC
Moderator
Posts: 9625
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Centre only part of a document

Post by FJCC »

Centering applies to a paragraph and the end of a paragraph is marked with the Enter key. If you are using Shift + Enter to start a new paragraph, then the whole document will be one paragraph as far as the program is concerned and you will see the behavior you describe. Are you using Shift + Enter?

If that is not the problem, please upload a small document illustrating the problem. To upload a document, click Post Reply and look for the Attachments tab just below the box where you type a response.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
DavidGYoung
Posts: 23
Joined: Sat Apr 25, 2015 2:02 pm

Re: Centre only part of a document

Post by DavidGYoung »

The document began by my pasting in the contents of a large .txt file.

When I paste in text from a brand-new Writer file, with text on the left, centred, and on the right, this text enters perfectly formatted.

When I then paste part of the original file into the centred text, it goes back to being on the left.

I can't show you the file because it is a translation of a document which involved client confidentiality.

Clearly there is something going on with the formatting of the text which I pasted in, but this is the first time I have ever encountered anything like it.
Open Office 4.1.1.
Windows 8.1
FJCC
Moderator
Posts: 9625
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Centre only part of a document

Post by FJCC »

To make a non confidential version of the document, replace the existing text with a bit of random text or with a description of how you expect that particular part of the text to be aligned. The example can be much shorter than the actual document.
You might also try using Edit -> Paste Special and selecting Unformatted Text when you paste text.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
DavidGYoung
Posts: 23
Joined: Sat Apr 25, 2015 2:02 pm

Re: Centre only part of a document

Post by DavidGYoung »

Here are before-and-after screenshots.

I highlighted the part that I wanted to centre, but the entire text centred instead.


I was eventually able to format the document by copying all the text from the original OpenOffice document, pasting it into Notepad, copying it from Notepad, pasting it into OpenOffice and then manually formatting it.
Attachments
...and after
...and after
Screenshot (49147).png (73.3 KiB) Viewed 2362 times
Before...
Before...
Screenshot (49145).png (73.19 KiB) Viewed 2362 times
Open Office 4.1.1.
Windows 8.1
DavidGYoung
Posts: 23
Joined: Sat Apr 25, 2015 2:02 pm

Re: Centre only part of a document

Post by DavidGYoung »

Here's the file itself.

The original was in fact a pdf. I used an online tool to transfer the contents to .txt and then copied that into Writer.

Does pdf formatting even survive in a .txt document? I had been under the impression that pretty much everything other than the characters themselves vanished when turned into .txt.
Attachments
Annoying feature of this program.doc
(9 KiB) Downloaded 62 times
Open Office 4.1.1.
Windows 8.1
JeJe
Volunteer
Posts: 3132
Joined: Wed Mar 09, 2016 2:40 pm

Re: Centre only part of a document

Post by JeJe »

Your text is all one paragraph and alignment is applied to whole paragraphs. Turn on View Menu/non printing characters to see lines end in line feed characters not paragraph marks. Most simply you can use the return key to break up the text into paragraphs.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Hagar Delest
Moderator
Posts: 33633
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Centre only part of a document

Post by Hagar Delest »

DavidGYoung wrote: Sun Jun 29, 2025 6:38 pm Does pdf formatting even survive in a .txt document? I had been under the impression that pretty much everything other than the characters themselves vanished when turned into .txt.
It may depend on the application.
But very likely if you use an online converter. Note that if there is any confidentiality involved I would definitively avoid online converters.

AS said by JeJe, there are still line breaks instead of paragraph breaks:
Formatting.png
Formatting.png (6.79 KiB) Viewed 2332 times

Note that you can find and replace all the line breaks by paragraph breaks with regex (find \n and replace by \n).

Please add [Solved] at the beginning of the title in your first post (top of the topic) with the button if your issue has been fixed.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
JeJe
Volunteer
Posts: 3132
Joined: Wed Mar 09, 2016 2:40 pm

Re: Centre only part of a document

Post by JeJe »

Using find/replace to replace line feed with paragraph marks

viewtopic.php?p=537714#p537714
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
DavidGYoung
Posts: 23
Joined: Sat Apr 25, 2015 2:02 pm

Re: Centre only part of a document [Solved]

Post by DavidGYoung »

Thanks everyone for the assistance.
Open Office 4.1.1.
Windows 8.1
Locked