ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* RE: prevent hyphenation
@ 2005-05-20  3:32 Idris Samawi Hamid
  2005-05-20  7:25 ` Hans Hagen
  2005-05-20 11:35 ` Peter
  0 siblings, 2 replies; 7+ messages in thread
From: Idris Samawi Hamid @ 2005-05-20  3:32 UTC (permalink / raw)
  Cc: Hans Hagen

Hi Peter
>===== Original Message From Peter <peter@orgelvlaardingen.nl> =====
>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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: prevent hyphenation
  2005-05-20  3:32 prevent hyphenation Idris Samawi Hamid
@ 2005-05-20  7:25 ` Hans Hagen
  2005-05-20 11:35 ` Peter
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2005-05-20  7:25 UTC (permalink / raw)


Idris Samawi Hamid wrote:
> Hi Peter
> 
>>===== Original Message From Peter <peter@orgelvlaardingen.nl> =====
>>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
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: prevent hyphenation
  2005-05-20  3:32 prevent hyphenation Idris Samawi Hamid
  2005-05-20  7:25 ` Hans Hagen
@ 2005-05-20 11:35 ` Peter
  2005-05-20 12:50   ` Hans Hagen
  1 sibling, 1 reply; 7+ messages in thread
From: Peter @ 2005-05-20 11:35 UTC (permalink / raw)



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: prevent hyphenation
  2005-05-20 11:35 ` Peter
@ 2005-05-20 12:50   ` Hans Hagen
  2005-05-20 14:21     ` Taco Hoekwater
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2005-05-20 12:50 UTC (permalink / raw)


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
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: prevent hyphenation
  2005-05-20 12:50   ` Hans Hagen
@ 2005-05-20 14:21     ` Taco Hoekwater
  2005-05-20 16:08       ` Peter
  0 siblings, 1 reply; 7+ messages in thread
From: Taco Hoekwater @ 2005-05-20 14:21 UTC (permalink / raw)




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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: prevent hyphenation
  2005-05-20 14:21     ` Taco Hoekwater
@ 2005-05-20 16:08       ` Peter
  0 siblings, 0 replies; 7+ messages in thread
From: Peter @ 2005-05-20 16:08 UTC (permalink / raw)


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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* prevent hyphenation
@ 2005-05-20  1:09 Peter
  0 siblings, 0 replies; 7+ messages in thread
From: Peter @ 2005-05-20  1:09 UTC (permalink / raw)


Hi.

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.

Putting single words in a mbox also doesn't help... ;(

Tanks in advance,
Peter van Kranenburg

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-05-20 16:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-20  3:32 prevent hyphenation Idris Samawi Hamid
2005-05-20  7:25 ` Hans Hagen
2005-05-20 11:35 ` Peter
2005-05-20 12:50   ` Hans Hagen
2005-05-20 14:21     ` Taco Hoekwater
2005-05-20 16:08       ` Peter
  -- strict thread matches above, loose matches on Subject: below --
2005-05-20  1:09 Peter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).