[comp.text.tex] hyphenation with hyphens

norbert@rwthinf.UUCP (Norbert Kiesel) (11/12/90)

Hello,
I'm trying to hyphenate words with imbedded hyphens ala 'subsystem-module'.

A \showhyphens{subsystem modul subsystem-modul} gives
``sub-sy-stem mo-dul subsystem-modul'', i.e. no hyphenation in the third word.

I'm normally working with LaTeX, but here it makes no difference. Is this a bug 
or a feature? And if a bug, a configuration bug or a TeX bug (please send me
 $2^x$ dollars :-) ?


		so long

			Norbert


*******************************************************************************
* Norbert Kiesel	Institut f. Informatik III     NN       NN    KK   KK *
* RWTH Aachen           Ahornstr. 55  		       NNN      NN    KK  KK  *
* West Germany		D-5100 Aachen 		       NN N     NN    KK KK   *
*                       +49 241 80-7266		       NN  N    NN    KKKK    *
* 		                 		       NN   N   NN    KKKK    *
* EUNET:  norbert@rwthi3.uucp          		       NN    N  NN    KK KK   *
* USENET: ...!mcvax!unido!rwthi3!norbert	       NN     N NN    KK  KK  *
* X.400:  norbert@rwthi3.informatik.rwth-aachen.de     NN      NNN    KK   KK *
*******************************************************************************

piet@cs.ruu.nl (Piet van Oostrum) (11/14/90)

>>>>> In message <3684@rwthinf.UUCP>, norbert@rwthinf.UUCP (Norbert Kiesel)
>>>>> (NK) writes:

NK> I'm trying to hyphenate words with imbedded hyphens ala 'subsystem-module'.

NK> A \showhyphens{subsystem modul subsystem-modul} gives
NK> ``sub-sy-stem mo-dul subsystem-modul'', i.e. no hyphenation in the third word.

See the TeX book pages 95, 286 and 454: TeX inserts a \discretionary{}{}{}
after a character that is the hyphenchar of its font in unrestricted
horizontal mode. However, a word that contains discretionaries is not
further hyphenated. So you must disable the hyphenchar while reading the
word and enable it while TeX hyphenates (i.e. at the end of the paragraph.

Two ways to do this:

\def\H#1{\setbox0=\hbox{#1}\unhbox0}
\showhyphens{subsystem modul \H{subsystem-modul}}

\edef\savehyphenchar{\the\hyphenchar\the\font}
\hyphenchar\the\font=0
\showhyphens{subsystem modul subsystem-modul
\hyphenchar\the\font=\savehyphenchar} 
-- 
Piet* van Oostrum, Dept of Computer Science, Utrecht University,
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.
Telephone: +31 30 531806   Uucp:   uunet!mcsun!ruuinf!piet
Telefax:   +31 30 513791   Internet:  piet@cs.ruu.nl   (*`Pete')

glenn@suphys.physics.su.OZ.AU (Glenn Geers) (11/15/90)

From article <3684@rwthinf.UUCP>, by norbert@rwthinf.UUCP (Norbert Kiesel):
> Hello,
> I'm trying to hyphenate words with imbedded hyphens ala 'subsystem-module'.
> 
> A \showhyphens{subsystem modul subsystem-modul} gives
> ``sub-sy-stem mo-dul subsystem-modul'', i.e. no hyphenation in the third word.
> 
> I'm normally working with LaTeX, but here it makes no difference. Is this a bug 
> or a feature? And if a bug, a configuration bug or a TeX bug (please send me
>  $2^x$ dollars :-) ?
> 

It's a feature. In typographical circles it is considered bad practice to 
hyphenate words that are already hyphenated. You know what I mean!
> 
> 		so long
> 
> 			Norbert

		bye
			Glenn

glenn@qed.physics.su.oz.au

--
Glenn Geers                       | "So when it's over, we're back to people.
Department of Theoretical Physics |  Just to prove that human touch can have
The University of Sydney          |  no equal."
Sydney NSW 2006 Australia         |  - Basia Trzetrzelewska, 'Prime Time TV'

hanche@imf.unit.no (Harald Hanche-Olsen) (11/15/90)

In article <1990Nov15.080527.9557@metro.ucc.su.OZ.AU> glenn@suphys.physics.su.OZ.AU (Glenn Geers) writes:

   From article <3684@rwthinf.UUCP>, by norbert@rwthinf.UUCP (Norbert Kiesel):
   [asking about TeX's unwillingness to further hyphenate subsystem-modul]

   It's a feature. In typographical circles it is considered bad practice to 
   hyphenate words that are already hyphenated. You know what I mean!

That may be true and perhaps not too hard to practice in English, but
in languages like German and the Scandinavian languages you sometimes
end up with real monstrosities where that rule must be broken.  And
you can easily make TeX break that rule, by saying things like

   subsystem\kern0pt-\hskip 0pt modul

Of course, if you need to do that often you should create a macro that
will expand to the horror in the middle of the word... 

- Harald Hanche-Olsen <hanche@imf.unit.no>
  Division of Mathematical Sciences
  The Norwegian Institute of Technology
  N-7034 Trondheim, NORWAY

gampell@hpcc01.HP.COM (Sheriff Truman) (11/16/90)

--
Glenn Geers                       | "So when it's over, we're back to people.
Department of Theoretical Physics |  Just to prove that human touch can have
The University of Sydney          |  no equal."
Sydney NSW 2006 Australia         |  - Basia Trzetrzelewska, 'Prime Time TV'
----------
                                       ^^^^^^^^^^^^^^^^^^^^

				       Not too many people quote Basia, much
				       less know how to spell her last name!
				       I'm impressed.