OSDN Git Service

Use everysel package for patching \selectfont.
[luatex-ja/luatexja.git] / test / zh / warichu-test / ltj-warichu-hsplit.sty
1 \catcode`\@=11
2 \ifx\hsplit@defined\@undefined
3 \def\hsplit@defined{\relax}%
4 \newbox\hsplit@tmpbox
5 \newbox\hsplit@tmpboy
6 \newbox\hsplit@tmpboz
7 \newbox\hsplit@tmpbow
8 \newbox\hsplit@tmpbov
9 \newdimen\hsplit@tmpdim
10 \def\hsplit#1\to#2\into#3{%  \hsplit\boxnum\to\dimen\into\outboxnum
11   \hsplit@tmpdim=#2%
12   \multiply\hsplit@tmpdim by -1
13   \advance\hsplit@tmpdim by \wd#1%
14   \setbox\hsplit@tmpbox=\vbox{\hfuzz=\maxdimen\hbadness=\@M
15     \hsize=\hsplit@tmpdim\nointerlineskip
16     \global\hsplit@tmpdim=#2
17     \global\multiply\hsplit@tmpdim by -2
18     \global\advance\hsplit@tmpdim by \wd#1
19     \noindent\kern\hsplit@tmpdim\unhbox#1}%
20   %\showbox\hsplit@tmpbox
21   \setbox\hsplit@tmpbox=\vbox{% get into internal vertical mode
22     \unvbox\hsplit@tmpbox
23     \hsplit@makehboxofhboxesandsplit
24     \global\setbox\hsplit@tmpbow=\hbox{\unhbox\hsplit@tmpbow
25       \hsplit@removehboxes\unskip\unpenalty}%
26     \hbadness=\@M\hfuzz=\maxdimen
27     \global\setbox\hsplit@tmpbov=\hbox to #2{\unhbox\hsplit@tmpbov\unskip}%
28     % Now we've got the first line in \hsplit@tmpbov starting with a kern
29     %\showbox\hsplit@tmpbow
30   }%
31   %\showbox\hsplit@tmpbov
32   \setbox#1=\box\hsplit@tmpbow
33   \setbox\hsplit@tmpbox=\vbox{\hbadness=\@M\hfuzz=\maxdimen
34     \hsize=\maxdimen\nointerlineskip
35     \noindent\break\unhbox\hsplit@tmpbov}%
36   %\showbox\hsplit@tmpbox
37   \setbox\hsplit@tmpbox=\vbox{% get into internal vertical mode
38     \unvbox\hsplit@tmpbox
39     \hsplit@makehboxofhboxesandsplit
40     %\showbox\hsplit@tmpbov
41     \global\setbox\hsplit@tmpbow=\hbox{\unhbox\hsplit@tmpbow
42       \hsplit@removehboxes\unskip\unpenalty}%
43     %\showbox\hsplit@tmpbow
44   }%
45   \setbox#3=\box\hsplit@tmpbow
46 }%
47 \def\hsplit@makehboxofhboxesandsplit{%
48   \setbox\hsplit@tmpboy=\hbox{}%
49   \loop
50     \setbox\hsplit@tmpboz=\lastbox
51     \ifhbox\hsplit@tmpboz
52       \setbox\hsplit@tmpbow=\copy\hsplit@tmpboy
53       \setbox\hsplit@tmpbov=\copy\hsplit@tmpboz
54       \setbox\hsplit@tmpboy=\hbox{\box\hsplit@tmpboz\unhbox\hsplit@tmpboy}%
55       \unskip
56       \unpenalty
57   \repeat
58 }%
59 \def\hsplit@removehboxes{%
60   \setbox\hsplit@tmpboz=\lastbox
61   \ifhbox\hsplit@tmpboz
62     {\hsplit@removehboxes}% for use local tmpboz
63     \unhbox\hsplit@tmpboz
64     \unskip % removes \rightskip
65   \fi
66 }%
67 \fi