ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Hyphenation documentation
@ 2013-04-20 20:05 Sietse Brouwer
  2013-04-21  8:26 ` Wolfgang Schuster
  2013-04-27 13:55 ` Marco Patzer
  0 siblings, 2 replies; 7+ messages in thread
From: Sietse Brouwer @ 2013-04-20 20:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello all,

I've just pulled together some questions of mine and their answers,
and written them up into a hyphenation Q&A.
http://wiki.contextgarden.net/Hyphenation
http://wiki.contextgarden.net/Command/definebreakpoint

Unfortunately, there are still some holes in the documentation I
wrote. Questions I still have, and which I now pose to the list:

1. how do I protect a single instance of a word against hyphenation?
Does ConTeXt, like LaTeX, use \hbox{myfragileword}, or something
different?

2. In the command \definebreakpoint, what do these keys do? I can't
get them to do anything (MWE below)
** left
** middle
** right

3. Is there perhaps a bug in breakpoints of type 2 and 3. (MWE below.)
The key 'type' seems to control where hyphens appear. If 1 is a
hyphenation character of type 1, etc, this is the observed behaviour
(`/` is the linebreak):
...1...1  / ...
...2...   / 2-...   % I would expect: ...2... / -2...
...3...-3 / ...     % I would expect: ...3...3- / ...
...4...4  / 4...
......    / ...     % breakpoint of type 5 just disappears

If this behaviour is not a bug: is there a way to set a breakpoint X
that produces ...X...X- / ...?

Cheers,
Sietse

% 2013-04-20
\definebreakpoints[aapje]
\definebreakpoint [aapje] [1] [nleft=3,nright=3,type=1]
\definebreakpoint [aapje] [2] [nleft=3,nright=3,type=2]
\definebreakpoint [aapje] [3] [nleft=3,nright=3,type=3]
\definebreakpoint [aapje] [4] [nleft=3,nright=3,type=4]
\definebreakpoint [aapje] [5] [nleft=3,nright=3,type=5]
\definebreakpoint [aapje] [6] [nleft=3,nright=3,left=X,middle=Y,right=Z]
\setbreakpoints[aapje]

\setuppapersize[A7]
\showframe

\starttext

\setupwhitespace[big]
aapje1aapje1aapje1aapje1aapje1aapje1aapje \par
aapje2aapje2aapje2aapje2aapje2aapje2aapje \par
aapje3aapje3aapje3aapje3aapje3aapje3aapje \par
aapje4aapje4aapje4aapje4aapje4aapje4aapje \par
aapje5aapje5aapje5aapje5aapje5aapje5aapje \par
aapje6aapje6aapje6aapje6aapje6aapje6aapje \par
\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Hyphenation documentation
  2013-04-20 20:05 Hyphenation documentation Sietse Brouwer
@ 2013-04-21  8:26 ` Wolfgang Schuster
  2013-04-21 10:43   ` Hans Hagen
  2013-04-27 13:55 ` Marco Patzer
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2013-04-21  8:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 20.04.2013 um 22:05 schrieb Sietse Brouwer <sbbrouwer@gmail.com>:

> Hello all,
> 
> I've just pulled together some questions of mine and their answers,
> and written them up into a hyphenation Q&A.
> http://wiki.contextgarden.net/Hyphenation
> http://wiki.contextgarden.net/Command/definebreakpoint
> 
> Unfortunately, there are still some holes in the documentation I
> wrote. Questions I still have, and which I now pose to the list:
> 
> 1. how do I protect a single instance of a word against hyphenation?
> Does ConTeXt, like LaTeX, use \hbox{myfragileword}, or something
> different?

No, you have to use \hbox too but I think a command with a speaking
name would be better.

> 2. In the command \definebreakpoint, what do these keys do? I can't
> get them to do anything (MWE below)
> ** left
> ** middle
> ** right

The left, right and middle keys are used in combination with “type=5”.

\definebreakpoints[test]

\definebreakpoint [test] [?] [type=5,left=L,right=R,middle=M]

\setbreakpoints[test]

\setuppapersize[A7]

\starttext \showframe
xxxx?xxxx?xxxx?xxxx?xxxx?xxxx?xxxx?xxxx\par
\stoptext

> 3. Is there perhaps a bug in breakpoints of type 2 and 3. (MWE below.)
> The key 'type' seems to control where hyphens appear. If 1 is a
> hyphenation character of type 1, etc, this is the observed behaviour
> (`/` is the linebreak):
> ...1...1  / ...
> ...2...   / 2-...   % I would expect: ...2... / -2...
> ...3...-3 / ...     % I would expect: ...3...3- / ...
> ...4...4  / 4...
> ......    / ...     % breakpoint of type 5 just disappears

Type 2 and 3 are used for braces to have line breaks which produce

   (xxx-)
   xxx

and

   xxx
   (-xxx)

> If this behaviour is not a bug: is there a way to set a breakpoint X
> that produces ...X...X- / …?


You have to use type 5 to create a rule for this, do you have a example
where this is needed besides the one mentioned in the duden [1] example
for a closing bracket.

[1] http://www.duden.de/sprachwissen/sprachratgeber/klammern-und-bindestrich-bei-der-worttrennung

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Hyphenation documentation
  2013-04-21  8:26 ` Wolfgang Schuster
@ 2013-04-21 10:43   ` Hans Hagen
  2013-04-21 17:27     ` Sietse Brouwer
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2013-04-21 10:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/21/2013 10:26 AM, Wolfgang Schuster wrote:

 > No, you have to use \hbox too but I think a command with a speaking
> name would be better.

\unexpanded\def\unhyphenated
   {\groupedcommand{\lefthyphenmin\maxdimen}\donothing}

I'll add that.

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Hyphenation documentation
  2013-04-21 10:43   ` Hans Hagen
@ 2013-04-21 17:27     ` Sietse Brouwer
  2013-04-21 20:24       ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Sietse Brouwer @ 2013-04-21 17:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Wolfgang, hi Hans,

Thanks, I've updated the documentation accordingly.

> You have to use type 5 to create a rule for this,
> do you have a example where this is needed besides
> the one mentioned in the duden [1] example for a
> closing bracket.

No, this was just a gut reaction. I can see the sense of the other
way, too, and I couldn't hope to compete with the Duden for authority.
;-)

> \unexpanded\def\unhyphenated
>   {\groupedcommand{\lefthyphenmin\maxdimen}\donothing}

\unhyphenated also documented. The name is inconsistent with
\setupalign[nothyphenated];
perhaps \nothyphenated is a better name? (You could also add it as a
synonym, but it is cleaner to have only one name, I think.)

Cheers,
Sietse

On 21 April 2013 12:43, Hans Hagen <pragma@wxs.nl> wrote:
> On 4/21/2013 10:26 AM, Wolfgang Schuster wrote:
>
>> No, you have to use \hbox too but I think a command with a speaking
>>
>> name would be better.
>
>
> \unexpanded\def\unhyphenated
>   {\groupedcommand{\lefthyphenmin\maxdimen}\donothing}
>
> I'll add that.
>
> Hans
>
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Hyphenation documentation
  2013-04-21 17:27     ` Sietse Brouwer
@ 2013-04-21 20:24       ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2013-04-21 20:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/21/2013 7:27 PM, Sietse Brouwer wrote:
> Hi Wolfgang, hi Hans,
>
> Thanks, I've updated the documentation accordingly.
>
>> You have to use type 5 to create a rule for this,
>> do you have a example where this is needed besides
>> the one mentioned in the duden [1] example for a
>> closing bracket.
>
> No, this was just a gut reaction. I can see the sense of the other
> way, too, and I couldn't hope to compete with the Duden for authority.
> ;-)
>
>> \unexpanded\def\unhyphenated
>>    {\groupedcommand{\lefthyphenmin\maxdimen}\donothing}
>
> \unhyphenated also documented. The name is inconsistent with
> \setupalign[nothyphenated];
> perhaps \nothyphenated is a better name? (You could also add it as a
> synonym, but it is cleaner to have only one name, I think.)

that would be more like a directive: {.. \nothyphenated ...}

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Hyphenation documentation
  2013-04-20 20:05 Hyphenation documentation Sietse Brouwer
  2013-04-21  8:26 ` Wolfgang Schuster
@ 2013-04-27 13:55 ` Marco Patzer
  2013-04-27 14:35   ` Wolfgang Schuster
  1 sibling, 1 reply; 7+ messages in thread
From: Marco Patzer @ 2013-04-27 13:55 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 392 bytes --]

On 2013–04–20 Sietse Brouwer wrote:

> 1. how do I protect a single instance of a word against hyphenation?
> Does ConTeXt, like LaTeX, use \hbox{myfragileword}, or something
> different?

You can enclose it in vertical bars:

  |thiswordwillnotbehyphenated|

However, I'd prefer the new \unhyphenated command, it's declarative
and doesn't interfere with \asciimode.

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Hyphenation documentation
  2013-04-27 13:55 ` Marco Patzer
@ 2013-04-27 14:35   ` Wolfgang Schuster
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2013-04-27 14:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 27.04.2013 um 15:55 schrieb Marco Patzer <homerow@lavabit.com>:

> On 2013–04–20 Sietse Brouwer wrote:
> 
>> 1. how do I protect a single instance of a word against hyphenation?
>> Does ConTeXt, like LaTeX, use \hbox{myfragileword}, or something
>> different?
> 
> You can enclose it in vertical bars:
> 
>  |thiswordwillnotbehyphenated|

Even though this works it’s only side effect of the |…| and not meant to have a unbreakable word.

The |…| commands are the old method to have line breaks after certain symbols and can in most cases be replaced with \setbreakpoint etc.

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2013-04-27 14:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-20 20:05 Hyphenation documentation Sietse Brouwer
2013-04-21  8:26 ` Wolfgang Schuster
2013-04-21 10:43   ` Hans Hagen
2013-04-21 17:27     ` Sietse Brouwer
2013-04-21 20:24       ` Hans Hagen
2013-04-27 13:55 ` Marco Patzer
2013-04-27 14:35   ` Wolfgang Schuster

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