Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to control the amount of automatic hyphenation in my document. But all the options I specify don't seem to have any effect. The following MWE shows two paragraphs with six hyphenated words. This happens through out the rest of the document. Any suggestions are welcome.

excessive hyphenation

Also, I would like to disable hyphenation completely in the margin text. align=flushleft still gives hyphenated words. In latex, \hyphenpenalty=10000 completely disables hyphenation.

Is there a similar option in context?

MWE

\setupbodyfont[modern,11pt]
\setuplayout[width=12cm]
\setuptolerance[horizontal,stretch]
\definefontfeature [default] [default] [expansion=quality]
\setupalign [hz]
\starttext
Various Monte Carlo methods are the most popular tool for propagating 
uncertainty during robust design and optimisation. Theoretically, Monte Carlo
methods can generate arbitrarily accurate estimates of mean and variance.
However, the convergence is slow and many engineering scenarios do not justify
the computational expense demanded by the nonlinear Monte Carlo
methods.

The proposed Inexpensive Monte Carlo (IMC) method is a cost efficient
alternative to the nonlinear Monte Carlo method under certain assumptions.
Judicious use of IMC method can greatly speed-up uncertainty propagation for 
robust design algorithms. This chapter outlines motivation behind the proposed
IMC method. Probable application areas are identified along with a survey 
of various alternative methods available presently. 
The basic formulation of IMC method is presented. The 
implementation details and the effectiveness of the methods are explored using a
simple algebraic model problem. The limitations of the IMC method are also
demonstrated in a clear fashion using the model problem. Finally, the last
section compares performance of the proposed IMC methods with the more
traditional moment methods for the model problem.
\stoptext
share|improve this question
    
\hyphenpenalty10000 works in ConTeXt as well. The native ConTeXt way to suppress hyphenation is \setupalign[nothyphenated]. –  Marco Jan 14 '13 at 20:36
    
@Marco Thanks. I forgot that \hyphenpenalty1000 comes from tex. I checked, this works, though a bit ugly in the main text. How would I use \setupalign only for margins? –  devendra Jan 14 '13 at 20:46
    
@Marco I am using \margintext. –  devendra Jan 14 '13 at 20:47
    
See also: wiki.contextgarden.net/Command/setupalign –  Dave Jarvis Sep 26 '13 at 6:19
add comment

3 Answers

up vote 3 down vote accepted
[...]
\setupalign [hz]    
\lefthyphenmin=4
\starttext
[...]

enter image description here

share|improve this answer
    
Thanks. This is definitely an improvement. –  devendra Jan 14 '13 at 21:32
2  
The ConTeXt interface for lefthyphenmin is \setuplanguage[en][lefthyphenmin=4], see ConTeXt wiki - setuplanguage. –  Marco Jan 14 '13 at 22:51
    
that is only needed if you want language specific setting. It is the same as for LaTeX with setting it whith or without babel –  Herbert Jan 15 '13 at 17:29
add comment

You can use \hyphenpenalty1000 in ConTeXt as well. However, the native ConTeXt way to suppress hyphenation is to use

\setupalign [nothyphenated]

To suppress hyphenation only for \margintext you use the command \setupmargindata

\setupmargindata
  [margintext]
  [align=nothyphenated]

To apply several keys to align separate them with a comma and surround with braces:

\setupmargindata
  [margintext]
  [align={nothyphenated, flushright}]
share|improve this answer
add comment

As Herbert said, you can try to change the value of lefthyphenmin. If you are using a multi-lingual document, you can change the value of lefthyphenmin for each language.

\setuplanguage[en][lefthyphenmin=4]
\setuplanguage[de][lefthyphenmin=3]

ConTeXt also defines two macros: \lesshypens and \morehyphens, which respectively increase and decrease the value of both lefthyphenmin and righthyphenmin.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.