OSDN Git Service

lltjcore.sty, ltj-jfmglue.lua: \linebreak (#37465)
[luatex-ja/luatexja.git] / src / patches / lltjcore.sty
index 2d31dcd..e56aef4 100644 (file)
@@ -1,10 +1,10 @@
 %
 % lltjcore.sty: derived from plcore.dtx in pLaTeX.
-% This file does not include the code relating to "tategaki".
 %
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjcore}[2017/02/19 Patch to LaTeX2e Kernel for LuaTeX-ja]
+\ProvidesPackage{lltjcore}[2017/08/27 Patch to LaTeX2e Kernel for LuaTeX-ja]
+\RequirePackage{etoolbox}
 
 \def\cleardoublepage{\clearpage\if@twoside
   \ifodd\c@page
     \dimen\z@\textwidth \textwidth\textheight \textheight\dimen\z@
   \fi
   \let \protect \noexpand
+  \language\document@default@language %LaTeX2e 2017/05/01
   \@resetactivechars
   \global\let\@@if@newlist\if@newlist
   \global\@newlistfalse
     \@latex@warning{Reference `#3' on page \thepage \space
               undefined}%
   \else
-    \expandafter#2#1\relax% change \null to \relax
+    \expandafter#2#1\spacefactor\@m{}% change \null to \spacefactor\@m{}
   \fi}
 \endgroup
 \if@compatibility\else
-\def\verb{\relax\ifmmode\hbox\else\leavevmode\fi
+\def\verb{\relax\ifmmode\hbox\else\leavevmode\vadjust{}\fi
   \bgroup
     \verb@eol@error \let\do\@makeother \dospecials
     \verbatim@font\@noligs
+    \language\l@nohyphenation
     \@ifstar\@sverb\@verb}
 \fi
 \gdef\@stopfield{\null\color@endgroup\egroup}
 \newcount\hour
 \newcount\minute
-%%% etoolbox is loaded by everyhook
-\ifltj@everyhook@avail
-  \pretocmd{\footnote}{\inhibitglue}{}{}
-  \pretocmd{\footnotemark}{\inhibitglue}{}{}
-  \patchcmd{\@footnotemark}{\@makefnmark}{%
-    \unless\ifnum\ltjgetparameter{direction}=3 \@makefnmark%
-    \else\hbox to\z@{\hskip-.25\zw\raise.9\zh\@makefnmark\hss}\fi%
-  }{}{}
-  \patchcmd{\@tabular}{\leavevmode}{\leavevmode\null}{}{}
-  \apptocmd{\endtabular}{\null}{}{}
-  \expandafter \let \csname endtabular*\endcsname = \endtabular
-\fi
+\pretocmd{\footnote}{\inhibitglue}{}{}
+\pretocmd{\footnotemark}{\inhibitglue}{}{}
+\patchcmd{\@footnotemark}{\@makefnmark}{%
+  \unless\ifnum\ltjgetparameter{direction}=3 \@makefnmark%
+  \else\hbox to\z@{\hskip-.25\zw\raise.9\zh\@makefnmark\hss}\fi%
+}{}{}
+\patchcmd{\@tabular}{\leavevmode}{\leavevmode\null}{}{}
+\apptocmd{\endtabular}{\null}{}{}
+\expandafter \let \csname endtabular*\endcsname = \endtabular
 \let\@parboxto\@empty
 \long\def\@iiiparbox#1#2[#3]#4#5{%
   \leavevmode
    \else
      \setbox\@outputbox \vbox to\@colht {%
        \@texttop
-       \dimen@ \dp\@outputbox\typeout{\the\dimen@,\meaning\@textbottom}
+       \dimen@ \dp\@outputbox
        \unvbox \@outputbox
        \ifnum\ltjgetparameter{direction}=4\else\vbox{\hskip\z@}\fi %%% LuaTeX-ja
        \vskip -\dimen@
        \ifltj@ftn@unvboxed\iffnfixbottom\else\@textbottom\fi\else\@textbottom\fi
        }%
-    {\scrollmode\showboxdepth1\showboxbreadth10000
-     \tracingonline1\showbox\@outputbox\errorstopmode}
    \fi
    \global \maxdepth \@maxdepth
 }
+\let\ltj@orig@makecol=\@makecol
 
 \patchcmd\@makespecialcolbox{\@textbottom}{\ifltj@ftn@unvboxed\iffnfixbottom\else\@textbottom\fi\else\@textbottom\fi}{}{}
 
 \fi}
 
 
+%%%%%% \@tabclassz
+\def\ltj@sharp{\ltjfakeboxbdd\ignorespaces\@sharp\unskip\ltjfakeboxbdd}
+\def\@tabclassz{%
+  \ifcase\@lastchclass
+    \@acolampacol
+  \or
+    \@ampacol
+  \or
+  \or
+  \or
+    \@addamp
+  \or
+    \@acolampacol
+  \or
+    \@firstampfalse\@acol
+  \fi
+  \edef\@preamble{%
+    \@preamble{%
+      \ifcase\@chnum
+        \hfil\ltj@sharp\hfil
+      \or
+        \hskip1sp\ltj@sharp\hfil
+      \or
+        \hfil\hskip1sp\ltj@sharp
+      \fi}}}
+\patchcmd\@classv{%
+   \ignorespaces\@sharp
+}{%
+   \everypar\expandafter{\the\everypar\ltjfakeboxbdd}\ignorespaces\@sharp\unskip
+}{}{}
+
+
 \endinput