I need to change a character to a "non-breaking" character

Discuss setup / installation issues - Add a spell checker, Language pack?
Post Reply
jimmiet
Posts: 3
Joined: Sat May 03, 2008 10:04 pm

I need to change a character to a "non-breaking" character

Post by jimmiet »

This might sound like a strange request. What I would like to do is change the characters that are classified as a possible word break when deciding where to end the line for word wrap. Specifically, the tab character. Right now if a word is followed by a tab and then another word that won't fit on the line, it wraps the tab to the next line... so your next line starts with a tab. What I need is for the tab character to be classified as “non-breaking”. The application would discover that the word following the tab will not fit on the line and backtrack looking for a breakable character. So the line would always start with the word that precedes the tab.

That said, I have no idea if that is possible. Ideally, it would be a simple edit of a config file somewhere. Does anyone have any idea about how I might do this?

Thanks in advance for any help.

Jim
User avatar
Villeroy
Volunteer
Posts: 31355
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: I need to change a character to a "non-breaking" character

Post by Villeroy »

Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: I need to change a character to a "non-breaking" character

Post by acknak »

OTOH, what is the purpose of a tab at the end of a line?
AOO4/LO5 • Linux • Fedora 23
jimmiet
Posts: 3
Joined: Sat May 03, 2008 10:04 pm

Re: I need to change a character to a "non-breaking" character

Post by jimmiet »

It's for a pretty specialized application that I am currently doing in MS Word 97. I still use 97 because Word 2000 exhibits the same "break on tab" behaviour that I noted in OO. I would really like to dump M$ so I was hoping that I could get this worked out.

I produce a local telephone book complete with ~18,000 listings. All listing are imported from a database using mail-merge and each has a specific format with special indents and multiple font sizes. A listing is a paragraph that starts with the last name, then first name, (8.5 pt and bold), then the house number, a non breaking space and the address, (7pt, not bold and, like most telephone books, has no spaces "camel-case"). Immediately following the address is a "dot-filled" right-aligned tab (8.5 pt not bold) and finally the telephone number (10 pt bold). If, after the address, the tab and telephone number will not fit on the same line, The address should move to the next line, followed by the tab and the number.

Code: Select all

Ideally listing fits on one line:
Doe John 1234 AnyWhereSt.....555-1212

If the listing is long it should look like:
Smyth-Jones Fitzgerold
  567 AnyWhereAve............555-1213

But this is not good:
Smyth-Jones Fitzgerold 5 WilliamCresc
   ..........................555-1214
In M$ Word 97, with which I started, this "long listing"is exactly what happens and it looks much better than the alternative in Word 200 and open office. Obviously, all of this must happen automatically without the need to visit each listing and fiddle with the wrapping format.

Hence, the need to alter the tab character and give in "non-breaking" status, if migration to Open office is going to be possible. There are a couple of other issues as well, but I want to deal with them one at a time.

Thanks for whatever help you can offer.

Jim
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: I need to change a character to a "non-breaking" character

Post by acknak »

Ok, so you would never have a situation that would break the line after the tab, leaving the tab at the end of a line.

However, I still don't see how making the tab "non-breaking" would solve your problem. In your example, if the tab was not allowed to break, don't you end up with this sometimes:

Code: Select all

Smyth-Jones Fitzgerold 5
   WilliamCresc..............555-1214
That doesn't look quite right either.

It seems like you really need something that comes between the name and the address that says "if you have to break, do it here first".

Of course, I have no idea if that can be done, or how, so I guess this is all somewhat academic.

If I were doing this, especially since you want a "hands-off" process, I'd stay as far away as I could get from GUI anything, and use TeX or even troff (which was written for printing phone books, as I understand).
AOO4/LO5 • Linux • Fedora 23
jimmiet
Posts: 3
Joined: Sat May 03, 2008 10:04 pm

Re: I need to change a character to a "non-breaking" character

Post by jimmiet »

... don't you end up with this sometimes:

Code: Select all

Smyth-Jones Fitzgerold 5
   WilliamCresc..............555-1214
That doesn't look quite right either.[/i]

It certainly doesn't. I have a non-breaking space auto-inserted between the house number and street name during the mail-merge process. It really saves a lot of time.

...use TeX or even troff (which was written for printing phone books, as I understand).[/quote]


I have never heard of Troff... but I will certainly give it a look.

But it would be soooo much easier if there were a config file that tells the program which characters are non-breaking... or the corollary... which ones are allowed to break a line. I could adjust the file and.... problem fixed!

Perhaps someone will know if that can be done. In the mean time, I will give Troff a peek.

Thanks for the feedback.

Jim
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: I need to change a character to a "non-breaking" character

Post by acknak »

Troff is just another text-formatting markup language, similar (in spirit) to TeX. AFAIK, almost no one uses it anymore, except for legacy situations. The Unix/Linux manual pages are about the only common use for it that I'm aware of. I mentioned more for completeness sake than as any sort of recommendation. For that matter, I don't know if either one of those will provide exactly what you want, but IME, with enough persistence you can make either of them do almost anything.
AOO4/LO5 • Linux • Fedora 23
Post Reply