X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fpatches%2Flltjcore.sty;h=a269ee43c8a0d90e58eb824b414bcdd700d65b15;hb=e5c4f3fcce78056289de1ddac52dd695d887046e;hp=b0048e359048cb37d7f8330d31ee134685a7ec2c;hpb=acd1372e8e185b757188ed94f47ebe4bb4b0b7ae;p=luatex-ja%2Fluatexja.git diff --git a/src/patches/lltjcore.sty b/src/patches/lltjcore.sty index b0048e3..a269ee4 100644 --- a/src/patches/lltjcore.sty +++ b/src/patches/lltjcore.sty @@ -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}[2016/05/05 Patch to LaTeX2e Kernel for LuaTeX-ja] +\ProvidesPackage{lltjcore}[2018/03/25 Patch to LaTeX2e Kernel for LuaTeX-ja] +\RequirePackage{etoolbox} \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page @@ -105,6 +105,7 @@ \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 @@ -182,31 +183,25 @@ \@latex@warning{Reference `#3' on page \thepage \space undefined}% \else - \expandafter#2#1\relax% change \null to \relax + \expandafter#2#1\protect\@setref@{}% change \null to \protect\@setref@{} \fi} +\gdef\@setref@{\ifhmode\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% +}{}{} \let\@parboxto\@empty \long\def\@iiiparbox#1#2[#3]#4#5{% \leavevmode @@ -231,29 +226,25 @@ \ifmmode\@@underline{#1}% \else \leavevmode\null$\@@underline{\hbox{#1}}\m@th$\null\relax\fi} -\def\@gnewline #1{% - \ifvmode - \@nolnerr - \else - \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \hskip\z@ - \ignorespaces - \fi} - - %%% AtBeginDvi \def \AtBeginDvi #1{% \global \setbox \@begindvibox \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 @@ -275,10 +266,63 @@ \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 + \@nolnerr + \else + \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \null + % \null は \break の効果が行頭禁則文字で打ち消されないために必要 + \ignorespaces +\fi} + + +%%%%%% tabular (platex/#43) \@tabclassz +\def\ltj@sharp{\relax\pltx@next@inhibitglue\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 +}{}{} +\patchcmd{\@tabular}{\leavevmode}{\leavevmode\null}{}{} +\apptocmd{\endtabular}{\null}{}{} +\expandafter \let \csname endtabular*\endcsname = \endtabular +%%%%%% tabbing (platex/#53) +\patchcmd\@startline{\strut}{\strut\inhibitglue}{}{} +\def\ltj@unhbox@curfield{\ltjfakeboxbdd\unhbox\@curfield\ltjfakeboxbdd} +%\patchcmd\@contfield{\unhbox\@curfield}{\ltj@unhbox@curfield}{}{} +\patchcmd\@addfield{\unhbox\@curfield}{\ltj@unhbox@curfield}{}{} +\pretocmd\@stopfield{\inhibitglue}{}{} \endinput