OSDN Git Service

lltjext.sty: baselineshift of JAchar may be not zero
[luatex-ja/luatexja.git] / src / patches / lltjcore.sty
index f632fe8..86bb36b 100644 (file)
@@ -1,10 +1,9 @@
 %
 % lltjcore.sty: derived from plcore.dtx in pLaTeX.
-% This file does not include the code relating to "tategaki".
 %
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjcore}[2016/05/05 Patch to LaTeX2e Kernel for LuaTeX-ja]
+\ProvidesPackage{lltjcore}[2017/06/18 Patch to LaTeX2e Kernel for LuaTeX-ja]
 
 \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\relax{}% change \null to \relax
   \fi}
 \endgroup
 \if@compatibility\else
   \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
+\RequirePackage{etoolbox}
 \ifltj@everyhook@avail
   \pretocmd{\footnote}{\inhibitglue}{}{}
   \pretocmd{\footnotemark}{\inhibitglue}{}{}
     \vbox{\yoko\unvbox \@begindvibox #1}%
 }
 
+\newif\iffnfixbottom
+\newif\ifltj@ftn@unvboxed
 %%% @makecol
 \gdef \@makecol {%
    \ifvoid\footins
+     \ltj@ftn@unvboxedfalse
      \setbox\@outputbox \box\@cclv
    \else
+     \ltj@ftn@unvboxedtrue
      \setbox\@outputbox \vbox {%
        \boxmaxdepth \@maxdepth
        \unvbox \@cclv
+       \iffnfixbottom\vskip\z@ \@plus.0001fil\fi
        \vskip \skip\footins
        \color@begingroup
          \normalcolor
        \unvbox \@outputbox
        \ifnum\ltjgetparameter{direction}=4\else\vbox{\hskip\z@}\fi %%% LuaTeX-ja
        \vskip -\dimen@
-       \@textbottom
+       \ifltj@ftn@unvboxed\iffnfixbottom\else\@textbottom\fi\else\@textbottom\fi
        }%
    \fi
    \global \maxdepth \@maxdepth
 }
+\let\ltj@orig@makecol=\@makecol
+
+\patchcmd\@makespecialcolbox{\@textbottom}{\ifltj@ftn@unvboxed\iffnfixbottom\else\@textbottom\fi\else\@textbottom\fi}{}{}
 
 \def\@gnewline #1{%
   \ifvmode
   \ignorespaces
 \fi}
 
+\def\@no@lnbk #1[#2]{%
+  \ifvmode
+    \@nolnerr
+  \else
+    \@tempskipa\lastskip
+    \unskip
+    \penalty #1\@getpen{#2}%
+    \hskip\z@\relax %% added (2017/05/03)
+    \ifdim\@tempskipa>\z@
+      \hskip\@tempskipa
+      \ignorespaces
+    \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