ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* suppressing hyphenation
@ 2003-01-15  2:33 Adam Lindsay
  2003-01-15  8:33 ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Adam Lindsay @ 2003-01-15  2:33 UTC (permalink / raw)


Hi all,

Sorry if this has been covered before, but does anyone know a ConTeXt-y
(i.e., elegant) way of suppressing hyphenation for a block of text?

I'm dealing with long chapter headings, and I would rather set them
ragged and without hyphenation.

I've made tentative experiments with the techniques described here, but
to no avail. I tried making a new language [zz] that grabs the
zerohyph.tex hyphenation file. TeX complains about seeing a \pattern
outside of initex, but it did have the effect of eliminating all
hyphenation in my document, which was a bit more than I bargained for.

Has anyone done this successfully? No? Should I continue trying the language?

Cheers,
adam

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Adam Lindsay                  +44(0)1524 594 537
 atl@comp.lancs.ac.uk
 http://www.comp.lancs.ac.uk/computing/users/atl/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

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

* Re: suppressing hyphenation
  2003-01-15  2:33 suppressing hyphenation Adam Lindsay
@ 2003-01-15  8:33 ` Hans Hagen
  2003-01-15 10:49   ` Adam Lindsay
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2003-01-15  8:33 UTC (permalink / raw)


At 02:33 AM 1/15/2003 +0000, you wrote:
>Hi all,
>
>Sorry if this has been covered before, but does anyone know a ConTeXt-y
>(i.e., elegant) way of suppressing hyphenation for a block of text?
>
>I'm dealing with long chapter headings, and I would rather set them
>ragged and without hyphenation.
>
>I've made tentative experiments with the techniques described here, but
>to no avail. I tried making a new language [zz] that grabs the
>zerohyph.tex hyphenation file. TeX complains about seeing a \pattern
>outside of initex, but it did have the effect of eliminating all
>hyphenation in my document, which was a bit more than I bargained for.
>
>Has anyone done this successfully? No? Should I continue trying the language?

did you try:

   \nohyphens

or

   \setupalign[nothyphenated]


-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* Re: suppressing hyphenation
  2003-01-15  8:33 ` Hans Hagen
@ 2003-01-15 10:49   ` Adam Lindsay
  2003-01-15 11:39     ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Adam Lindsay @ 2003-01-15 10:49 UTC (permalink / raw)


Hello again, Hans.

I believe Hans Hagen said this around Wed, 15 Jan 2003:

>>I'm dealing with long chapter headings, and I would rather set them
>>ragged and without hyphenation.
>
>did you try:
>
>   \nohyphens

Sigh. 
No. I guessed \nohyp \nohyphen and \nohyphenation, but the obvious eluded
me. Is that anywhere in the normal docs? Sorry.

Anyway, that one gets me most of the way there. However, the text block
is currently inside a \framed, which doesn't understand any of the
variants of this:

>   \setupalign[nothyphenated]

...as a result (as I interpret it), these ragged-left headings overshoot
the right margin, presumably because it would "cost" more than growing
vertically. The normal paragraph penalties shouldn't matter in these titles.

Currently I can work around by hand-breaking the titles before
"problematic" words to achieve this (simulation in fixed-width font):

              Perceptual
       Dissimilarity and
        Verbal Attribute
         Ratings of Oboe
                Tones I:
     an investigation of
tones at different pitch
      and dynamic levels

Instead of the automatic:

 Perceptual Dissimilarity
    and Verbal Attribute
  Ratings of Oboe Tones I:
     an investigation of
tones at different pitch
      and dynamic levels


Thanks for setting me on the right path!

adam


--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Adam Lindsay                  +44(0)1524 594 537
 atl@comp.lancs.ac.uk
 http://www.comp.lancs.ac.uk/computing/users/atl/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

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

* Re: suppressing hyphenation
  2003-01-15 10:49   ` Adam Lindsay
@ 2003-01-15 11:39     ` Hans Hagen
  2003-01-16 11:18       ` Adam Lindsay
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2003-01-15 11:39 UTC (permalink / raw)
  Cc: ntg-context

At 10:49 AM 1/15/2003 +0000, you wrote:
>Hello again, Hans.
>
>I believe Hans Hagen said this around Wed, 15 Jan 2003:
>
> >>I'm dealing with long chapter headings, and I would rather set them
> >>ragged and without hyphenation.
> >
> >did you try:
> >
> >   \nohyphens
>
>Sigh.
>No. I guessed \nohyp \nohyphen and \nohyphenation, but the obvious eluded
>me. Is that anywhere in the normal docs? Sorry.
>
>Anyway, that one gets me most of the way there. However, the text block
>is currently inside a \framed, which doesn't understand any of the
>variants of this:
>
> >   \setupalign[nothyphenated]
>
>...as a result (as I interpret it), these ragged-left headings overshoot
>the right margin, presumably because it would "cost" more than growing
>vertically. The normal paragraph penalties shouldn't matter in these titles.
>
>Currently I can work around by hand-breaking the titles before
>"problematic" words to achieve this (simulation in fixed-width font):

\framed[align={nothyphenated,middle},width=4cm] {
>               Perceptual
>        Dissimilarity and
>         Verbal Attribute
>          Ratings of Oboe
>                 Tones I:
>      an investigation of
>tones at different pitch
>       and dynamic levels
>
>Instead of the automatic:
>
>  Perceptual Dissimilarity
>     and Verbal Attribute
>   Ratings of Oboe Tones I:
>      an investigation of
>tones at different pitch
>       and dynamic levels
}

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* Re: suppressing hyphenation
  2003-01-16 13:51             ` Hans Hagen
@ 2003-01-16 10:33               ` John Culleton
  2003-01-16 15:52                 ` Duncan Hothersall
  2003-01-16 16:04                 ` Hans Hagen
  0 siblings, 2 replies; 12+ messages in thread
From: John Culleton @ 2003-01-16 10:33 UTC (permalink / raw)


On Thursday 16 January 2003 13:51, Hans Hagen wrote:
> At 01:36 PM 1/16/2003 +0000, you wrote:
> > > or {left,nothyphenated,width} or
> >
> >It still hyphenates, with no visible difference from the above case.
>
> i'll look info it, should work
>
> Hans
Has anyone tried the plain TeX solution:

\def\raggedright{\rightskip=0pt plus 2em
 \spaceskip=.3333em \xspaceskip=.5em\relax}

 ??


John Culleton
Able Indexers and Typesetters 
Rowse Reviews
Culleton Editorial Services
http://wexfordpress.com

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

* Re: suppressing hyphenation
  2003-01-15 11:39     ` Hans Hagen
@ 2003-01-16 11:18       ` Adam Lindsay
  2003-01-16 11:37         ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Adam Lindsay @ 2003-01-16 11:18 UTC (permalink / raw)


I believe Hans Hagen said this around Wed, 15 Jan 2003:

>>Currently I can work around by hand-breaking the titles before
>>"problematic" words to achieve this (simulation in fixed-width font):
>
>\framed[align={nothyphenated,middle},width=4cm] {}

Hmm. Yes, middle refuses to break words. In my experiments, it doesn't
matter whether or not "nothyphenated" is there as a keyword. However, I'm
absolutely stumped as to how to translate those ideal "middle" line
breaks to left-ragged text. This is as for as I've gotten:

\framed[offset=none,align={left},width=4.2cm] {\nohyphens%
%\setuptolerance[stretch]%
Perceptual Dissimilarity and Verbal Attribute Ratings of Oboe Tones~I: \\
an investigation of tones at different pitch and dynamic levels }

In this particular case, uncommenting the stretch tolerance is enough to
make the overfull first line go away. However, with the actual chapter
title format I'm using, even \setuptolerance[stretch] is not enough to
defeat the overfull lines I get.

Thanks,
adam

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Adam Lindsay                  +44(0)1524 594 537
 atl@comp.lancs.ac.uk
 http://www.comp.lancs.ac.uk/computing/users/atl/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

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

* Re: suppressing hyphenation
  2003-01-16 11:18       ` Adam Lindsay
@ 2003-01-16 11:37         ` Hans Hagen
  2003-01-16 13:36           ` Adam Lindsay
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2003-01-16 11:37 UTC (permalink / raw)


At 11:18 AM 1/16/2003 +0000, you wrote:
>I believe Hans Hagen said this around Wed, 15 Jan 2003:
>
> >>Currently I can work around by hand-breaking the titles before
> >>"problematic" words to achieve this (simulation in fixed-width font):
> >
> >\framed[align={nothyphenated,middle},width=4cm] {}
>
>Hmm. Yes, middle refuses to break words. In my experiments, it doesn't
>matter whether or not "nothyphenated" is there as a keyword. However, I'm
>absolutely stumped as to how to translate those ideal "middle" line
>breaks to left-ragged text. This is as for as I've gotten:
>
>\framed[offset=none,align={left},width=4.2cm] {\nohyphens%
>%\setuptolerance[stretch]%
>Perceptual Dissimilarity and Verbal Attribute Ratings of Oboe Tones~I: \\
>an investigation of tones at different pitch and dynamic levels }

doesn't {left,nothyphenated} work ok? or {left,nothyphenated,width} or 
{left,nothyphenated,broad}

H
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* Re: suppressing hyphenation
  2003-01-16 11:37         ` Hans Hagen
@ 2003-01-16 13:36           ` Adam Lindsay
  2003-01-16 13:51             ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Adam Lindsay @ 2003-01-16 13:36 UTC (permalink / raw)
  Cc: Rosemary Fitzgerald

Hans Hagen said this at Thu, 16 Jan 2003 12:37:08 +0100:

>>Hmm. Yes, middle refuses to break words. In my experiments, it doesn't
>>matter whether or not "nothyphenated" is there as a keyword.
>
>doesn't {left,nothyphenated} work ok?

It hyphenates.

> or {left,nothyphenated,width} or 

It still hyphenates, with no visible difference from the above case.

>{left,nothyphenated,broad}

Magic. It works just as I wanted it to. No hyphenation, and no overfull
lines. Thanks!

All this was while using a beta from November. I just upgraded right now
(just. in. case.) ... and it still acts exactly as I report.

Sorry that this was such a tough nut to crack, but thanks for sticking
with the problem.

There's a small (14kb) PDF here as an illustration of the results I got:
    <http://homepage.mac.com/atl/tex/frame-hyp.pdf>
    <http://homepage.mac.com/atl/tex/frame-hyp.tex>

Many thanks yet again, Hans,
adam

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay                      atl@comp.lancs.ac.uk
 Computing Dept, Lancaster University   +44(0)1524/594.537
 Lancaster, LA1 4YR, UK             Fax:+44(0)1524/593.608
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

* Re: suppressing hyphenation
  2003-01-16 13:36           ` Adam Lindsay
@ 2003-01-16 13:51             ` Hans Hagen
  2003-01-16 10:33               ` John Culleton
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2003-01-16 13:51 UTC (permalink / raw)


At 01:36 PM 1/16/2003 +0000, you wrote:

> > or {left,nothyphenated,width} or
>
>It still hyphenates, with no visible difference from the above case.

i'll look info it, should work

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* RE: suppressing hyphenation
  2003-01-16 10:33               ` John Culleton
@ 2003-01-16 15:52                 ` Duncan Hothersall
  2003-01-16 16:11                   ` Hans Hagen
  2003-01-16 16:04                 ` Hans Hagen
  1 sibling, 1 reply; 12+ messages in thread
From: Duncan Hothersall @ 2003-01-16 15:52 UTC (permalink / raw)


John Culleton wrote:
> Has anyone tried the plain TeX solution:
>
> \def\raggedright{\rightskip=0pt plus 2em
>  \spaceskip=.3333em \xspaceskip=.5em\relax}
>
>  ??

I doubt it, because (a) the plain method of adding 2 ems worth of shrinkable
space fails in a lot of circumstances, and given that ConTeXt has some
complexity behind it you can never be sure exactly what circumstance you're
in, and (b) the above produces left-aligned, not right-aligned text.

:)

Duncan
dh@capdm.com

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

* Re: suppressing hyphenation
  2003-01-16 10:33               ` John Culleton
  2003-01-16 15:52                 ` Duncan Hothersall
@ 2003-01-16 16:04                 ` Hans Hagen
  1 sibling, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2003-01-16 16:04 UTC (permalink / raw)
  Cc: ntg-context

At 10:33 AM 1/16/2003 +0000, you wrote:
>On Thursday 16 January 2003 13:51, Hans Hagen wrote:
> > At 01:36 PM 1/16/2003 +0000, you wrote:
> > > > or {left,nothyphenated,width} or
> > >
> > >It still hyphenates, with no visible difference from the above case.
> >
> > i'll look info it, should work
> >
> > Hans
>Has anyone tried the plain TeX solution:
>
>\def\raggedright{\rightskip=0pt plus 2em
>  \spaceskip=.3333em \xspaceskip=.5em\relax}

have you tried the context

\raggedright
\raggedcenter
\raggedleft
\veryraggedright
etc

-)


-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* RE: suppressing hyphenation
  2003-01-16 15:52                 ` Duncan Hothersall
@ 2003-01-16 16:11                   ` Hans Hagen
  0 siblings, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2003-01-16 16:11 UTC (permalink / raw)


At 03:52 PM 1/16/2003 +0000, you wrote:
>John Culleton wrote:
> > Has anyone tried the plain TeX solution:
> >
> > \def\raggedright{\rightskip=0pt plus 2em
> >  \spaceskip=.3333em \xspaceskip=.5em\relax}
> >
> >  ??
>
>I doubt it, because (a) the plain method of adding 2 ems worth of shrinkable
>space fails in a lot of circumstances, and given that ConTeXt has some
>complexity behind it you can never be sure exactly what circumstance you're
>in, and (b) the above produces left-aligned, not right-aligned text.
>
>:)

therefore ... the context low level \raggedright is indeed more complex, 
and takes care of things like narrow typesetting as well,

Hans



-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

end of thread, other threads:[~2003-01-16 16:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-15  2:33 suppressing hyphenation Adam Lindsay
2003-01-15  8:33 ` Hans Hagen
2003-01-15 10:49   ` Adam Lindsay
2003-01-15 11:39     ` Hans Hagen
2003-01-16 11:18       ` Adam Lindsay
2003-01-16 11:37         ` Hans Hagen
2003-01-16 13:36           ` Adam Lindsay
2003-01-16 13:51             ` Hans Hagen
2003-01-16 10:33               ` John Culleton
2003-01-16 15:52                 ` Duncan Hothersall
2003-01-16 16:11                   ` Hans Hagen
2003-01-16 16:04                 ` Hans Hagen

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