OSDN Git Service

Merge branch 'master' into kitagawa_test
[luatex-ja/luatexja.git] / src / patches / lltjcore.sty
1 %
2 % lltjcore.sty: derived from plcore.dtx in pLaTeX.
3 % This file does not include the code relating to "tategaki".
4
5
6 \NeedsTeXFormat{LaTeX2e}
7 \ProvidesPackage{lltjcore}[2011/11/22 Patch to LaTeX2e Kernel for LuaLaTeX-ja]
8
9 \makeatletter
10 \newif\iftombow \tombowfalse
11 \newif\iftombowdate \tombowdatetrue
12 \newdimen\@tombowwidth
13 \setlength{\@tombowwidth}{.1\p@}
14 \newbox\@TL\newbox\@Tl
15 \newbox\@TC
16 \newbox\@TR\newbox\@Tr
17 \newbox\@BL\newbox\@Bl
18 \newbox\@BC
19 \newbox\@BR\newbox\@Br
20 \newbox\@CL
21 \newbox\@CR
22 \font\@bannerfont=cmtt9
23 \newtoks\@bannertoken
24 \@bannertoken{}
25 \def\maketombowbox{%
26   \setbox\@TL\hbox to\z@{\yoko\hss
27       \vrule width13mm height\@tombowwidth depth\z@
28       \vrule height10mm width\@tombowwidth depth\z@
29       \iftombowdate
30         \raise4pt\hbox to\z@{\hskip5mm\@bannerfont\the\@bannertoken\hss}%
31       \fi}%
32   \setbox\@Tl\hbox to\z@{\yoko\hss
33       \vrule width10mm height\@tombowwidth depth\z@
34       \vrule height13mm width\@tombowwidth depth\z@}%
35   \setbox\@TC\hbox{\yoko
36       \vrule width10mm height\@tombowwidth depth\z@
37       \vrule height10mm width\@tombowwidth depth\z@
38       \vrule width10mm height\@tombowwidth depth\z@}%
39   \setbox\@TR\hbox to\z@{\yoko
40       \vrule height10mm width\@tombowwidth depth\z@
41       \vrule width13mm height\@tombowwidth depth\z@\hss}%
42   \setbox\@Tr\hbox to\z@{\yoko
43       \vrule height13mm width\@tombowwidth depth\z@
44       \vrule width10mm height\@tombowwidth depth\z@\hss}%
45   \setbox\@BL\hbox to\z@{\yoko\hss
46       \vrule width13mm depth\@tombowwidth height\z@
47       \vrule depth10mm width\@tombowwidth height\z@}%
48   \setbox\@Bl\hbox to\z@{\yoko\hss
49       \vrule width10mm depth\@tombowwidth height\z@
50       \vrule depth13mm width\@tombowwidth height\z@}%
51   \setbox\@BC\hbox{\yoko
52       \vrule width10mm depth\@tombowwidth height\z@
53       \vrule depth10mm width\@tombowwidth height\z@
54       \vrule width10mm depth\@tombowwidth height\z@}%
55   \setbox\@BR\hbox to\z@{\yoko
56       \vrule depth10mm width\@tombowwidth height\z@
57       \vrule width13mm depth\@tombowwidth height\z@\hss}%
58   \setbox\@Br\hbox to\z@{\yoko
59       \vrule depth13mm width\@tombowwidth height\z@
60       \vrule width10mm depth\@tombowwidth height\z@\hss}%
61   \setbox\@CL\hbox to\z@{\yoko\hss
62       \vrule width10mm height.5\@tombowwidth depth.5\@tombowwidth
63       \vrule height10mm depth10mm width\@tombowwidth}%
64   \setbox\@CR\hbox to\z@{\yoko
65       \vrule height10mm depth10mm width\@tombowwidth
66       \vrule height.5\@tombowwidth depth.5\@tombowwidth width10mm\hss}%
67 }
68 \def\@outputtombow{%
69   \iftombow
70   \vbox to\z@{\kern-13mm\relax
71     \moveleft3mm\vbox to\@@paperheight{%
72       \hbox to\@@paperwidth{\hskip3mm\relax
73          \copy\@TL\hfill\copy\@TC\hfill\copy\@TR\hskip3mm}%
74       \kern-10mm
75       \hbox to\@@paperwidth{\copy\@Tl\hfill\copy\@Tr}%
76       \vfill
77       \hbox to\@@paperwidth{\copy\@CL\hfill\copy\@CR}%
78       \vfill
79       \hbox to\@@paperwidth{\copy\@Bl\hfill\copy\@Br}%
80       \kern-10mm
81       \hbox to\@@paperwidth{\hskip3mm\relax
82          \copy\@BL\hfill\copy\@BC\hfill\copy\@BR\hskip3mm}%
83     }\vss
84   }%
85   \fi
86 }
87 \newdimen\@@paperheight
88 \newdimen\@@paperwidth
89 \newdimen\@@topmargin
90 \def\@outputpage{%
91 \begingroup % the \endgroup is put in by \aftergroup
92   \iftdir
93     \dimen\z@\textwidth \textwidth\textheight \textheight\dimen\z@
94   \fi
95   \let \protect \noexpand
96   \@resetactivechars
97   \global\let\@@if@newlist\if@newlist
98   \global\@newlistfalse
99   \@parboxrestore
100   \shipout\vbox{\yoko
101     \set@typeset@protect
102     \aftergroup\endgroup
103     \aftergroup\set@typeset@protect
104      \if@specialpage
105        \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
106      \fi
107      \if@twoside
108        \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
109           \iftdir\let\@themargin\evensidemargin
110           \else\let\@themargin\oddsidemargin\fi
111        \else \let\@thehead\@evenhead
112           \let\@thefoot\@evenfoot
113            \iftdir\let\@themargin\oddsidemargin
114            \else\let\@themargin\evensidemargin\fi
115      \fi\fi
116      \@@topmargin\topmargin
117      \iftombow
118        \@@paperwidth\paperwidth \advance\@@paperwidth 6mm\relax
119        \@@paperheight\paperheight \advance\@@paperheight 16mm\relax
120        \advance\@@topmargin 1in\relax \advance\@themargin 1in\relax
121      \fi
122      \reset@font
123      \normalsize
124      \normalsfcodes
125      \let\label\@gobble
126      \let\index\@gobble
127      \let\glossary\@gobble
128      \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@
129     \@begindvi
130     \@outputtombow
131     \vskip \@@topmargin
132     \moveright\@themargin\vbox{%
133       \setbox\@tempboxa \vbox to\headheight{%
134         \vfil
135         \color@hbox
136           \normalcolor
137           \hb@xt@\textwidth{\@thehead}%
138         \color@endbox
139       }%                        %% 22 Feb 87
140       \dp\@tempboxa \z@
141       \box\@tempboxa
142       \vskip \headsep
143       \box\@outputbox
144       \baselineskip \footskip
145       \color@hbox
146         \normalcolor
147         \hb@xt@\textwidth{\@thefoot}%
148       \color@endbox
149     }%
150   }%
151   \global\let\if@newlist\@@if@newlist
152   \global \@colht \textheight
153   \stepcounter{page}%
154   \let\firstmark\botmark
155 }
156
157 \def\@setref#1#2#3{%
158   \ifx#1\relax
159     \protect\G@refundefinedtrue
160     \nfss@text{\reset@font\bfseries ??}%
161     \@latex@warning{Reference `#3' on page \thepage \space
162               undefined}%
163   \else
164     \expandafter#2#1\relax% change \null to \relax
165   \fi}
166 \if@compatibility\else
167 \def\verb{\relax\ifmmode\hbox\else\leavevmode\fi
168   \bgroup
169     \verb@eol@error \let\do\@makeother \dospecials
170     \verbatim@font\@noligs
171     \@ifstar\@sverb\@verb}
172 \fi
173 \gdef\@stopfield{\null\color@endgroup\egroup}
174 \newcount\hour
175 \newcount\minute
176
177 \endinput