We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question
0

Formatting text consisting with lots of dashes [closed]

asked 2020-10-21 19:46:25 +0200

MarekSurek gravatar image

updated 2021-06-14 21:04:46 +0200

Alex Kemp gravatar image

I have problem with formatting documents where user use dashes to separate different paragraphs. They make dashes manually. Expected behaviour is like on MS Word Version screenshot MS Word version . Im not able to force Libreoffice to work the same way Libreoffice version

Any idea how can I make it work on Libreoffice?

(edited by ajlittoz to display the screenshots)

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2021-06-14 21:05:04.317675

Comments

This issue isn't tab stops or search and replace. I noted you paragraph justification is set to Right Justify text. In MS Word it is set to Full Justify.

Try selecting all the text in LO and then apply the Full Justification, see if that clears it up.

This might be a import bug in LO's end.

AdmFubar gravatar imageAdmFubar ( 2020-10-22 04:53:15 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2020-10-21 21:36:38 +0200

LeroyG gravatar image

updated 2020-10-25 14:05:00 +0200

EDIT 2 (2020-10-25):

  • The better way:
    • Find all \-{50,} (with Regular expressions).¹
    • Choose menu Format - Paragraph…, and add a new right tab stop at 6.67" (it is preferable to make this value bigger, and not smaller, than the width of the paragraph area), with dash fill.²
    • Choose menu Edit - Repeat: Apply attributes (the same that Ctrl+Shift+Y).³
    • Replace all with \t\t.

image description

¹ \- stand for slash, {50,}stand for at least 50.

² This will work only for the first paragraph (maybe a bug).

³ This will apply the tab stop to all selected paragraphs.

EDIT 1 (accepted answer):

  • The elegant way:
    • Find all -.
    • Check Current selection only, find --, and replace with -​-​ (not seen but there is slash, zero width spaceslash, zero width space). Keep in mind that whatever two consecutive slashes in the document will be replaced (or find --- instead of --).

¹ To get a zero width space type U+200B and inmediatelly press Alt+X (don't work in the Replace: field, so you will need to paste it from the document).

  • The dirty way: Add manually a space at the end of the first line. To avoid the need of guess were to add a space, you could:
    • Cut the second line of dashes,
    • Paste if after the text,
    • Add a space.

image description

And teaches writer/user to use a better option: tab stops also can be used in Word.

Original answer: Choose menu Format - Paragraph…, and add a new right tab stop at 6.67", with dash fill. Then press the tab key at the right of the text.

image description

Notice that you can use another character (only one by tab stop) as Fill Character.

More LibreOffice Help on Tabs.

Tested with LibreOffice 6.4.7.2 (x86); OS: Windows 6.1.


Add Answer is reserved for solutions.

Press edit below your question if you want to add more information; also can comment an answer.

Check the mark (Correct answer mark) to the left of the answer that solves your question.

edit flag offensive delete link more

Comments

Hi, thank you for tip. The problem is that I recieve ms word documents which have manually written dashes, therefore using your trick means that I have to remove them all and format every document from scratch. Is there other solution which force libreoffice to read MS Word documens in the way I need?

MarekSurek gravatar imageMarekSurek ( 2020-10-21 21:53:45 +0200 )edit

@MarekSurek, Edited my answer.

LeroyG gravatar imageLeroyG ( 2020-10-21 23:44:05 +0200 )edit

@MarekSurek: try to convince the document writers that manually filling dashes to end of line is a bad idea. You become vulnerable to the slightest change in formatting (paper size, margins, ... or even simply font face). I assume that this dash-stuffing comes from the requirement that nothing can be added at end of paragraph once the document is printed.

The correct way of doing this is tabbing with dash fill as given by @LeroyG at top of his answer.

ajlittoz gravatar imageajlittoz ( 2020-10-22 08:27:31 +0200 )edit

Thank you, it works like a charm.

MarekSurek gravatar imageMarekSurek ( 2020-10-22 09:50:35 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2020-10-21 19:46:25 +0200

Seen: 85 times

Last updated: Oct 25 '20