add line break macros from omega-japanese.
[chise/omega.git] / chise.sty
index 90eaa63..7a75781 100644 (file)
--- a/chise.sty
+++ b/chise.sty
    <-> gt11
 }{}
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% line break, from omega-japanese.
+
+\def\CJKunbreakablekernone{%
+  \nobreak
+  \hskip 0sp plus 2sp minus 2sp
+  \nobreak
+}
+\def\CJKunbreakablekerntwo{%
+  \penalty 500
+  \hskip 0sp plus 2sp minus 2sp
+  \penalty 500
+}
+\def\CJKunbreakablekernthree{%
+  \penalty 200
+  \hskip 0sp plus 2sp minus 2sp
+  \penalty 200
+}
+\def\CJKbreakablekern{\hskip 0sp plus 2pt minus 2sp}
+% BUG: \rlap should preserve the current font
+\def\CJKprotrude#1{%
+  \discretionary{\rlap{#1}}%
+                {}%
+                {#1}%
+}
+%% Hyphenation parameters
+  % If the badness does not exceed this, no hyphenation is
+  % attempted
+  \pretolerance=-1
+
+  % Maximal badness
+  \tolerance=200
+
+  % Penalty added for the first hyphenation
+  % in the current paragraph
+  \hyphenpenalty=0 % Was 50
+
+  % Penalty added for subsequent hyphenations
+  \exhyphenpenalty=0 % Was 50
+
+  % TeX tries to minimize the demerit of the lines:
+  % (\linepenalty^2 + badness^2) + penalty^2
+  \linepenalty=10
+
+  % If a tight line is followed by a loose one
+  % (or conversely), we add \adjdemerits 
+  % to the demerit
+  \adjdemerits=0 % Was 10000 % ???
+
+  % two hyphens on consecutive lines also add 
+  % to the demerit
+  \doublehyphendemerits=0 % Was 10000
+
+  % A hyphen on the last line also adds to
+  % the demerit.
+  \finalhyphendemerits=0 % Was 5000
+
+  % Minimum number of characters in the current word
+  % before or after a hyphenation point
+  \lefthyphenmin=2
+  \righthyphenmin=3
+
+% line break definition ends.
 
 \ProcessOptions
 \endinput