View Issue Details

IDProjectCategoryView StatusLast Update
0000930luatexfeature requestpublic2015-10-06 16:07
Reportereroux Assigned ToHans Hagen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.79.1 
Fixed in Version0.80.1 
Summary0000930: Add \totalhyphenmin to prevent hyphenation of small words
DescriptionIn many languages, small words shouldn't be hyphenated, and this is not always possible with \left/righthyphenmin. For instance, most languages (Spanish for example) won't hyphenate words of 4 letters or less, but would like to have \left/righthyphenmin = 2.

Example of the desired hyphenation: "come" (no hyphen), "co-mi-da".

If \left/righthyphenmin == 2, this will hyphen "co-me" (which is not the desired behaviour), and with \left/righthyphemin == 3, it will not hyphen "comida".

Currently it doesn't seem possible to have the desired behaviour. The request would be to add \totalhyphenmin (name to be discussed of course), that would set the minimal character length of a word to be hyphenated. In the example, having \totalhyphenmin = 4 and \left/righthyphenmin = 2 would make the right output.

For the record, LibreOffice has a similar option.
TagsNo tags attached.

Activities

eroux

2015-04-08 11:29

reporter   ~0001352

Last edited: 2015-04-08 12:20

Trying to build a patch, the lang_data structure seems to be full. There is:

 - 1 bit for uchyph
 - 15 bits for lang
 - 8 bits for lefthyphenmin
 - 8 bits for righthyphenmin

What would be the best solution to insert totalhyphenmin? Would it seem reasonable to have

 - 1 bit for uchyph
 - 13 bits for lang
 - 6 bits for lefthyphenmin
 - 6 bits for righthyphenmin
 - 6 bits for totalhyphenmin

?

eroux

2015-04-09 10:06

reporter   ~0001353

Last edited: 2015-04-09 10:07

Another (better I belive) idea from

http://tug.org/pipermail/tex-hyphen/2015-April/001201.html

having

\shorthyphenpenalty : A hyphenation penalty to apply for short words,
    defaulting to something big but not impossible.
\shorthyphenlen : length of a word to consider short.

I can see this being a useful approach - it doesn't hyphenate short words
normally, but it *can* if the alternative is really terrible (e.g. a small
column which would otherwise be an overfull box).

\shorthyphenlen would default to 1 so that existing documents are unaffected.

I think it still requires shorthyphenlen to be in the lang_data structure (and thus to change it). What do you think?

luigi scarso

2015-04-10 00:21

developer   ~0001354

The current version for TEXLive 2015 is 0.80.0,
0.79.1 looks quite old.

Hans Hagen

2015-09-11 22:17

manager   ~0001399

addign penalties and acting on it will complicate the already complex par builder so that is not an option (e.g. would it be an extra pass? a can fo worms)

now, originally the 'min' values were not in the glyph node but it gives some control

if we add \totalhyphenmin or better \hyphenateminwordsize or so, that can be a regular parameter, language specific

consider this: say that you want this applied this locally to a word, then one can as well set the min values very high which then will be applied to that word

also, one can do a pass over a node list vand check for specific words if needed, or add exeptions to the hyphenation table ... as it's unlikely that one will hyphenate ab-cd in one place and inhibit in an other

so, at this moment, implementing a minimum wordlength makes most sense (and is also not intrusive)

eroux

2015-09-12 08:34

reporter   ~0001400

Sounds good to me!

Issue History

Date Modified Username Field Change
2015-04-08 10:58 eroux New Issue
2015-04-08 11:29 eroux Note Added: 0001352
2015-04-08 11:33 eroux Note Edited: 0001352
2015-04-08 11:44 eroux Note Edited: 0001352
2015-04-08 12:20 eroux Note Edited: 0001352
2015-04-09 10:06 eroux Note Added: 0001353
2015-04-09 10:07 eroux Note Edited: 0001353
2015-04-10 00:21 luigi scarso Note Added: 0001354
2015-05-14 13:24 Hans Hagen Assigned To => Hans Hagen
2015-05-14 13:24 Hans Hagen Status new => assigned
2015-09-11 22:17 Hans Hagen Note Added: 0001399
2015-09-12 08:34 eroux Note Added: 0001400
2015-10-06 16:07 Hans Hagen Status assigned => closed
2015-10-06 16:07 Hans Hagen Resolution open => fixed
2015-10-06 16:07 Hans Hagen Fixed in Version => 0.80.1