Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!ruuinf!piet From: piet@cs.ruu.nl (Piet van Oostrum) Newsgroups: comp.text.tex Subject: Re: hyphenation with hyphens Keywords: latex tex Message-ID: <4306@ruuinf.cs.ruu.nl> Date: 14 Nov 90 11:24:36 GMT References: <3684@rwthinf.UUCP> Sender: news@ruuinf.cs.ruu.nl Reply-To: piet@cs.ruu.nl (Piet van Oostrum) Organization: Dept of Computer Science, Utrecht University, The Netherlands Lines: 28 In-reply-to: norbert@rwthinf.UUCP (Norbert Kiesel) >>>>> 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')