David Antos wrote:
        Hello,

would it be possible to define || for compound words to act as
\discretionary{-}{-}{-}? In Czech, the hyphen for compound words should
be repeated in the following line.

you mean something like this:

\unprotect

\def\activedododotextmodediscretionary#1#2%
  {\convertargument#2\to\discretionarytoken
   \def\textmodediscretionary%
     {\getvalue{\strippedcsname\textmodediscretionary\string#1}}%
   \ifx\discretionarytoken\empty
     \ifx#1\nextnext % takes care of ||| and +++ and ......
       \prewordbreak\discretionary{\hbox{$#1$}}{}{\hbox{$#1$}}%
       \allowbreak\postwordbreak
       \def\nextnextnext{\afterassignment\egroup\let\next=}%
     \else
       \checkafterdiscretionary
       \bgroup
         \checkbeforediscretionary
         \textmodediscretionary\nextnext
       \egroup
     \fi
   [EMAIL PROTECTED]@\discretionarytoken\endcsname\relax
     \checkafterdiscretionary
     \bgroup
       \checkbeforediscretionary
       \prewordbreak
       \discretionary{\hbox{#2}}{}{\hbox{#2}}%
       \allowbreak\postwordbreak
     \egroup
   \else
     [EMAIL PROTECTED]@\discretionarytoken\endcsname
   \fi\fi
   \nextnextnext} % can be \egroup so \aftergroup\ignorespaces

\startlanguagespecifics[cz]

  \setvalue{\strippedcsname\textmodediscretionary\string|}%
    {\discretionary{-}{-}{-}}%

\stoplanguagespecifics

\setvalue{\strippedcsname\textmodediscretionary\string|}%
  {\prewordbreak\hbox{\compoundhyphen}\allowbreak\postwordbreak}

\protect

\starttext

\en \dorecurse{100}{test||}test \endgraf
\cz \dorecurse{100}{test||}test \endgraf

\stoptext


so, in principle it is possible but i need to make it a bit nicer; maybe tonight -)

Hans


----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
[email protected]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to