[Solved] Centre only part of a document

Discuss the word processor
Post Reply
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: 9547
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: 9547
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 170 times
Before...
Before...
Screenshot (49145).png (73.19 KiB) Viewed 170 times
Open Office 4.1.1.
Windows 8.1
User avatar
MrProgrammer
Moderator
Posts: 5278
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Centre only part of a document

Post by MrProgrammer »

DavidGYoung wrote: Sun Jun 29, 2025 4:57 pm 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.
This suggests that you had unexpected formatting in the document which needed to be removed. For many people this happens when they copy to the clipboard from source other than OpenOffice, say a web page, or a PDF, then copy from the clipboard to Writer. The Edit → Copy operation copies formatting in addition to content. You avoid that by using Edit → Paste Special → Unformatted text. Then you can format the content in Writer so you know exactly what you did.

Copying the formatting from the source document may seem easier, but there are hundreds of topics on the forum where people struggle to adjust formatting in their document and can't because they don't understand why the document behaves as it does. They try and try for a long time and finally open a topic asking for help. That seems to be the case here. Experienced Writer users enable View → Non-printing characters to better understand formatting and content in a document. Read about this in Help → Index or in User Guides (PDF) or searching for topics about it in the Writer Forum.

It's good that you were able to solve the problem yourself. Your screen images are worthless for problem diagnosis, like texting a picture of your car to a mechanic and asking why it won't start. If your documents contain confidential information, our instructions to attach a document explain how to remove that. Most problems are be solved after people attach an OpenOffice file to demonstrate the problem. Don't attach pictures unless we specifically ask for that.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.6, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
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 7 times
Open Office 4.1.1.
Windows 8.1
JeJe
Volunteer
Posts: 3066
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: 33385
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 140 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 Faye) and 24.8 portable on Windows 11.
JeJe
Volunteer
Posts: 3066
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
Post Reply