[Solved] Last word on line drops to open space

Discuss the word processor
Post Reply
jeffrey3600
Posts: 19
Joined: Sat Jan 21, 2017 7:56 pm

[Solved] Last word on line drops to open space

Post by jeffrey3600 »

I'm using Text with 1.5 space between lines.
When editing, I add a word to a full line of text and the last word in the line drops into the space not onto the next line of text.

thx.
Last edited by jeffrey3600 on Mon Apr 27, 2020 12:13 am, edited 1 time in total.
open office 4.1.3 on Windows 10
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Last word on line drops to open space

Post by JeJe »

Can you post a sample document with a paragraph the text where this happens? Plus say where in the paragraph (after what) you type which word
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Last word on line drops to open space

Post by RoryOF »

Are you allowing the lines to wrap automatically to the next line, or do you press Enter key at the end of each line?
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
jeffrey3600
Posts: 19
Joined: Sat Jan 21, 2017 7:56 pm

Re: Last word on line drops to open space

Post by jeffrey3600 »

I am not using enter between lines. The words are not wrapping and my Wrap setting is grayed out! I started a new document and this problem is not happening. I believe that it's a setting issue, but I can't find the correct setting.
Thanks.
open office 4.1.3 on Windows 10
Bill
Volunteer
Posts: 8932
Joined: Sat Nov 24, 2007 6:48 am

Re: Last word on line drops to open space

Post by Bill »

jeffrey3600 wrote:The words are not wrapping and my Wrap setting is grayed out!
Wrap settings control wrapping around objects like pictures, not wrapping at the margin. Wrap settings should be grayed out if no object is selected.

I don't know how to interpret "... the last word in the line drops into the space...". Please upload a sample document so we can see what is happening.
AOO 4.1.14 on Ubuntu MATE 22.04
jeffrey3600
Posts: 19
Joined: Sat Jan 21, 2017 7:56 pm

Re: Last word on line drops to open space

Post by jeffrey3600 »

Below is a before and after sample. I added the word two to the second example at the end of the line.


beneath them. The tabletops were made of a smooth black slate, the stools below were

made of a light brown wood with round seats. The room was empty. Harry walked in
--------------------------------------------------------------------------------------------------------------------

beneath them. The tabletops were made of a smooth black slate, the stools below were
two
made of a light brown wood with round seats. The room was empty. Harry walked in
open office 4.1.3 on Windows 10
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Last word on line drops to open space

Post by RusselB »

Your example is useless as the forum puts in it's own formatting.
To properly show us what is happening, attach a sample document.
See How to attach a document for more instructions.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Bill
Volunteer
Posts: 8932
Joined: Sat Nov 24, 2007 6:48 am

Re: Last word on line drops to open space

Post by Bill »

The sample appears to be 3 lines with the middle line blank. The word "two" is not at the end of the blank line, so it's not dropping down. It is wrapping to the start of the blank line. Without a real document to examine the settings, it's impossible to give you a definite answer about what's actually happening.
AOO 4.1.14 on Ubuntu MATE 22.04
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Last word on line drops to open space

Post by JeJe »

Copying and pasting into writer what you say happens - but that's because the text has line feed characters in it. (character 10). If you go to View menu/non-printing characters these won't be hidden.

Remove those and it will wrap properly.

Edit:

What's the origin of the text - have you pasted it in from a different application?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
jeffrey3600
Posts: 19
Joined: Sat Jan 21, 2017 7:56 pm

Re: Last word on line drops to open space

Post by jeffrey3600 »

I did a snip see the attachments.

Thanks.
Attachments
Clip_890.png
Clip_890.png (9.05 KiB) Viewed 3235 times
Clip_888.png
Clip_888.png (8.99 KiB) Viewed 3235 times
open office 4.1.3 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Last word on line drops to open space

Post by RoryOF »

Please make the same screenshots once again, but this time _after_ turning on /View /non printing characters. That same command will turn off the new display, but we need to see what it tells us.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Last word on line drops to open space

Post by Zizi64 »

And please (PLEASE!) upload a real .odt type sample file here...
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
jeffrey3600
Posts: 19
Joined: Sat Jan 21, 2017 7:56 pm

Re: Last word on line drops to open space

Post by jeffrey3600 »

ZiZi And please (PLEASE!) upload a real .odt type sample file here...

Thanks. How?
Attachments
Clip_903.png
Clip_903.png (5.74 KiB) Viewed 3220 times
Clip_904.png
Clip_904.png (6.23 KiB) Viewed 3220 times
open office 4.1.3 on Windows 10
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Last word on line drops to open space

Post by JeJe »

As there's a paragraph mark after "were" its doing what its meant to. To change that, position the caret by clicking before "made", do a backspace to remove it and type a space. It will then wrap as you want it to.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Last word on line drops to open space

Post by RoryOF »

The Backward P character (recte: a Pilcrow) indicates that you have terminated each line by pressing Enter (or pasted from a source that had done so). Each such line is treated by OpenOffice as a paragraph, and a defined Paragraph Style used for it (probably Default, possibly Text Body). To ascertain this, place cursor in a line and see what style shows in the Formatting Toolbar. The white space below each paragraph, which you are describing as "1.5 Line spacing" is actually a "Space below paragraph", as defined on the "Indents and Spacing" tab of that paragraph style definition. When you enter the extra word it is automatically moved to the next line - the paragraph is extended - and the spacing defined for use within the paragraph is used.

You may find it of help to read
Writer_for_Students
which gives a comprehensive description of using Writer for most purposes.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Last word on line drops to open space

Post by Zizi64 »

ZiZi And please (PLEASE!) upload a real .odt type sample file here...
Thanks. How?
Click on the POSTREPLY button (but NOT on the Quick Reply!).
Then you will able to edit a new post. Under the post edit window there are two TAB-s: "Options" and "Upload Attachments".
Click on the second one. Browse the file on your HDD; select it, and then Click on the button "Add the file".

Submit the post.

Note: The file size limit is 128 KiB on this forum.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
jeffrey3600
Posts: 19
Joined: Sat Jan 21, 2017 7:56 pm

Re: Last word on line drops to open space

Post by jeffrey3600 »

Thanks Rory.
Almost all of the lines read default, at least one says text. So is there any way to solve (change a setting) the problem on this document. I say this document because on "new documents" this problem does not exist. Also, when writing I never use the enter key to go to the next line. I will read the book, but generally it's difficult to find this specific problem. What would you call this problem for me to find it in the book?

One last question. Is there a way to do a total default to original "factory" settings for entire program?
open office 4.1.3 on Windows 10
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Last word on line drops to open space

Post by JeJe »

The issue is not anything to do with the program or its factory settings.

You have two options to remedy unwanted paragraph breaks in a document:

1) Manually as i explained above
2) Using find and replace: Put a $ in the search box, a space in the replace box, and tick More options / regular expressions.

A better remedy would be to not do what you did to get a document with unwanted paragraph marks in the first place.

Edit: someone who knows regular expressions better than I do may be able to come up with a find and replace that clears them only when the next paragraph begins with a lower case letter - which would sort everything easily.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Last word on line drops to open space

Post by Hagar Delest »

You can also try that macro: Convert ASCII text files by deleting extra paragraph breaks.

Please add [Solved] at the beginning of the title in your first post (top of the topic) with the *EDIT button if your issue has been fixed.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Last word on line drops to open space

Post by JeJe »

Try this macro but MAKE A COPY OF YOUR DOCUMENT FIRST AND RUN IT ON THE COPY - to be on the safe side.
It goes through each paragraph and if it begins with a lowercase letter it changes the previous paragraph mark to a space.

Edit: note it probably won't handle complicated documents with anything other than just normal paragraphs

Code: Select all


Sub RemoveBreaks
txt= thiscomponent.text
tc=txt.createtextcursorbyrange(txt.getstart)
res = true
do
res=tc.gotoNextParagraph(false)
if res = false then exit do
tc.goright(1,true)
if tc.string <> Chr(13) and tc.string <> Chr(10) then
if lcase(tc.string) = tc.string then
tc.collapsetostart
tc.goleft(1,true)
if asc(tc.string = 13) then 
tc.string = " "
tc.gotoEndOfParagraph(false)
end if
end if
else 
tc.goright(1,false)
end if
tc.collapsetoend
loop
End Sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
jeffrey3600
Posts: 19
Joined: Sat Jan 21, 2017 7:56 pm

Re: Last word on line drops to open space

Post by jeffrey3600 »

Thanks to all for your efforts and help. I'm sure that there is more than one solution but the one that worked for me was: 2) Using find and replace: Put a $ in the search box, a space in the replace box, and tick More options / regular expressions. Posted by JeJe. I'll never know what I did that created this problem but it is solved.
Thanks to all again!
open office 4.1.3 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Last word on line drops to open space

Post by RoryOF »

The quick solution is to enter text in OpenOffice and press Enter _only_ when you have finished a paragraph. Formatting within the paragraph is controlled by settings in the paragraph styles used. The text I pointed to will tell you the detail of how to organise this.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Last word on line drops to open space

Post by John_Ha »

jeffrey3600 wrote:I'll never know what I did that created this problem ...
You had the cursor located after the final " e " in "were" and you pressed Enter. This inserted an End of Paragraph marker - shown as a ¶ pilcrow - and hence a new paragraph started with "made".

Backspacing deletes End of Paragraph markers as does deleting the text which straddles them - eg delete "were¶made".

Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Last word on line drops to open space

Post by John_Ha »

jeffrey3600 wrote:When editing, I add a word to a full line of text and the last word in the line drops into the space not onto the next line of text.
1. Copy a few lines of text from a PDF.
2. Paste into AOO.
3. Note how each line ends with an End of Paragraph mark.
4. Now type something into one line - note what happens when the text spills.

If you have multiple lines like this, that is what happened.
Text copied from PDF pasted into AOO
Text copied from PDF pasted into AOO
Clipboard01.png (10.26 KiB) Viewed 3137 times
Attachments
text copied from PDF.odt
(11.65 KiB) Downloaded 123 times
test.pdf
A PDF with some text
(26.68 KiB) Downloaded 121 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Bill
Volunteer
Posts: 8932
Joined: Sat Nov 24, 2007 6:48 am

Re: Last word on line drops to open space

Post by Bill »

AFAIK, there is no reliable way to automate fixing this particular problem with 100% accuracy.

Replacing paragraph marks with a space turns the whole document into a single paragraph with the potential for losing data if the 64k character limit for paragraphs is exceeded. Loss of formatting can also occur if more than one paragraph style has been used in the document. The user would have to manually reinsert the paragraph breaks.

Replacing paragraph marks followed by a lower-case letter will rejoin sentences that have been split. It won't rejoin paragraphs which have been split by pressing Enter before the start of a sentence in the middle of a paragraph. Those would have to be rejoined manually.
AOO 4.1.14 on Ubuntu MATE 22.04
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Last word on line drops to open space

Post by RoryOF »

Often a document that has single line paragraphs, as, for example, might be downloaded from some book archive sites, will have an extra blank line inserted to mark where a paragraph ended in the original text. In that case conversion of the document is quite simple:

Find the empty Paragraph as follows:

Use Find and Replace

Find ^$, Replace %%%% (or some similar token that does not occur in the document). More Options, set Regular Expressions on. Replace all

Now convert the single line paragraphs to continuous text:
Find $, Replace <space char>, More Options, set Regular expressions on, Replace all

Now reinstate the original text paragraphing:
Find %%%%, Replace \n, More options, set Regular Expressions on, Replace all.

All done.

I offer this as a general solution for downloaded text files of troublesome formatting- I am not aware that there are blank paragraphs in the document under discussion.

Also, having /View /Non Printing characters enabled is always essential for handling troublesome imported files.
 Edit: It is important to stress that this method should only be applied on a long (i.e., book length) document in which there are regular blank paragraphs, i.e, Backwards P signs on their own. If there are not, it is likely that the entire document will be turned into one large paragraph; OpenOffice really does not like paragraphs longer than 64K characters and you will lose some or all of the document text. 
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Last word on line drops to open space

Post by JeJe »

Bill - For the last case you suggest, normally you'd put.

End of sentence.[correctly intended paragraph mark]
New sentence.

But if the new paragraph wasn't intended, and a space was added, it would be

End of sentence.[space][paragraph mark]
New sentence.

Or

End of sentence.[paragraph mark]
[space]New sentence.

Which could be used to help fix those. Nothing would be 100% though, computers can't read past intentions.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Bill
Volunteer
Posts: 8932
Joined: Sat Nov 24, 2007 6:48 am

Re: [Solved] Last word on line drops to open space

Post by Bill »

JeJe wrote:But if the new paragraph wasn't intended, and a space was added, it would be

End of sentence.[space][paragraph mark]
New sentence.

Or

End of sentence.[paragraph mark]
[space]New sentence.
Unfortunately, we have no sample document to see if that is the case. The sample screenshot does not show any lines that break between sentences. The two lines shown in the screenshot break in the middle of sentences. One has a space before the paragraph break. The other has no space before the paragraph break and no space at the start of the line after the paragraph break.
AOO 4.1.14 on Ubuntu MATE 22.04
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Last word on line drops to open space

Post by JeJe »

Bill - Yeah, I'm talking generally. not about this specific case.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Bill
Volunteer
Posts: 8932
Joined: Sat Nov 24, 2007 6:48 am

Re: [Solved] Last word on line drops to open space

Post by Bill »

The solution would be trivial if every paragraph break that has been added within paragraphs were preceded or followed by a space. In those cases, AltSearch (Find & Replace wouldn't work) could be used to replace the break/space combo with a space. There would be no need to search for punctuation marks or other characters.
AOO 4.1.14 on Ubuntu MATE 22.04
Post Reply