Page 1 of 1

reformat and hyphens when using LaTeX

Posted: Wed Oct 15, 2003 3:54 pm
by sempau
In 2002-9-5 Michael C. Grant posted this message:

When I use the Ctrl-Shift-J Reformat command, it will often break hyphenated words across lines. However, for LaTeX files, this is a bad thing, because it will then insert a space between the hyphen and the second word in the final typeset text. Is there any way to disable the consideration of a hyphen when breaking long lines apart?
Thanks


Someone suggested that saving with no breaks in lines does the trick. However, as Grant pertinently pointed out, (I quote)

...Unfortunately, that doesn't do it for me. I _need_ to be able to break paragraphs across lines---not everyone that I collaborate with uses the fabulous TextPad editor, and they expect paragraphs to be broken apart.
...
The bottom line is what I need to do is tell TextPad not to consider a hyphen a legal place to break a line up.



There has been no satisfactory reply since. I downloaded the new 4.7.1 version and the problem persists. Even after explicitly defining the hyphen as part of a word (MainMenu -> View -> DocProperties -> Syntax -> OtherCharsInWords), TextPad will still break words at the hyphen.

I would appreciate very much if anyone could give some hint.
Thanks.

Posted: Wed Oct 15, 2003 8:14 pm
by Bob Hansen
I'm not familiar with LaTeX, but....how about this?

:idea: Could you do a Search/Replace to replace the hypen with a temporary unique character.

Then break the paragraphs.

Then restore the hyphens from the temp unique character?

Posted: Thu Oct 16, 2003 9:09 am
by sempau
Thank you for your reply Bob.

Yes, I already tried that for some time, then abandoned the idea. The reason is that it is extremely inconvenient.

In LaTeX, you have to 'compile' your .tex file (plain ASCII text) to get a typeset document that you can visualize (e.g. a PDF). The substitute of the hyphen would not produce the desired result in the compilation process; in some instances, it would even produce a compilation error. Having to switch back and forth between that unique character and the hyphen every time you decide to modify your text is a hassle.

I was expecting TextPad to provide a more, er..., a more *elegant* way of fixing this.

I appreciate your help anyway. Thanks.
Josep