Hyphenation documentation
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
Am 20.04.2013 um 22:05 schrieb Sietse Brouwer
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... Wolfgang
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 -----------------------------------------------------------------
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
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 ___________________________________________________________________________________
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 -----------------------------------------------------------------
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
Am 27.04.2013 um 15:55 schrieb Marco Patzer
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
participants (4)
-
Hans Hagen
-
Marco Patzer
-
Sietse Brouwer
-
Wolfgang Schuster