Search and Replace Tabs & Paragraph Markers

I want to find and replace each paragraph marker with a paragraph marker + a tab to force an indent after every paragraph. This can be done in Word with FIND ^p REPLACE ^p^t can you do this in LO Writer?

EDIT: Maybe I am giving the wrong answer. This way you will get an indent at the beggining of each paragraph. You also could use paragraph styles to achieve that.

Select all text in which to add indent. Choose menu Format - Paragraph… - Indents & Spacing tab, select the desired value for First line:, and OK.

You also can change this value from the horizontal ruler. Move the upper pentagon that lies to the left.

EDIT 2: Not sure that this is what do you want, but to add a tab at the end of each paragraph, Find $ and Replace with \t\n with Regular expressions checked.

Tested with LibreOffice 7.0.6.2 (x64); OS: Windows 10.0.


Add Answer is reserved for solutions. If you think the answer is not satisfactory, add a comment below, or click edit (below your question) to add more information. Thanks.

Check the mark (Answer mark → Correct answer mark) to the left of the answer that solves your question (it may take a little while until it turns green).

Indent and tab stop are visually identical but importantly not functionally identical.

The find $ and replace with the regular expression \n\t is the correct solution (this is for when you want to indent to 0 and use tabs for new paragraphs).

No. This may be a solution in a plain text editor but Writer is more than that. A paragraph is a complex object with many properties. It is primarily a “rectangular container” with padding around it (called indents horizontally and spacing vertically), a border with its padding. Text inside this area has a “first line indent” property (and others like line spacing, alignment, …).

Using a Tab to achieve first line indent is based on the wrong assumption that this indent is represented internally with the tab character. It is not the same function. a Tab moves text to the next tab stop as defined in the paragraph style or, by default, to the next evenly spaced stop defined globally for Writer.

Semantically, tabs should be reserved for quasi-tabular data. Using tabs to space/align text is an error which makes your life extremely difficult when it comes to optimising your document format and layout.

Any “non-tabular” paragraph must not contain tabs. Indent is done by configuring the property in the paragraph style. Or if you accept the odds with direct formatting, you can move manually the first line marker in the ruler.

1 Like

Yes.

Why? Because I literally JUST did EXACTLY what I said to change indents into tabs to format a document how my publisher needed it to be.

My point stands; it was the correct way to mass-change the paragraphs in a document.

Should I understand you previously had first line indents and you were requested to change to no indent and tab? Who’s that publisher? Has he ever leant anything about electronic typography? I bet he also required DOCX or something similar, which means many compatibility issues with ODF.

Mmmh! Considering builtin find & replace “horizon” is limited to a single paragraph, I’d prefer a Find: regexp ^ to be replaced by \t. This avoids interfereing the existing paragraph structure. The regexp finds the start of all paragraphs and adds the tab (since the start of the paragraph is never replaced). It also avoids a subtle issue (which is not a problem here) because you can’t replace the last paragraph mark in a document (which logically must not be done in your document).

Find:
^.+$
replace:
\t&

^p ms word replaces tabs Find and Replace dialog

Find and Replace Steps

  1. Open Find & Replace Dialog : Go to Edit > Find & Replace .
  2. Enable Regular Expressions : Check the box for “Regular expressions” in the dialog.
  3. Find Paragraph Marks :
  4. To find a paragraph mark, use $ in the "Find " field.
  5. Replace with Desired Text :
  • Enter the text or character you want to replace the paragraph mark with in the "Replace " field.

Example Replacements

Find Pattern Replace With Description
$ Replace paragraph marks with a space.
$ \n\t Replace paragraph marks with a new line and a tab.
$ \n Replace paragraph marks with a new line only.

Additional Tips

  • Indentation : If you want to add an indent after each paragraph, you can replace $ with \n\t to insert a tab after each new line.
  • Removing Extra Paragraph Marks : To replace double paragraph marks with a single one, use ^$ to find empty paragraphs and replace them with a single $ .

By following these steps, you can effectively manage paragraph marks in your LibreOffice documents, similar to how you would in MS Word.

Thank you. I have questions…

How are we supposed to know to use ‘$’ in the Find field? Is this written in manual somewhere? Similarly, how do we know the symbols '\n and \t? Is there a list?

In MS word there is a simply drop down list of special characters. Is there something similar in Libre?

Having had several failed attempts to use Libre Office, I keep running up into the same sort of roadblocks - someone can tell me how to do something, but not how I was supposed to find it out in the first place except by blind luck or going begging on a forum

Thanks…

These are Regular Expressions and yes, it is written.