2 % lltjcore.sty: derived from plcore.dtx in pLaTeX.
3 % This file does not include the code relating to "tategaki".
6 \NeedsTeXFormat{LaTeX2e}
7 \ProvidesPackage{lltjcore}[2013/05/14 Patch to LaTeX2e Kernel for LuaTeX-ja]
9 \def\cleardoublepage{\clearpage\if@twoside
11 \ifnum\ltjgetparameter{direction}=3
12 \hbox{}\thispagestyle{empty}\newpage
13 \if@twocolumn\hbox{}\newpage\fi
16 \ifnum\ltjgetparameter{direction}=4
17 \hbox{}\thispagestyle{empty}\newpage
18 \if@twocolumn\hbox{}\newpage\fi
21 \newif\iftombow \tombowfalse
22 \newif\iftombowdate \tombowdatetrue
23 \newdimen\@tombowwidth
24 \setlength{\@tombowwidth}{.1\p@}
25 \newbox\@TL\newbox\@Tl
27 \newbox\@TR\newbox\@Tr
28 \newbox\@BL\newbox\@Bl
30 \newbox\@BR\newbox\@Br
33 \font\@bannerfont=cmtt9
37 \setbox\@TL\hbox to\z@{\yoko\hss
38 \vrule width13mm height\@tombowwidth depth\z@
39 \vrule height10mm width\@tombowwidth depth\z@
41 \raise4pt\hbox to\z@{\hskip5mm\@bannerfont\the\@bannertoken\hss}%
43 \setbox\@Tl\hbox to\z@{\yoko\hss
44 \vrule width10mm height\@tombowwidth depth\z@
45 \vrule height13mm width\@tombowwidth depth\z@}%
46 \setbox\@TC\hbox{\yoko
47 \vrule width10mm height\@tombowwidth depth\z@
48 \vrule height10mm width\@tombowwidth depth\z@
49 \vrule width10mm height\@tombowwidth depth\z@}%
50 \setbox\@TR\hbox to\z@{\yoko
51 \vrule height10mm width\@tombowwidth depth\z@
52 \vrule width13mm height\@tombowwidth depth\z@\hss}%
53 \setbox\@Tr\hbox to\z@{\yoko
54 \vrule height13mm width\@tombowwidth depth\z@
55 \vrule width10mm height\@tombowwidth depth\z@\hss}%
56 \setbox\@BL\hbox to\z@{\yoko\hss
57 \vrule width13mm depth\@tombowwidth height\z@
58 \vrule depth10mm width\@tombowwidth height\z@}%
59 \setbox\@Bl\hbox to\z@{\yoko\hss
60 \vrule width10mm depth\@tombowwidth height\z@
61 \vrule depth13mm width\@tombowwidth height\z@}%
62 \setbox\@BC\hbox{\yoko
63 \vrule width10mm depth\@tombowwidth height\z@
64 \vrule depth10mm width\@tombowwidth height\z@
65 \vrule width10mm depth\@tombowwidth height\z@}%
66 \setbox\@BR\hbox to\z@{\yoko
67 \vrule depth10mm width\@tombowwidth height\z@
68 \vrule width13mm depth\@tombowwidth height\z@\hss}%
69 \setbox\@Br\hbox to\z@{\yoko
70 \vrule depth13mm width\@tombowwidth height\z@
71 \vrule width10mm depth\@tombowwidth height\z@\hss}%
72 \setbox\@CL\hbox to\z@{\yoko\hss
73 \vrule width10mm height.5\@tombowwidth depth.5\@tombowwidth
74 \vrule height10mm depth10mm width\@tombowwidth}%
75 \setbox\@CR\hbox to\z@{\yoko
76 \vrule height10mm depth10mm width\@tombowwidth
77 \vrule height.5\@tombowwidth depth.5\@tombowwidth width10mm\hss}%
81 \vbox to\z@{\kern-13mm\relax
82 \moveleft3mm\vbox to\@@paperheight{%
83 \hbox to\@@paperwidth{\hskip3mm\relax
84 \copy\@TL\hfill\copy\@TC\hfill\copy\@TR\hskip3mm}%
86 \hbox to\@@paperwidth{\copy\@Tl\hfill\copy\@Tr}%
88 \hbox to\@@paperwidth{\copy\@CL\hfill\copy\@CR}%
90 \hbox to\@@paperwidth{\copy\@Bl\hfill\copy\@Br}%
92 \hbox to\@@paperwidth{\hskip3mm\relax
93 \copy\@BL\hfill\copy\@BC\hfill\copy\@BR\hskip3mm}%
98 \newdimen\@@paperheight
99 \newdimen\@@paperwidth
100 \newdimen\@@topmargin
102 \begingroup % the \endgroup is put in by \aftergroup
103 \ifnum\ltjgetparameter{direction}=3
104 \dimen\z@\textwidth \textwidth\textheight \textheight\dimen\z@
106 \let \protect \noexpand
108 \global\let\@@if@newlist\if@newlist
109 \global\@newlistfalse
114 \aftergroup\set@typeset@protect
116 \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
119 \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
120 \ifnum\ltjgetparameter{direction}=3 \let\@themargin\evensidemargin
121 \else\let\@themargin\oddsidemargin\fi
122 \else \let\@thehead\@evenhead
123 \let\@thefoot\@evenfoot
124 \ifnum\ltjgetparameter{direction}=3 \let\@themargin\oddsidemargin
125 \else\let\@themargin\evensidemargin\fi
127 \@@topmargin\topmargin
129 \@@paperwidth\paperwidth \advance\@@paperwidth 6mm\relax
130 \@@paperheight\paperheight \advance\@@paperheight 16mm\relax
131 \advance\@@topmargin 1in\relax \advance\@themargin 1in\relax
138 \let\glossary\@gobble
139 \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@
143 \moveright\@themargin\vbox{%
144 \setbox\@tempboxa \vbox to\headheight{%
148 \hb@xt@\textwidth{\@thehead}%
155 \baselineskip \footskip
158 \hb@xt@\textwidth{\@thefoot}%
162 \global\let\if@newlist\@@if@newlist
163 \global \@colht \textheight
165 \let\firstmark\botmark
167 \renewcommand\@makefnmark{\hbox{%
168 \unless\ifnum\ltjgetparameter{direction}=3
169 \@textsuperscript{\normalfont\@thefnmark}%
170 \else\hbox{\yoko \@textsuperscript{\normalfont\@thefnmark}}\fi}}
171 \long\def\@footnotetext#1{%
172 \ifcase\ltjgetparameter{direction}%
174 \or\or\let\@tempa\tate
176 \else \let\@tempa\utod
178 \insert\footins{\@tempa%
179 \reset@font\footnotesize
180 \interlinepenalty\interfootnotelinepenalty
181 \splittopskip\footnotesep
182 \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
183 \hsize\columnwidth \@parboxrestore
184 \protected@edef\@currentlabel{%
185 \csname p@footnote\endcsname\@thefnmark
189 \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
191 \def\@footnotemark{\leavevmode
192 \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
193 \unless\ifnum\ltjgetparameter{direction}=3 \@makefnmark
194 \else\hbox to\z@{\hskip-.25\zw\raise.9\zh\@makefnmark\hss}\fi
195 \ifhmode\spacefactor\@x@sf\fi\relax}
198 \protect\G@refundefinedtrue
199 \nfss@text{\reset@font\bfseries ??}%
200 \@latex@warning{Reference `#3' on page \thepage \space
203 \expandafter#2#1\relax% change \null to \relax
205 \if@compatibility\else
206 \def\verb{\relax\ifmmode\hbox\else\leavevmode\fi
208 \verb@eol@error \let\do\@makeother \dospecials
209 \verbatim@font\@noligs
210 \@ifstar\@sverb\@verb}
212 \gdef\@stopfield{\null\color@endgroup\egroup}
217 \def \AtBeginDvi #1{%
218 \global \setbox \@begindvibox
219 \vbox{\yoko\unvbox \@begindvibox #1}%
225 \setbox\@outputbox \box\@cclv
227 \setbox\@outputbox \vbox {%
228 \boxmaxdepth \@maxdepth
239 \xdef\@freelist{\@freelist\@midlist}%
240 \global \let \@midlist \@empty
245 \setbox\@outputbox \vbox to\@colht {%
247 \dimen@ \dp\@outputbox
249 \ifnum\ltjgetparameter{direction}=3 \hskip\z@\fi %%% LuaTeX-ja
254 \global \maxdepth \@maxdepth