RE: [NTG-context] prevent hyphenation
Hi Peter
===== Original Message From Peter
===== I'm typesetting a text with some citations in nineteenth-century Dutch and French, in which I don't want hyphenation. How can this be done? I now have two macros: \def\stophyph{\pretolerance=15000\tolerance=400} \def\starthyph{\pretolerance=200\tolerance=400}
At the beginning of every citation I enter \stophyph{} and at the end \starthyph{}. But the cited words are still hyphenated.
Here is a better approach: ================================================== \setupoutput[pdftex]% \installlanguage[NH][lefthyphenmin=100,righthyphenmin=100] \starttext \language[NH] \input knuth \language[en] \input knuth \stoptext ================================================== Even better, take the definition of [nl] in type-ger.tex and add it to \installlanguage[NH]. Hans: the following would be nice to have: \setuplanguage[<name>][hyphenation=off]
Putting single words in a mbox also doesn't help... ;(
mbox?!? Dost thou blaspheme!?! :-) Best Idris ============================ Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523
Idris Samawi Hamid wrote:
Hi Peter
===== Original Message From Peter
===== I'm typesetting a text with some citations in nineteenth-century Dutch and French, in which I don't want hyphenation. How can this be done? I now have two macros: \def\stophyph{\pretolerance=15000\tolerance=400} \def\starthyph{\pretolerance=200\tolerance=400}
At the beginning of every citation I enter \stophyph{} and at the end \starthyph{}. But the cited words are still hyphenated.
Here is a better approach:
================================================== \setupoutput[pdftex]%
\installlanguage[NH][lefthyphenmin=100,righthyphenmin=100]
\starttext
\language[NH]
\input knuth
\language[en]
\input knuth
\stoptext
==================================================
Even better, take the definition of [nl] in type-ger.tex and add it to \installlanguage[NH].
Hans: the following would be nice to have:
\setuplanguage[<name>][hyphenation=off]
i must think this over, since normally when a language has no patterns it's off anyway \definelanguage[mine][default=en,patterns=] not sure if that works as expected
Putting single words in a mbox also doesn't help... ;(
mbox?!? Dost thou blaspheme!?! :-)
-) how about using \setupalign[nothyphenated] (or \nohyphens) btw, i recently saw things like there was this guy called \hbox {Idris} ... (another 10 times this hbox) where of course the best solution is \hyphenation{Idris} at the top of your document, i.e. add such names to the dictionary but do not provide ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Idris Samawi Hamid wrote:
\installlanguage[NH][lefthyphenmin=100,righthyphenmin=100]
Thanks. Block quotes are ok now. But this case is not: ... het \taal[NH]{\it Département de l'Escaut}\taal[nl] was tegen de plannen gekant ... In the output, Dé-partement is still being hyphenated. Only when I put the \taal[NH] at the beginning of the paragraph, Département isn't hyphenated. Of course I can add \hyphenation{Département} in the environment, or use \nohyphens{Département} (thanks, Hans), but it is too much work to do this for all words in all citations and names. I'm typesetting a large (still changing) text, so I prefer a solution that automatically takes care of this.
mbox?!? Dost thou blaspheme!?! :-)
mea culpa :o greetings, Peter
Peter wrote:
Idris Samawi Hamid wrote:
\installlanguage[NH][lefthyphenmin=100,righthyphenmin=100]
Thanks. Block quotes are ok now.
But this case is not:
... het \taal[NH]{\it Département de l'Escaut}\taal[nl] was tegen de plannen gekant ...
In the output, Dé-partement is still being hyphenated. Only when I put the \taal[NH] at the beginning of the paragraph, Département isn't hyphenated.
Of course I can add \hyphenation{Département} in the environment, or use \nohyphens{Département} (thanks, Hans), but it is too much work to do this for all words in all citations and names. I'm typesetting a large (still changing) text, so I prefer a solution that automatically takes care of this.
question for taco: how exactly does tex treat language changes mid paragraph? 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 -----------------------------------------------------------------
Hans Hagen wrote:
Peter wrote:
Idris Samawi Hamid wrote:
\installlanguage[NH][lefthyphenmin=100,righthyphenmin=100]
question for taco: how exactly does tex treat language changes mid paragraph?
That would take me too much time to write down :-), but I can tell you that this \installlanguage didn't work because \lefthyphenmin and \righthyphenmin are 'global' during the course of the paragraph, only the final value is used (like for most paragraph parameters). What will work, is setting the TeX primitive \language to a value that does not have associated patterns (-1 is a possibility, but usually 255 also works). In the next bit of context code, there will be no hyphenation: \starttext \normallanguage -1 \hsize = 0pt \input zapf \language[en] \stoptext (babel has a language definition 'nohyph', precisely for this) Hope this helps, Taco
Taco Hoekwater wrote:
What will work, is setting the TeX primitive \language to a value that does not have associated patterns (-1 is a possibility, but usually 255 also works). In the next bit of context code, there will be no hyphenation:
\starttext \normallanguage -1 \hsize = 0pt \input zapf \language[en] \stoptext
(babel has a language definition 'nohyph', precisely for this)
Hope this helps,
I now have: \definieer\stophyph{\bgroup\normallanguage-1} \definieer\starthyph{\egroup} Now I say \stophyph right before a citation and \starthyph right after it. This seems to work. Maybe not an elegant solution, but I'm happy. Tanks! Peter.
Taco
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
participants (4)
-
Hans Hagen
-
Idris Samawi Hamid
-
Peter
-
Taco Hoekwater