[texhax] Preserving dash when hyphenating compound words

hh-brasil at bol.com.br hh-brasil at bol.com.br
Mon Aug 30 13:43:53 CEST 2010


Wasn´t there once a german TeX with solutions to this and similar cases.
hh



Em 29/08/2010 07:00, texhax-request at tug.org escreveu:
To subscribe or unsubscribe via the World Wide Web, visit
	http://tug.org/mailman/listinfo/texhax
or, via email, send a message with subject or body 'help' to
	texhax-request at tug.org

You can reach the person managing the list at
	texhax-owner at tug.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of texhax digest..."


Today's Topics:

   1. Re: Preserving dash when hyphenating compound words (Uwe Lueck)


----------------------------------------------------------------------

Message: 1
Date: Sat, 28 Aug 2010 14:22:18 +0200 (CEST)
From: Uwe Lueck 
To: Aleksandar Zec 
Cc: texhax at tug.org
Subject: Re: [texhax] Preserving dash when hyphenating compound words
Message-ID: 
Content-Type: text/plain; charset=UTF-8

Hello Alex,

Aleksandar Zec , 27.08.2010 21:41:03
>2010/8/19 Uwe Lueck :
>[...]
>> \hyp or that macro it calls according to the hyphenat documentation might be redefined (about as follows) or you use some \dhyp or so instead of \hyp with
>>
>> ? ?\newcommand{\dhyp}{\discretionary{-}{-}{-}}
>>
>> (not tested, sorry; if it works, why use hyphenat?) cf. TeXbook on \discretionary.
>
>This \dhyp indeed produces intended additional dash, but it disables
>hyphenation of compound words. I actually need
>
>straw-chop-
>per
>
>straw-
>-chopper

you are right, I didn't think of this. 

>and hyphenat's \BreakableHyphen serves this purpose. So, some
>experimenting shows that this code gives good results in all cases:
>
>------------------------------------------------------
>\documentclass{article}
>\usepackage{hyphenat}
>\newcommand{\dhyp}{\discretionary{-}{}{}%
>  \ifmmode-\else\BreakableHyphen\fi}
>\begin{document}
>\noindent\fbox{%
>\begin{minipage}{2cm}%
>and electroencephalography\\
>straw\dhyp{}chopper\\
>\hspace*{1.1cm}straw\dhyp{}chopper
>\end{minipage}%
>}
>\end{document}
>------------------------------------------------------
>
>Not very elegant, though.

I should be able to find a more elegant solution, once I studied these things -- but must do other things right now.

Cheers,

    Uwe.



------------------------------

_______________________________________________
texhax mailing list
texhax at tug.org
http://tug.org/mailman/listinfo/texhax

End of texhax Digest, Vol 2010, Issue 329
*****************************************



More information about the texhax mailing list