Page 1 of 1

[Solved] Last word on line drops to open space

PostPosted: Sat Apr 25, 2020 7:36 pm
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.

Re: Last word on line drops to open space

PostPosted: Sat Apr 25, 2020 8:01 pm
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

Re: Last word on line drops to open space

PostPosted: Sat Apr 25, 2020 8:09 pm
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?

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 1:08 am
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 2:42 am
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 2:54 am
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

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 3:25 am
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 11:53 am
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 12:00 pm
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?

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 3:17 pm
by jeffrey3600
I did a snip see the attachments.

Thanks.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 3:23 pm
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 3:43 pm
by Zizi64
And please (PLEASE!) upload a real .odt type sample file here...

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 4:24 pm
by jeffrey3600
ZiZi And please (PLEASE!) upload a real .odt type sample file here...

Thanks. How?

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 4:34 pm
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 4:36 pm
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 4:43 pm
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 4:57 pm
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?

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 5:18 pm
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 6:19 pm
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 6:30 pm
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   Expand viewCollapse view

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

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 11:09 pm
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!

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 11:15 pm
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 11:36 pm
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.

Re: Last word on line drops to open space

PostPosted: Sun Apr 26, 2020 11:43 pm
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.

Clipboard01.png
Text copied from PDF pasted into AOO
Clipboard01.png (10.26 KiB) Viewed 778 times

Re: Last word on line drops to open space

PostPosted: Mon Apr 27, 2020 10:13 am
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.

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

PostPosted: Mon Apr 27, 2020 10:26 am
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. 

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

PostPosted: Mon Apr 27, 2020 10:27 am
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.

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

PostPosted: Mon Apr 27, 2020 12:01 pm
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.

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

PostPosted: Mon Apr 27, 2020 12:09 pm
by JeJe
Bill - Yeah, I'm talking generally. not about this specific case.

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

PostPosted: Mon Apr 27, 2020 12:53 pm
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.