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&