[scribus] Removing extra spaces??

Peter Nermander peter at nermander.se
Thu Nov 6 06:22:06 UTC 2014


> So spaces could certainly be deleted, you just have to figure out the
> algorithm for deciding which ones to delete, 2 in a row, something else?
>
>
That's en easy one: replace each <space><space> with <space>. Repeat until
no replacement is done.

I have a Word macro doing just that, I used it a lot a few years ago when I
was receiving contributions for a magazine. I run my macro manually until
it says "0 replacements were done", but that part can most likely be
automated.

I also had a macro converting "double enter" paragraphs break into real
ones. What it does is that first it replaced all paragraph breaks by line
breaks. Then all <line break><whitespace><line break> were replaced by
<line break><line break> (sometimes the empty line between two paragraphs
have a space or a tab), then all double line breaks were replaced by
paragraph breaks before all remaining line breaks were replaced by a space.

This will however remove any intentional mid-paragraph line break, so care
must be taken to not run it blindly. Usually such mid-paragraph line breaks
can be circumvented by using hard spaces or soft hyphenation instead of a
line break.

/Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20141106/aa2177d7/attachment.html>


More information about the scribus mailing list