I am new to Writer and am having trouble fixing a document that uses two paragraph breaks. In MS Word, I would use the Search & Replace function. I could tell it to search for a paragraph break, and it would find it. In fact, I would simply use Find paragraph break paragraph break Replace paragraph break. It was easy.
In Writer I can’t do this option. I can’t find a set of characters that mean “paragraph break.” In the manual it says $ means paragraph break but this does not work. I have searched this question over and over in these community pages and I can’t understand the answers. They seem to use jargon that I don’t understand. And also the characters they suggest don’t find paragraph breaks. I am going crazy trying to execute what should be a very simple command! How does Writer handle this problem.
Thanks and sorry to be so ignorant but I have been searching and don’t understand the directions.
There are two solutions to your problem.
Manual method
Enable display of internal technical code with View
>Formatting Marks
. After that, you’ll see on your screen the empty paragraphs corresponding to the double (or more) paragraph breaks. Use your mouse or arrow keys to go there and press either Del
or Backspace
for forward or backward erasure.
Automatic method
Open the Edit
>Find & Replace
dialog. In the Find box, enter ^$
which means “empty paragraph”. Leave Replace empty. Very important: check the Regular expressions box.
You can now press Find
to check your entry targets the empty paragraphs and nothing else. Then either press Replace
to manually get rid of every occurrence one by one or Replace All
if you’re confident.
In case, something goes wrong, quit the dialog and Ctrl
+Z
or Edit
>Undo
to cancel all replacements.
A difference against Word: in Writer, you can’t replace the paragraph break by itself because the break is not a “character”. You either search for content of a paragraph or you’re targeting empty paragraphs. These are exclusive freom each other.
To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!
In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.
Find and Replace Empty Paragraph
To find and replace double paragraph marks (empty paragraphs) in LibreOffice Writer, open the Find & Replace dialog (Ctrl+H), enable Regular expressions (under “Other Options”), and in the “Find” box, enter ^$ to find empty paragraphs, then either replace with nothing to delete them or use \p and ensure “Regular expressions” is checked to replace with a single paragraph mark, or use \p\p to replace with a double paragraph mark.
@jpk You might be referring to AltSearch; in LibreOffice Find and Replace, \p
in the Replace field will enter the literal text \p in the results.
In any event there is no point looking for empty paragraphs to replace them with empty paragraphs which is what would happen if \n
were in the Replace field. See @ajlittoz 's answer for Automatic method