summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexja/patches
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/patches')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty91
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty48
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty124
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-footmisc.sty58
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty486
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty2
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-stfloats.sty49
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-tascmac.sty109
8 files changed, 899 insertions, 68 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty
index 2d8afbd512a..94254e77222 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty
@@ -6,7 +6,18 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{lltjcore}[2013/05/14 Patch to LaTeX2e Kernel for LuaTeX-ja]
-\makeatletter
+\def\cleardoublepage{\clearpage\if@twoside
+ \ifodd\c@page
+ \ifnum\ltjgetparameter{direction}=3
+ \hbox{}\thispagestyle{empty}\newpage
+ \if@twocolumn\hbox{}\newpage\fi
+ \fi
+ \else
+ \ifnum\ltjgetparameter{direction}=4
+ \hbox{}\thispagestyle{empty}\newpage
+ \if@twocolumn\hbox{}\newpage\fi
+ \fi
+ \fi\fi}
\newif\iftombow \tombowfalse
\newif\iftombowdate \tombowdatetrue
\newdimen\@tombowwidth
@@ -89,7 +100,7 @@
\newdimen\@@topmargin
\def\@outputpage{%
\begingroup % the \endgroup is put in by \aftergroup
- \iftdir
+ \ifnum\ltjgetparameter{direction}=4\else
\dimen\z@\textwidth \textwidth\textheight \textheight\dimen\z@
\fi
\let \protect \noexpand
@@ -106,11 +117,11 @@
\fi
\if@twoside
\ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
- \iftdir\let\@themargin\evensidemargin
+ \ifnum\ltjgetparameter{direction}=3 \let\@themargin\evensidemargin
\else\let\@themargin\oddsidemargin\fi
\else \let\@thehead\@evenhead
\let\@thefoot\@evenfoot
- \iftdir\let\@themargin\oddsidemargin
+ \ifnum\ltjgetparameter{direction}=3 \let\@themargin\oddsidemargin
\else\let\@themargin\evensidemargin\fi
\fi\fi
\@@topmargin\topmargin
@@ -153,7 +164,35 @@
\stepcounter{page}%
\let\firstmark\botmark
}
-
+\renewcommand\@makefnmark{\hbox{%
+ \unless\ifnum\ltjgetparameter{direction}=3
+ \@textsuperscript{\normalfont\@thefnmark}%
+ \else\hbox{\yoko \@textsuperscript{\normalfont\@thefnmark}}\fi}}
+\long\def\@footnotetext#1{%
+ \ifcase\ltjgetparameter{direction}%
+ \or \let\@tempa\dtou
+ \or\or\let\@tempa\tate
+ \or \let\@tempa\yoko
+ \else \let\@tempa\utod
+ \fi
+ \insert\footins{\@tempa%
+ \reset@font\footnotesize
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\footnotesep
+ \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+ \hsize\columnwidth \@parboxrestore
+ \protected@edef\@currentlabel{%
+ \csname p@footnote\endcsname\@thefnmark
+ }%
+ \color@begingroup
+ \@makefntext{%
+ \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+ \color@endgroup}}
+\def\@footnotemark{\leavevmode
+ \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
+ \unless\ifnum\ltjgetparameter{direction}=3 \@makefnmark
+ \else\hbox to\z@{\hskip-.25\zw\raise.9\zh\@makefnmark\hss}\fi
+ \ifhmode\spacefactor\@x@sf\fi\relax}
\def\@setref#1#2#3{%
\ifx#1\relax
\protect\G@refundefinedtrue
@@ -169,10 +208,50 @@
\verb@eol@error \let\do\@makeother \dospecials
\verbatim@font\@noligs
\@ifstar\@sverb\@verb}
-\def\@makefnmark{\hbox{}\hbox{\@textsuperscript{\normalfont\@thefnmark}}\hbox{}}
\fi
\gdef\@stopfield{\null\color@endgroup\egroup}
\newcount\hour
\newcount\minute
+%%% AtBeginDvi
+\def \AtBeginDvi #1{%
+ \global \setbox \@begindvibox
+ \vbox{\yoko\unvbox \@begindvibox #1}%
+}
+
+%%% @makecol
+\gdef \@makecol {%
+ \ifvoid\footins
+ \setbox\@outputbox \box\@cclv
+ \else
+ \setbox\@outputbox \vbox {%
+ \boxmaxdepth \@maxdepth
+ \unvbox \@cclv
+ \vskip \skip\footins
+ \color@begingroup
+ \normalcolor
+ \footnoterule
+ \unvbox \footins
+ \color@endgroup
+ }%
+ \fi
+ \let\@elt\relax
+ \xdef\@freelist{\@freelist\@midlist}%
+ \global \let \@midlist \@empty
+ \@combinefloats
+ \ifvbox\@kludgeins
+ \@makespecialcolbox
+ \else
+ \setbox\@outputbox \vbox to\@colht {%
+ \@texttop
+ \dimen@ \dp\@outputbox
+ \unvbox \@outputbox
+ \ifnum\ltjgetparameter{direction}=4\else\hskip\z@\fi %%% LuaTeX-ja
+ \vskip -\dimen@
+ \@textbottom
+ }%
+ \fi
+ \global \maxdepth \@maxdepth
+}
+
\endinput
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty
index 4363948d8e4..7eaf0c41bed 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty
@@ -1,19 +1,22 @@
%
% lltjdefs.sty
-%
+%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjdefs}[2014/09/19 Default font settings of LuaTeX-ja]
+\ProvidesPackage{lltjdefs}[2015/02/22 Default font settings of LuaTeX-ja]
\def\ltj@stdmcfont{IPAExMincho}
\def\ltj@stdgtfont{IPAExGothic}
-\InputIfFileExists{luatexja.cfg}{}{}
+\InputIfFileExists{luatexja.cfg}{}{%
+ \PackageInfo{lltjdefs}{Cannot find file `luatexja.cfg'\@gobble}%
+}
\DeclareKanjiEncodingDefaults{}{}
\DeclareErrorKanjiFont{JY3}{mc}{m}{n}{10}
\DeclareYokoKanjiEncoding{JY3}{}{}
\DeclareKanjiSubstitution{JY3}{mc}{m}{n}
-%JT3
+\DeclareTateKanjiEncoding{JT3}{}{}
+\DeclareKanjiSubstitution{JT3}{mc}{m}{n}
\newcommand\mcdefault{mc}
\newcommand\gtdefault{gt}
@@ -22,7 +25,6 @@
\newcommand\kanjifamilydefault{\mcdefault}
\newcommand\kanjiseriesdefault{\mddefault}
\newcommand\kanjishapedefault{\updefault}
-\kanjiencoding{JY3}
\DeclareKanjiFamily{JY3}{mc}{}
\DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[0.962216] \ltj@stdmcfont:jfm=ujis}{}
@@ -31,6 +33,14 @@
\DeclareFontShape{JY3}{mc}{bx}{n}{<-> ssub*gt/m/n}{}
\DeclareFontShape{JY3}{gt}{bx}{n}{<-> ssub*gt/m/n}{}
+\DeclareKanjiFamily{JT3}{mc}{}
+\DeclareFontShape{JT3}{mc}{m}{n}{<-> s*[0.962216] \ltj@stdmcfont:jfm=ujisv}{}
+\DeclareKanjiFamily{JT3}{gt}{}
+\DeclareFontShape{JT3}{gt}{m}{n}{<-> s*[0.962216] \ltj@stdgtfont:jfm=ujisv}{}
+\DeclareFontShape{JT3}{mc}{bx}{n}{<-> ssub*gt/m/n}{}
+\DeclareFontShape{JT3}{gt}{bx}{n}{<-> ssub*gt/m/n}{}
+\KanjiEncodingPair{JY3}{JT3}
+
\kanjiencoding{JY3}\selectfont\adjustbaseline
\DeclareTextFontCommand{\textmc}{\mcfamily}
@@ -44,20 +54,20 @@
\DeclareSymbolFontAlphabet{\mathmc}{mincho}
\DeclareMathAlphabet{\mathgt}{JY3}{gt}{m}{n}
-\ltjdefcharrange{1}{"80-"36F, "1E00-"1EFF}
-\ltjdefcharrange{2}{"370-"4FF, "1F00-"1FFF}
+\ltjdefcharrange{1}{"80-"36F, "1E00-"1EFF}
+\ltjdefcharrange{2}{"370-"4FF, "1F00-"1FFF}
\ltjdefcharrange{3}{%
"2000-"243F, "2500-"27BF, "2900-"29FF, "2B00-"2BFF}
\ltjdefcharrange{4}{%
- "500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF,
- "2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A82F, "A840-"ABFF, "FB00-"FE0F,
+ "500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF,
+ "2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A82F, "A840-"ABFF, "FB00-"FE0F,
"FE20-"FE2F, "FE70-"FEFF, "10000-"1FFFF, "E000-"F8FF} % non-Japanese
-\ltjdefcharrange{5}{"D800-"DFFF, "E0000-"E00FF, "E01F0-"10FFFF}
+\ltjdefcharrange{5}{"D800-"DFFF, "E0000-"E00FF, "E01F0-"10FFFF}
\ltjdefcharrange{6}{%
- "2460-"24FF, "2E80-"2EFF, "3000-"30FF, "3190-"319F, "31F0-"4DBF,
+ "2460-"24FF, "2E80-"2EFF, "3000-"30FF, "3190-"319F, "31F0-"4DBF,
"4E00-"9FFF, "F900-"FAFF, "FE10-"FE6F, "20000-"2FFFF, "E0100-"E01EF}
\ltjdefcharrange{7}{
- "1100-"11FF, "2F00-"2FFF, "3100-"31EF, "A000-"A4CF, "A830-"A83F,
+ "1100-"11FF, "2F00-"2FFF, "3100-"31EF, "A000-"A4CF, "A830-"A83F,
"AC00-"D7FF}
\ltjdefcharrange{8}{"A7, "A8, "B0, "B1, "B4, "B6, "D7, "F7}
\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}}
@@ -72,7 +82,7 @@
MIDDLE
-\ltjdefcharrange{1}{"80-"36F, "1E00-"1EFF}
+\ltjdefcharrange{1}{"80-"36F, "1E00-"1EFF}
% 2 "80-"FF num = 471/128 name = Latin-1 Supplement
% 3 "100-"17F num = 484/128 name = Latin Extended-A
% 4 "180-"24F num = 87/208 name = Latin Extended-B
@@ -81,7 +91,7 @@ MIDDLE
% 7 "300-"36F num = 98/112 name = Combining Diacritical Marks
% 64 "1E00-"1EFF num = 16/256 name = Latin Extended Additional
-\ltjdefcharrange{2}{"370-"4FF, "1F00-"1FFF}
+\ltjdefcharrange{2}{"370-"4FF, "1F00-"1FFF}
% Greek and Coptic, Cyrillic, Greek Extended
\ltjdefcharrange{3}{%
@@ -108,12 +118,12 @@ MIDDLE
NEGATIVE
\ltjdefcharrange{4}{%
- "500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF,
- "2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A82F, "A840-"ABFF, "FB00-"FE0F,
+ "500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF,
+ "2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A82F, "A840-"ABFF, "FB00-"FE0F,
"FE20-"FE2F, "FE70-"FEFF, "10000-"1FFFF, "E000-"F8FF}
} % non-Japanese
-\ltjdefcharrange{5}{"D800-"DFFF, "E0000-"E00FF, "E01F0-"10FFFF}
+\ltjdefcharrange{5}{"D800-"DFFF, "E0000-"E00FF, "E01F0-"10FFFF}
% Surrogates, Tags
% 208 "F0000-"FFFFF num = 0/65536 name = Supplementary Private Use Area-A
% 209 "100000-"10FFFF num = 0/65536 name = Supplementary Private Use Area-B
@@ -122,7 +132,7 @@ POSITIVE
% Japanese
\ltjdefcharrange{6}{%
- "2460-"24FF, "2E80-"2EFF, "3000-"30FF, "3190-"319F, "31F0-"4DBF,
+ "2460-"24FF, "2E80-"2EFF, "3000-"30FF, "3190-"319F, "31F0-"4DBF,
"4E00-"9FFF, "F900-"FAFF, "FE10-"FE6F, "20000-"2FFFF, "E0100-"E01EF}
% 77 "2460-"24FF num = 150/160 name = Enclosed Alphanumerics
% 98 "2E80-"2EFF num = 21 name = CJK Radicals Supplement
@@ -143,7 +153,7 @@ POSITIVE
% "E0000-"E01EF Variation Selectors Supplement
\ltjdefcharrange{7}{
- "1100-"11FF, "2F00-"2FFF, "3100-"31EF, "A000-"A4CF, "A830-"A83F,
+ "1100-"11FF, "2F00-"2FFF, "3100-"31EF, "A000-"A4CF, "A830-"A83F,
"AC00-"D7FF}
% 35 "1100-"11FF num = 1 name = Hangul Jamo
% 99 "2F00-"2FDF num = 0/224 name = Kangxi Radicals
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
index 65d86aceced..e53384d88cf 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
@@ -3,7 +3,7 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjfont}[2014/01/23 Patch to NFSS2 for LuaTeX-ja]
+\ProvidesPackage{lltjfont}[2014/10/29 Patch to NFSS2 for LuaTeX-ja]
\let\k@encoding\@empty
\let\ck@encoding\@empty
@@ -28,14 +28,17 @@
\ifdefined\cHT\else\newdimen\cHT\fi
%\let\afont\font
+\newbox\dstrutbox
\newbox\tstrutbox
\newbox\zstrutbox
\def\strut{\relax
- \ifydir
+ \ifnum\ltjgetparameter{direction}=1 % dtou
+ \ifmmode\copy\dstrutbox\else\unhcopy\dstrutbox\fi
+ \else\ifnum\ltjgetparameter{direction}=4 % yoko
\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi
- \else
+ \else % tate and utod
\ifmmode\copy\tstrutbox\else\unhcopy\tstrutbox\fi
- \fi
+ \fi\fi
}
\def\tstrut{\relax\hbox{\tate
\ifmmode\copy\tstrutbox\else\unhcopy\tstrutbox\fi}}
@@ -201,13 +204,13 @@
\usekanji{#2}{#3}{#4}{#5}%
\global\let#1\getjfont
\else
- %\directlua{luatexja.jfont.is_ktenc('\luatexluaescapestring{#2}')}\ifin@%
- % \usekanji{#2}{#3}{#4}{#5}%
- % \global\let#1\gettfont
- %\else
+ \directlua{luatexja.jfont.is_ktenc('\luatexluaescapestring{#2}')}\ifin@%
+ \usekanji{#2}{#3}{#4}{#5}%
+ \global\let#1\gettfont
+ \else
\useroman{#2}{#3}{#4}{#5}%
\global\expandafter\let\expandafter#1\the\font
- %\fi
+ \fi
\fi
\endgroup
}
@@ -268,18 +271,30 @@
\ltj@@EverySelectfont@Init
}
\def\ltj@selectfont@patch{%
- \let\tmp@error@fontshape\error@fontshape
+ \directlua{luatexja.base.start_time_measure('selectfont')}%
+ \let\tmp@error@fontshape\error@fontshape
\let\error@fontshape\error@kfontshape
\directlua{luatexja.jfont.is_kyenc('\luatexluaescapestring{\k@encoding}')}\ifin@%
\let\cy@encoding\k@encoding
\edef\ct@encoding{\csname t@enc@\k@encoding\endcsname}%
\else
- %\directlua{luatexja.jfont.is_ktenc('\luatexluaescapestring{\k@encoding}')}\ifin@%
- % \let\ct@encoding\k@encoding
- % \edef\cy@encoding{\csname y@enc@\k@encoding\endcsname}%
- %\else
+ \directlua{luatexja.jfont.is_ktenc('\luatexluaescapestring{\k@encoding}')}\ifin@%
+ \let\ct@encoding\k@encoding
+ \edef\cy@encoding{\csname y@enc@\k@encoding\endcsname}%
+ \else
\@latex@error{KANJI Encoding scheme `\k@encoding' unknown}\@eha
- %\fi
+ \fi
+ \fi
+%
+ \let\k@encoding\ct@encoding
+ \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}%
+ \pickup@tfont
+ \font@name
+ \ltj@@does@alt@set{\curr@kfontshape}%
+ % alt fonts の定義
+ \directlua{luatexja.jfont.output_alt_font_cmd('t', '\luatexluaescapestring{\curr@kfontshape}')}%
+ % 定義した alt fonts のデータを \ltjdeclarealtfont に渡すのと同等の処理をする
+ \directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}%
\fi
%
\let\k@encoding\cy@encoding
@@ -288,7 +303,7 @@
\font@name
\ltj@@does@alt@set{\curr@kfontshape}%
% alt fonts の定義
- \directlua{luatexja.jfont.output_alt_font_cmd('\luatexluaescapestring{\curr@kfontshape}')}%
+ \directlua{luatexja.jfont.output_alt_font_cmd('y', '\luatexluaescapestring{\curr@kfontshape}')}%
% 定義した alt fonts のデータを \ltjdeclarealtfont に渡すのと同等の処理をする
\directlua{luatexja.jfont.pickup_alt_font_a('\f@size')}%
\fi
@@ -311,11 +326,11 @@
% 警告: 再び \selectfont を呼んでいる.無限ループの可能性あり
\fi
\fi
+ \directlua{luatexja.base.stop_time_measure('selectfont')}%
}
\EverySelectfont{\ltj@selectfont@patch}
\def\KanjiEncodingPair#1#2{\@namedef{t@enc@#1}{#2}\@namedef{y@enc@#2}{#1}}
-\KanjiEncodingPair{JY3}{JT3}
\def\set@fontsize#1#2#3{%
\@defaultunits\@tempdimb#2pt\relax\@nnil
\edef\f@size{\strip@pt\@tempdimb}%
@@ -328,38 +343,40 @@
\baselineskip\f@linespread\baselineskip
\normalbaselineskip\baselineskip
\adjustbaseline
- \setbox\strutbox\hbox{%\yoko
+ \setbox\strutbox\hbox{\yoko
\vrule\@width\z@
\@height.7\baselineskip \@depth.3\baselineskip}%
- \setbox\tstrutbox\hbox{%\tate
+ \setbox\dstrutbox\hbox{\dtou
+ \vrule\@width\z@
+ \@height.7\baselineskip \@depth.3\baselineskip}%
+ \setbox\tstrutbox\hbox{\tate
\vrule\@width\z@
\@height.5\baselineskip \@depth.5\baselineskip}%
- \setbox\zstrutbox\hbox{%\tate
+ \setbox\zstrutbox\hbox{\tate
\vrule\@width\z@
\@height.7\baselineskip \@depth.3\baselineskip}%
\let\size@update\relax}}
\newbox\adjust@box
+\newbox\adjust@box@aux
\newdimen\adjust@dimen
\def\adjustbaseline{%
- \setbox\adjust@box\hbox{\ltj@ykblshift=0あ}%
+ \setbox\adjust@box\hbox{%
+ \ltj@ykblshift\z@\ltj@tkblshift\z@ 漢}%
\cht\ht\adjust@box
\cdp\dp\adjust@box
\cwd\wd\adjust@box
\cvs\normalbaselineskip
\chs\cwd
\cHT\cht \advance\cHT\cdp
- % \iftdir
- % \setbox0\hbox{\tate\ltjsetparameter{tjabaselineshift=\z@}あ}%
- % \setbox\adjust@box\hbox{\tate\ltjsetparameter{talbaselineshift=\z@}M}%
- % \adjust@dimen\ht\adjust@box
- % \advance\adjust@dimen\dp\adjust@box
- % \advance\adjust@dimen-\ht0
- % \divide\adjust@dimen\tw@
- % \advance\adjust@dimen0.5\dp0
- % \advance\adjust@dimen-\dp\adjust@box
- % \ltjsetparameter{talbaselineshift=\adjust@dimen}
- % \fi
- }
+ \setbox\adjust@box@aux\hbox{\tate\ltj@tkblshift\z@ 漢}%
+ \setbox\adjust@box\hbox{\tate\ltj@tablshift\z@ M}%
+ \adjust@dimen\ht\adjust@box
+ \advance\adjust@dimen\dp\adjust@box
+ \advance\adjust@dimen-\ht\adjust@box@aux
+ \divide\adjust@dimen\tw@
+ \advance\adjust@dimen0.5\dp\adjust@box@aux
+ \advance\adjust@dimen-\dp\adjust@box
+ \ltj@tablshift=\adjust@dimen}
\DeclareRobustCommand\romanencoding[1]{%
\expandafter\ifx\csname T@#1\endcsname\relax
\@latex@error{Encoding scheme `#1' unknown}\@eha
@@ -397,11 +414,11 @@
\directlua{luatexja.jfont.is_kyenc(\tmp@enc)}\ifin@%
\let\cy@encoding\k@encoding
\else
- %\directlua{luatexja.jfont.is_ktenc(\tmp@enc)}\ifin@%
- % \let\ct@encoding\k@encoding
- %\else
+ \directlua{luatexja.jfont.is_ktenc(\tmp@enc)}\ifin@%
+ \let\ct@encoding\k@encoding
+ \else
\@latex@error{KANJI Encoding scheme `\k@encoding' unknown}\@eha
- %\fi
+ \fi
\fi
}
\let\kenc@update\relax
@@ -426,6 +443,8 @@
\newif\if@notkfam
\newif\if@notffam
\newif\if@tempswz
+\newif\if@ltj@use@fd
+\@ltj@use@fdtrue
\DeclareRobustCommand\romanfamily[1]{\edef\f@family{#1}}
\DeclareRobustCommand\kanjifamily[1]{\edef\k@family{#1}}
\DeclareRobustCommand\fontfamily[1]{%
@@ -434,7 +453,8 @@
\edef\tmp@enc{'\luatexluaescapestring{\k@encoding}'}%
\ifcsname \k@encoding+#1\endcsname % if \k@encoding+#1 is already defined
\edef\k@family{#1}%
- \else % search font definition file...
+ \else\if@ltj@use@fd
+ % search font definition file...
\directlua{luatexja.jfont.is_kfam(\tmp@enc, \tmp@item)}%
\ifin@\edef\k@family{#1}\else%
\directlua{luatexja.jfont.is_Nkfam(\tmp@enc, \tmp@item)}%
@@ -452,7 +472,9 @@
\fi
\fi
\fi
- \fi
+ \else % do not use font definition file
+ \@notkfamtrue%
+ \fi\fi
\edef\tmp@enc{'\luatexluaescapestring{\f@encoding}'}%
\ifcsname \f@encoding+#1\endcsname
\edef\f@family{#1}%
@@ -531,7 +553,6 @@
\@onlypreamble\kanjiprocess@table
\DeclareTextCommandDefault{\textunderscore}{%
\leavevmode\kern.06em
- %\iftdir\raise-\tbaselineshift\fi
\vbox{\hrule\@width.3em}}
%%%%%% LuaTeX-ja specific
@@ -550,6 +571,13 @@
\let\extract@font\extract@afont
\fi
\let\getjfont\font@name}
+\def\pickup@tfont{%
+ \expandafter \ifx \font@name \relax
+ \let\extract@font\extract@tfont
+ \define@newfont
+ \let\extract@font\extract@afont
+ \fi
+ \let\gettfont\font@name}
% 異なる和文 enc/fam/ser/shape からは異なるフォント番号が振られるように
% わざと「ゴミをつける」
@@ -561,7 +589,16 @@
\ltj@@does@alt@set{\f@encoding/\f@family/\f@series/\f@shape}%
\edef\external@font{\expandafter\ltj@@patch@external@font\external@font}%
\fi
- \expandafter\globaljfont\font@name\external@font\relax
+ \expandafter\globaljfont\font@name\external@font\relax% ここで時間がかかる
+ \font@name%\global\zw=\zw\global\zh=\zh
+ \csname \f@encoding+\f@family\endcsname
+ \csname\curr@fontshape\endcsname}
+\def\extract@tfont{%
+ \get@external@font
+ \ltj@@does@alt@set{\f@encoding/\f@family/\f@series/\f@shape}%
+ \edef\external@font{\expandafter\ltj@@patch@external@font\external@font}%
+ \fi
+ \expandafter\globaltfont\font@name\external@font\relax
\font@name%\global\zw=\zw\global\zh=\zh
\csname \f@encoding+\f@family\endcsname
\csname\curr@fontshape\endcsname}
@@ -650,9 +687,12 @@
\def\ClearAlternateKanjiFont#1#2#3#4{%
\directlua{luatexja.jfont.clear_alt_font_latex('\luatexluaescapestring{#1/#2/#3/#4}')}}
-\def\ltj@pickup@altfont@aux#1{%
+\def\ltj@pickup@altfont@auxy#1{%
\begingroup\edef\font@name{\csname #1/\f@size\endcsname}\pickup@jfont\endgroup%
}
+\def\ltj@pickup@altfont@auxt#1{%
+ \begingroup\edef\font@name{\csname #1/\f@size\endcsname}\pickup@tfont\endgroup%
+}
\def\ltj@pickup@altfont@copy#1#2{%
\ltj@@getjfontnumber#1%
\directlua{luatexja.jfont.pickup_alt_font_b(\the\ltj@tempcntc,'\luatexluaescapestring{#2}')}%
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-footmisc.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-footmisc.sty
new file mode 100644
index 00000000000..d7125541a05
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-footmisc.sty
@@ -0,0 +1,58 @@
+%
+% lltjp-footmiscs.sty
+%
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{lltjp-footmisc}[2014/11/23 Patch to footmisc for LuaTeX-ja]
+\RequirePackage{footmisc}
+
+\let \if@tempswa \ifFN@bottom
+\ifFN@para \@tempswatrue \fi
+\if@tempswa
+ \ifFN@bottom
+ \toks@{\setbox\@outputbox \box\@cclv
+ \xdef\@freelist{\@freelist\@midlist}%
+ \global\let\@midlist\@empty
+ \@combinefloats
+ \ifvoid\footins
+ \else
+ \setbox\@outputbox \vbox\bgroup
+ \boxmaxdepth\@maxdepth
+ \unvbox\@outputbox
+ \vfill\relax
+ }
+ \the\FN@temptoken
+ \toks@\expandafter{\the\toks@\egroup\fi}
+ \else
+ \toks@{\ifvoid\footins
+ \setbox\@outputbox\box\@cclv
+ \else
+ \setbox\@outputbox \vbox\bgroup
+ \boxmaxdepth\@maxdepth
+ \unvbox\@cclv
+ }
+ \the\FN@temptoken
+ \toks@\expandafter{\the\toks@
+ \egroup
+ \fi
+ \xdef\@freelist{\@freelist\@midlist}%
+ \global\let\@midlist\@empty
+ \@combinefloats
+ }%
+ \fi
+ \toks@\expandafter{\the\toks@
+ \ifvbox\@kludgeins
+ \@makespecialcolbox
+ \else
+ \setbox\@outputbox \vbox to\@colht{%
+ \@texttop \dimen@\dp\@outputbox
+ \unvbox\@outputbox
+ \ifnum\ltjgetparameter{direction}=3 \hskip\z@\fi %%% LuaTeX-ja
+ \vskip -\dimen@\@textbottom
+ }%
+ \fi
+ \global\maxdepth\@maxdepth
+ }
+ \edef\@makecol{\the\toks@}
+\fi
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty
new file mode 100644
index 00000000000..1ac1cc0bd4e
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty
@@ -0,0 +1,486 @@
+%
+% lltjp-geometry.sty
+%
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{lltjp-geometry}[2015/01/01 Patch to geometry for LuaTeX-ja with vertical writing mode]
+\RequirePackage{ifluatex}
+
+\ifdefined\if@ltj@@geometry@tate\expandafter\endinput\fi
+\newif\if@ltj@@geometry@tate
+\@ltj@@geometry@tatefalse
+\ifluatex\else % pTeX
+ \@ltj@@geometry@tatetrue
+\def \AtBeginDvi #1{%
+ \global \setbox \@begindvibox
+ \vbox{\yoko\unvbox \@begindvibox #1}%
+}
+\fi
+
+\RequirePackage{filehook}
+\newif\ifGm@ltj@layoutswitch
+\let\orig@PackageWarningNoLine=\PackageWarningNoLine
+% define ifGm@swap@papersize if it is undefined
+\expandafter\newif\csname ifGm@swap@papersize\endcsname
+
+\AtBeginOfPackageFile{geometry}{%
+ \edef\Gm@ltj@topskip{\the\topskip}
+ \edef\Gm@ltj@headsep{\the\headsep}
+ \edef\Gm@ltj@footskip{\the\footskip}
+\ifluatex
+ \ifnum\ltjgetparameter{direction}=3 \@ltj@@geometry@tatetrue\fi
+\fi
+\if@ltj@@geometry@tate
+ \let\PackageWarningNoLine\@gobbletwo% 警告抑止
+\fi
+}
+\AtEndOfPackageFile{geometry}{%
+\let\PackageWarningNoLine=\orig@PackageWarningNoLine
+\if@ltj@@geometry@tate
+ \let\PackageWarningNoLine=\orig@PackageWarningNoLine
+%%% ここからパッチ開始
+
+% TODO:
+% * pTeX, LuaTeX ともに truedimen が正しく動作しない
+% * pTeX resetpaper が正しく動作しない
+%
+% `h', `v' は「水平」「垂直」を意味するが:
+% ユーザー側では「紙の物理的な水平方向」「物理的な垂直方向」を,
+% しかしパッケージ内部処理では「字送り方向」「行送り方向」を表す.
+% そのため,key-value interface 内で h, v の交換を行う必要がある.
+
+% twoside 指定時は,lmargin は小口側,rmargin はノド側の余白を指す.
+% また,bindingoffset 偶数ページを右に,奇数ページを左にずらす.
+\define@key{Gm}{hdivide}{\Gm@parse@divide{#1}{lmargin}{height}{rmargin}}%
+
+\define@key{Gm}{vscale}{\Gm@hbodytrue\edef\Gm@hscale{#1}}%
+\define@key{Gm}{hscale}{\Gm@vbodytrue\edef\Gm@vscale{#1}}%
+\define@key{Gm}{vdivide}{\Gm@parse@divide{#1}{tmargin}{width}{bmargin}}%
+\define@key{Gm}{divide}{\Gm@parse@divide{#1}{tmargin}{width}{bmargin}%
+ \Gm@parse@divide{#1}{lmargin}{height}{rmargin}}%
+\define@key{Gm}{vmargin}{\Gm@branch{#1}{tmargin}{bmargin}}%
+\define@key{Gm}{hmargin}{\Gm@branch{#1}{lmargin}{rmargin}}%
+\define@key{Gm}{margin}{\Gm@branch{#1}{tmargin}{lmargin}%
+ \Gm@branch{#1}{bmargin}{rmargin}}%
+\define@key{Gm}{headsep}{\Gm@defbylen{ltj@headsep}{#1}}%
+\define@key{Gm}{footskip}{\Gm@defbylen{ltj@footskip}{#1}}%
+\let\KV@Gm@foot\KV@Gm@footskip
+\define@key{Gm}{vmarginratio}{\edef\Gm@hmarginratio{#1}}%
+\define@key{Gm}{hmarginratio}{\edef\Gm@vmarginratio{#1}}%
+\define@key{Gm}{nohead}[true]{\Gm@doifelse{nohead}{#1}%
+ {\Gm@setlength\headheight\z@\Gm@defbylen{ltj@headsep}\z@}{}}%
+\define@key{Gm}{nofoot}[true]{\Gm@doifelse{nofoot}{#1}%
+ {\Gm@defbylen{ltj@footskip}\z@}{}}%
+\define@key{Gm}{noheadfoot}[true]{\Gm@doifelse{noheadfoot}{#1}%
+ {\Gm@setlength\headheight\z@\Gm@defbylen{ltj@headsep}\z@
+ \Gm@defbylen{ltj@footskip}\z@}{}}%
+
+% \@mparswitch は傍注の出力位置を左右ページで変えるスイッチだが,
+% geometry.sty はこれを左右ページのレイアウトを変えるか否かの判定にも使っている.
+% 縦組クラスの場合は \@mparswitch は常に偽でないとおかしなことになるので
+% \@mparswitch -> \Gm@ltj@layoutswitch と名称変更する.
+
+\let\Gm@ltj@layoutswitch\@mparswitch
+\@mparswitchfalse
+\define@key{Gm}{twoside}[true]{\Gm@doifelse{twoside}{#1}%
+ {\@twosidetrue\Gm@ltj@layoutswitchtrue}{\@twosidefalse\Gm@ltj@layoutswitchfalse}}%
+\define@key{Gm}{asymmetric}[true]{\Gm@doifelse{asymmetric}{#1}%
+ {\@twosidetrue\Gm@ltj@layoutswitchfalse}{}}%
+
+% includemp 指定時は,\headsep (if reversemp || twocolumn) や,
+% \footskip (if !reversemp || twocolumn) を傍注幅だけ増加させる.
+
+% h <-> v
+\def\Gm@Dhratio{2:3}% = top:bottom default
+\def\Gm@Dvratio{1:1}% = left:right default for oneside
+\def\Gm@Dvratiotwo{3:2}% = inner:outer default for twoside.
+\ifGm@swap@papersize
+ % geometry.sty ロード時に landscape オプションが指定されていた場合,
+ % それによって用紙サイズの縦横が入れ替わってしまっているので補正する.
+ \setlength\@tempdima{\paperwidth}%
+ \setlength\paperwidth{\paperheight}%
+ \setlength\paperheight{\@tempdima}%
+\fi
+
+% save length
+\def\Gm@save{%
+ \Gm@savelength{paperwidth}%
+ \Gm@savelength{paperheight}%
+ \Gm@savelength{textwidth}%
+ \Gm@savelength{textheight}%
+ \Gm@savelength{evensidemargin}%
+ \Gm@savelength{oddsidemargin}%
+ \Gm@savelength{topmargin}%
+ \Gm@savelength{headheight}%
+ %\Gm@savelength{headsep}%
+ \Gm@savelength{topskip}%
+ %\Gm@savelength{footskip}%
+ \Gm@savelength{baselineskip}%
+ \Gm@savelength{marginparwidth}%
+ \Gm@savelength{marginparsep}%
+ \Gm@savelength{columnsep}%
+ \Gm@savelength{hoffset}%
+ \Gm@savelength{voffset}
+ \Gm@savelength{Gm@layoutwidth}%
+ \Gm@savelength{Gm@layoutheight}%
+ \Gm@savelength{Gm@layouthoffset}%
+ \Gm@savelength{Gm@layoutvoffset}%
+ \Gm@saveboolean{@twocolumn}%
+ \Gm@saveboolean{@twoside}%
+ \Gm@saveboolean{Gm@ltj@layoutswitch}%
+ \Gm@saveboolean{@reversemargin}}%
+
+% frame
+\ifluatex
+ \def\Gm@pageframe@cmd{\vb@xt@\z@}
+\else
+ \def\Gm@pageframe@cmd{\vb@xt@\z@\bgroup\yoko\aftergroup\egroup}
+\fi
+\renewcommand*{\Gm@pageframes}{%
+ \Gm@pageframe@cmd{%
+ \ifGm@showcrop
+ \vb@xt@\z@{\vskip-1\Gm@truedimen in\vskip\Gm@layoutvoffset%
+ \hb@xt@\z@{\hskip-1\Gm@truedimen in\hskip\Gm@layouthoffset%
+ \vb@xt@\Gm@layoutheight{%
+ \let\protect\relax
+ \hb@xt@\Gm@layoutwidth{\Gm@cropmark(-1,1,-3,3)\hfil\Gm@cropmark(1,1,3,3)}%
+ \vfil
+ \hb@xt@\Gm@layoutwidth{\Gm@cropmark(-1,-1,-3,-3)\hfil\Gm@cropmark(1,-1,3,-3)}}%
+ \hss}%
+ \vss}%
+ \fi%
+ \ifGm@showframe
+ \if@twoside
+ \ifodd\count\z@
+ \let\@themargin\oddsidemargin
+ \else
+ \let\@themargin\evensidemargin
+ \fi
+ \fi
+ \moveright\@themargin%
+ \vb@xt@\z@{%
+ \vskip\topmargin\vb@xt@\z@{\vss\Gm@hrule}%
+ \vskip\headheight\vb@xt@\z@{\vss\Gm@hruled}%
+ \vskip\headsep\vb@xt@\z@{\vss\Gm@hrule}%
+ \if@reversemargin\vb@xt@\z@{%
+ \vss\vb@xt@\z@{\vss\Gm@hrule}%
+ \vskip\marginparwidth\vb@xt@\z@{\vss\Gm@hrule}%
+ \vskip\marginparsep
+ }\fi
+ \hb@xt@\textwidth{\llap{\Gm@vrule}\hfil\Gm@vrule}%
+ \vb@xt@\z@{\vss\Gm@hruled}%
+ \unless\if@reversemargin\vb@xt@\z@{%
+ \vskip\marginparsep\vb@xt@\z@{\vss\Gm@hrule}%
+ \vskip\marginparwidth\vb@xt@\z@{\vss\Gm@hruled}\vss%
+ }\fi%
+ \vskip\footskip\vb@xt@\z@{\vss\Gm@hruled}%
+ \vss}%
+ \fi%
+ }}
+\def\Gm@detall#1#2#3#4{%
+ \@tempcnta\z@
+ \if#1h
+ \let\Gm@mratio\Gm@hmarginratio
+ \edef\Gm@Dmratio{\Gm@Dhratio}%
+ \else
+ \let\Gm@mratio\Gm@vmarginratio
+ \edef\Gm@Dmratio{\if@twoside\Gm@Dvratiotwo\else\Gm@Dvratio\fi}%
+ \fi
+ \if#1h
+ \ifx\Gm@tmargin\@undefined\else\advance\@tempcnta4\relax\fi
+ \ifGm@hbody\advance\@tempcnta2\relax\fi
+ \ifx\Gm@bmargin\@undefined\else\advance\@tempcnta1\relax\fi
+ \Gm@cnth\@tempcnta
+ \else
+ \ifx\Gm@lmargin\@undefined\else\advance\@tempcnta4\relax\fi
+ \ifGm@vbody\advance\@tempcnta2\relax\fi
+ \ifx\Gm@rmargin\@undefined\else\advance\@tempcnta1\relax\fi
+ \Gm@cntv\@tempcnta
+ \fi
+ \ifcase\@tempcnta
+ \if#1h
+ \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
+ \else
+ \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
+ \fi
+ \Gm@detiiandiii{#2}{#3}{#4}%
+ \or
+ \ifx\Gm@mratio\@undefined
+ \if#1h
+ \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
+ \else
+ \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
+ \fi
+ \setlength\@tempdimc{\@nameuse{Gm@#4}}%
+ \Gm@detiiandiii{#2}{#3}{#4}%
+ \expandafter\let\csname Gm@#2\endcsname\@undefined
+ \Gm@defbylen{#4}{\@tempdimc}%
+ \else
+ \Gm@setbyratio[f]{#1}{#4}{#3}%
+ \fi
+ \Gm@detiv{#2}{#3}{#4}{#2}%
+ \or\Gm@detiiandiii{#2}{#3}{#4}%
+ \or\Gm@detiv{#2}{#2}{#4}{#3}%
+ \or
+ \ifx\Gm@mratio\@undefined
+ \if#1h
+ \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
+ \else
+ \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
+ \fi
+ \setlength\@tempdimc{\@nameuse{Gm@#3}}%
+ \Gm@detiiandiii{#2}{#4}{#3}%
+ \expandafter\let\csname Gm@#2\endcsname\@undefined
+ \Gm@defbylen{#3}{\@tempdimc}%
+ \else
+ \Gm@setbyratio[b]{#1}{#3}{#4}%
+ \fi
+ \Gm@detiv{#2}{#3}{#4}{#2}%
+ \or\Gm@detiv{#2}{#3}{#4}{#2}%
+ \or\Gm@detiv{#2}{#2}{#3}{#4}%
+ \or\Gm@warning{Over-specification in `#1'-direction.%
+ ^^J\@spaces `#2' (\@nameuse{Gm@#2}) is ignored}%
+ \Gm@detiv{#2}{#3}{#4}{#2}%
+ \else\fi}%
+\def\Gm@clean{%
+ \ifnum\Gm@cnth<4\let\Gm@tmargin\@undefined\fi
+ \ifodd\Gm@cnth\else\let\Gm@bmargin\@undefined\fi
+ \ifnum\Gm@cntv<4\let\Gm@lmargin\@undefined\fi
+ \ifodd\Gm@cntv\else\let\Gm@rmargin\@undefined\fi
+ \ifGm@hbody\else
+ \let\Gm@hscale\@undefined
+ \let\Gm@width\@undefined
+ \let\Gm@textwidth\@undefined
+ \fi
+ \ifGm@vbody\else
+ \let\Gm@vscale\@undefined
+ \let\Gm@height\@undefined
+ \let\Gm@textheight\@undefined
+ \fi
+ }%
+\def\Gm@adjustpaper{%
+ \ifdim\paperwidth>\p@\else
+ \PackageError{geometry}{%
+ \string\paperwidth\space(\the\paperwidth) too short}{%
+ Set a paper type (e.g., `a4paper').}%
+ \fi
+ \ifdim\paperheight>\p@\else
+ \PackageError{geometry}{%
+ \string\paperheight\space(\the\paperheight) too short}{%
+ Set a paper type (e.g., `a4paper').}%
+ \fi
+ \ifGm@swap@papersize
+ \setlength\@tempdima{\paperwidth}%
+ \setlength\paperwidth{\paperheight}%
+ \setlength\paperheight{\@tempdima}%
+ \fi
+ \ifGm@layout\else
+ \setlength\Gm@layoutwidth{\paperheight}%
+ \setlength\Gm@layoutheight{\paperwidth}%
+ \fi}%
+\def\Gm@adjustbody{
+ \ifGm@hbody
+ \ifx\Gm@width\@undefined
+ \ifx\Gm@hscale\@undefined
+ \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
+ \else
+ \Gm@defbylen{width}{\Gm@hscale\Gm@layoutwidth}%
+ \fi
+ \fi
+ \ifx\Gm@textwidth\@undefined\else
+ \setlength\@tempdima{\Gm@textwidth}%
+ \ifGm@includemp
+ \advance\@tempdima\Gm@wd@mp
+ \fi
+ \ifGm@includehead
+ \addtolength\@tempdima{\headheight}%
+ \addtolength\@tempdima{\headsep}%
+ \fi
+ \ifGm@includefoot
+ \addtolength\@tempdima{\footskip}%
+ \fi
+ \edef\Gm@width{\the\@tempdima}%
+ \fi
+ \fi
+ \ifGm@vbody
+ \ifx\Gm@height\@undefined
+ \ifx\Gm@vscale\@undefined
+ \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
+ \else
+ \Gm@defbylen{height}{\Gm@vscale\Gm@layoutheight}%
+ \fi
+ \fi
+ \setlength\topskip\Gm@ltj@topskip
+ \ifx\Gm@lines\@undefined\else
+ \@tempdima=\f@size\p@ \@tempdima=.5\@tempdima
+ \ifluatex
+ \advance\@tempdima\ltjgetparameter{talbaselineshift}%
+ \else
+ \advance\@tempdima\tbaselineshift
+ \fi
+ \ifdim\maxdepth<\@tempdima
+ \PackageWarningNoLine{lltjp-geometry}%
+ {\noexpand\maxdepth was changed from \the\maxdepth\space
+ to \the\@tempdima}
+ \maxdepth\@tempdima
+ \fi
+ \setbox\z@=\hbox{\tate% next \ifdim must be executed in tate dir.
+ \ifdim\topskip<\ht\tstrutbox
+ \@tempdima\topskip
+ \global\topskip\ht\tstrutbox
+ \PackageWarningNoLine{lltjp-geometry}%
+ {\noexpand\topskip was changed from \the\@tempdima\space
+ to \the\topskip}
+ \fi}%
+ \setlength\@tempdima{\baselineskip}%
+ \multiply\@tempdima\Gm@lines
+ \addtolength\@tempdima{\topskip}%
+ \addtolength\@tempdima{-\baselineskip}%
+ \edef\Gm@textheight{\the\@tempdima}%
+ \fi
+ \ifx\Gm@textheight\@undefined\else
+ \edef\Gm@height{\Gm@textheight}%
+ \fi
+ \fi}%
+
+\def\Gm@adjustmp{%
+ \ifGm@includemp
+ \@tempdimb\marginparwidth
+ \advance\@tempdimb\marginparsep
+ \Gm@wd@mp\@tempdimb
+ \if@twocolumn
+ \Gm@wd@mp2\@tempdimb
+ \fi
+ \fi}%
+\def\Gm@@process{%
+ \Gm@expandlengths
+ \Gm@adjustpaper
+ \addtolength\Gm@layoutheight{-\Gm@bindingoffset}%
+ \Gm@adjustmp
+ \Gm@adjustbody
+ \Gm@detall{h}{width}{tmargin}{bmargin}%
+ \Gm@detall{v}{height}{lmargin}{rmargin}%
+ \setlength\textwidth{\Gm@width}%
+ \setlength\textheight{\Gm@height}%
+ \setlength\headsep{\Gm@ltj@headsep}%
+ \setlength\footskip{\Gm@ltj@footskip}%
+ \setlength\topmargin{\Gm@tmargin}%
+ \setlength\oddsidemargin{\Gm@lmargin}%
+ \addtolength\oddsidemargin{-1\Gm@truedimen in}%
+ \ifGm@ltj@layoutswitch
+ \setlength\evensidemargin{\Gm@rmargin}%
+ \addtolength\evensidemargin{-1\Gm@truedimen in}%
+ \else
+ \evensidemargin\oddsidemargin
+ \fi
+ \advance\evensidemargin\Gm@bindingoffset
+ \addtolength\topmargin{-1\Gm@truedimen in}%
+ \ifGm@includehead
+ \addtolength\textwidth{-\headheight}%
+ \addtolength\textwidth{-\headsep}%
+ \else
+ \addtolength\topmargin{-\headheight}%
+ \addtolength\topmargin{-\headsep}%
+ \fi
+ \ifGm@includefoot
+ \addtolength\textwidth{-\footskip}%
+ \fi
+ \ifGm@includemp
+ \advance\textwidth-\Gm@wd@mp
+ \if@twocolumn
+ \advance\headsep.5\Gm@wd@mp
+ \advance\footskip.5\Gm@wd@mp
+ \else\if@reversemargin
+ \advance\headsep\Gm@wd@mp
+ \else
+ \advance\footskip\Gm@wd@mp
+ \fi\fi
+ \fi
+ \ifGm@heightrounded
+ \setlength\@tempdima{\textheight}%
+ \addtolength\@tempdima{-\topskip}%
+ \@tempcnta\@tempdima
+ \@tempcntb\baselineskip
+ \divide\@tempcnta\@tempcntb
+ \setlength\@tempdimb{\baselineskip}%
+ \multiply\@tempdimb\@tempcnta
+ \advance\@tempdima-\@tempdimb
+ \multiply\@tempdima\tw@
+ \ifdim\@tempdima>\baselineskip
+ \addtolength\@tempdimb{\baselineskip}%
+ \fi
+ \addtolength\@tempdimb{\topskip}%
+ \textheight\@tempdimb
+ \fi
+ \advance\oddsidemargin\Gm@layoutvoffset%
+ \advance\evensidemargin\Gm@layoutvoffset%
+ \advance\topmargin\Gm@layouthoffset%
+ \addtolength\Gm@layoutheight{\Gm@bindingoffset}%
+}% end of \Gm@@process
+% log
+\def\Gm@logcontent#1{%
+ *geometry* verbose mode - [ #1 ] result:^^J%
+ \ifGm@pass * pass: disregarded the geometry package!^^J%
+ \else
+ * driver: \if\Gm@driver<none>\else\Gm@driver\fi^^J%
+ * paper: \ifx\Gm@paper\@undefined<default>\else\Gm@paper\fi^^J%
+ * layout: \ifGm@layout<custom>\else<same size as paper>\fi^^J%
+ \ifGm@layout
+ * layout(width,height): (\the\Gm@layoutwidth,\the\Gm@layoutheight)^^J%
+ \fi
+ * layoutoffset:(h,v)=(\the\Gm@layouthoffset,\the\Gm@layoutvoffset)^^J%
+ \@ifundefined{Gm@lines}{}{* lines: \Gm@lines^^J}%
+ \@ifundefined{Gm@hmarginratio}{}{* hratio: \Gm@hmarginratio^^J}%
+ \@ifundefined{Gm@vmarginratio}{}{* vratio: \Gm@vmarginratio^^J}%
+ \ifdim\Gm@bindingoffset=\z@\else
+ * bindingoffset: \the\Gm@bindingoffset^^J\fi
+ * modes: %
+ \Gm@showbool{landscape}%
+ \Gm@showbool{includehead}%
+ \Gm@showbool{includefoot}%
+ \Gm@showbool{includemp}%
+ \if@twoside twoside\space\fi%
+ \ifGm@ltj@layoutswitch\else\if@twoside asymmetric\space\fi\fi%
+ \Gm@showbool{heightrounded}%
+ \ifx\Gm@truedimen\@empty\else truedimen\space\fi%
+ \Gm@showbool{showframe}%
+ \Gm@showbool{showcrop}%
+ ^^J%
+ * h-part:(L,W,R)=(\Gm@lmargin, \Gm@height, \Gm@rmargin)^^J%
+ * v-part:(T,H,B)=(\Gm@tmargin, \Gm@width, \Gm@bmargin)^^J%
+ \fi
+ \Gm@showdim{\paperwidth}%
+ \Gm@showdim{\paperheight}%
+ \Gm@showdim{\textwidth}%
+ \Gm@showdim{\textheight}%
+ \Gm@showdim{\oddsidemargin}%
+ \Gm@showdim{\evensidemargin}%
+ \Gm@showdim{\topmargin}%
+ \Gm@showdim{\headheight}%
+ \Gm@showdim{\headsep}%
+ \Gm@showdim{\topskip}%
+ \Gm@showdim{\footskip}%
+ \Gm@showdim{\marginparwidth}%
+ \Gm@showdim{\marginparsep}%
+ \Gm@showdim{\columnsep}%
+ * \string\skip\string\footins=\the\skip\footins^^J%
+ \Gm@showdim{\hoffset}%
+ \Gm@showdim{\voffset}%
+ \Gm@showdim{\mag}%
+ * \string\@twocolumn\if@twocolumn true\else false\fi^^J%
+ * \string\@twoside\if@twoside true\else false\fi^^J%
+ * \string\@mparswitch\if@mparswitch true\else false\fi^^J%
+ * \string\@reversemargin\if@reversemargin true\else false\fi^^J%
+ * (1in=72.27pt=25.4mm, 1cm=28.453pt)^^J}%
+
+
+\Gm@initall
+\Gm@processconfig
+\ProcessOptionsKV[c]{Gm}%
+\Gm@setdefaultpaper
+\ProcessOptionsKV[p]{Gm}%
+\Gm@process
+
+%%% 終了
+\fi}
+\endinput
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty
index 3017f08563a..d14a48801ac 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty
@@ -329,4 +329,4 @@
\def\lstlistingname{ソースコード}
\def\lstlistlistingname{ソースコード目次}
% \end{修正事項}
-\endinput
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-stfloats.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-stfloats.sty
new file mode 100644
index 00000000000..e90cef4955f
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-stfloats.sty
@@ -0,0 +1,49 @@
+%
+% lltjp-stfloats.sty
+%
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{lltjp-stfloats}[2014/11/23 Patch to stfloats for LuaTeX-ja]
+
+\RequirePackage{stfloats,luatexja}
+
+\let\ltj@fn@makecol=\fn@makecol
+
+\gdef\fn@makecol{%
+ \setbox\@outputbox \box\@cclv
+ \let\@elt\relax
+ \xdef\@freelist{\@freelist\@midlist}%
+ \global \let \@midlist \@empty
+ \@combinefloats
+ \ifvoid\footins
+ \else
+ \setbox\@outputbox \vbox {%
+ \boxmaxdepth \@maxdepth
+ \unvbox \@outputbox
+ \vskip \skip\footins
+ \color@begingroup
+ \normalcolor
+ \footnoterule
+ \unvbox \footins
+ \color@endgroup
+ }%
+ \fi
+ \ifvbox\@kludgeins
+ \@makespecialcolbox
+ \else
+ \setbox\@outputbox \vbox to\@colht {%
+ \@texttop
+ \dimen@ \ltjgetdp\@outputbox
+ \unvbox \@outputbox
+ \ifnum\ltjgetparameter{direction}=3 \hskip\z@\fi %%% LuaTeX-ja
+ \vskip -\dimen@
+ \@textbottom
+ }%
+ \fi
+ \global \maxdepth \@maxdepth
+ }
+
+\ifx\@makecol\ltj@fn@makecol
+ \global\let\@makecol\fn@makecol
+\fi
+\endinput
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-tascmac.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-tascmac.sty
new file mode 100644
index 00000000000..4498e824e1b
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-tascmac.sty
@@ -0,0 +1,109 @@
+%
+% lltjp-tascmac.sty
+% \tbaselineshift=\z@ ==> \ltj@tablshift=\z@
+% \dimen...=\tbaselineshift ==> \dimen...=\ltj@tablshift sp
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{lltjp-tascmac}[2014/12/17 Patch to (t)ascmac for LuaTeX-ja]
+
+\RequirePackage{tascmac,luatexja}
+
+%% use Type1 font for ascgrp
+\ifdefined\pdfmapline
+ \pdfmapline{+ascgrp <ascgrp.pfb}
+\fi
+
+%% boxnote environment
+\def\boxnote{\par\vspace{\baselineskip}
+\@savetbaselineshift\ltj@tablshift sp\ltj@tablshift\z@
+\setbox\@nbox=\hbox{\@ascgrp\vrule width1.08pt depth35pt b\hss a\hss b}
+\@whiledim \wd\@nbox<\hsize \do{
+\setbox\@nbox=\hbox{\@ascgrp\unhbox\@nbox \hss a\hss b}}
+\setbox\@nbox=\hbox to\hsize{\@ascgrp\unhbox\@nbox \hss a\hss b%
+\vrule width1.08pt depth35pt}
+\@bw=\wd\@nbox\advance\@bw -40pt
+\begin{lrbox}{\@nbody}\begin{minipage}{\@bw}% (KN:1998/02/27)
+ \ltj@tablshift\@savetbaselineshift}%
+
+%% screen environment
+\def\screen{%
+\@savetbaselineshift\ltj@tablshift sp\ltj@tablshift\z@
+\@ifnextchar[{\@screen}{\@screen[0]}}
+\def\@screen[#1]{\ifcase#1\def\@r{20}\def\@s{9.8pt}\def\@sx{10pt}\or
+\def\@r{18}\def\@s{8.8pt}\def\@sx{9pt}\or
+\def\@r{16}\def\@s{7.8pt}\def\@sx{8pt}\or
+\def\@r{14}\def\@s{6.8pt}\def\@sx{7pt}\or
+\def\@r{12}\def\@s{5.8pt}\def\@sx{6pt}\or
+\def\@r{10}\def\@s{4.8pt}\def\@sx{5pt}\or
+\def\@r{8}\def\@s{3.8pt}\def\@sx{4pt}\or
+\def\@r{6}\def\@s{2.8pt}\def\@sx{3pt}\else
+\def\@r{4}\def\@s{1.8pt}\def\@sx{2pt}\fi
+\par\vspace{.3\baselineskip}\@scw\linewidth \advance\@scw -\@r pt
+\setbox\scb@x=\hbox to\@scw\bgroup\begin{minipage}{\@scw}% (KN:1998/02/27)
+ \ltj@tablshift\@savetbaselineshift}%
+
+%% itembox environment
+\def\@itembox[#1]#2{%
+ \par\vspace{.3\baselineskip}%
+ \setbox\@iboxstr=\hbox{#2}%
+ \@savetbaselineshift\ltj@tablshift sp\ltj@tablshift\z@
+ \@itemh\ht\@iboxstr\advance\@itemh\dp\@iboxstr
+ \vspace{.5\@itemh}\bgroup\@scw\linewidth
+ \advance\@scw-20pt\@iboxpos={#1}%
+ \setbox\scb@x=\hbox to\@scw\bgroup\begin{minipage}{\@scw}%
+ \ltj@tablshift\@savetbaselineshift
+ \vspace*{.5\@itemh}}%
+
+%% \keytop
+\def\@keytop[#1]#2{%
+{\setbox0=\hbox{\shortstack{#2}}\ltj@tablshift\z@%
+\dimen0=\wd0\advance\dimen0 5pt\dimen1=\dp0\advance\dimen1 2.5pt%
+\setbox\scscb@x=\hbox to\dimen0{%
+\@scw\wd0\hfil\vtop{\offinterlineskip
+\thinlines\setlength{\unitlength}{1pt}\hrule\kern2.3pt\@hobox{tl}{tr}5%
+\kern-2.4pt\box0\@hobox{bl}{br}5\kern-.25pt\hrule}\hfil}\dimen0=\dp\scscb@x%
+\setbox0=\vbox{\hbox{\hbox to0pt{\hss\vtop to\dimen0{\@vrf@{2.5pt}{.4pt}}}%
+\box\scscb@x\hbox to.2pt{\hss\vtop to\dimen0{\@vrf@{2.5pt}{.4pt}}}}}%
+\if #1c $\vcenter{\box0}$ \else \if #1t\else\if #1b\boxmaxdepth=0pt\else
+\boxmaxdepth=\dimen1\fi\fi \mbox{}\vbox{\box0}\fi}}
+
+%% \mask
+\def\mask#1#2{%
+{\setbox\@bwsp=\hbox{#1}\ltj@tablshift\z@\setbox0=\hbox{\@ascgrp#2}%
+\dimen0=\wd\@bwsp\dimen1=\ht\@bwsp\advance\dimen1\dp\@bwsp\dimen2=-\dimen1
+\setdim@{\dimen0}{\wd0}\setdim@{\dimen1}{\ht0}%
+\setbox\@@bwsp=\hbox to\dimen0{\leaders
+\vtop to\dimen1{\leaders\hbox{\@ascgrp#2}\vfil}\hfil}%
+\advance\dimen2\dp\@@bwsp\divide\dimen2 2
+\advance\dimen2\dp\@bwsp\boxmaxdepth=\dimen2
+\setbox\@@bwsp=\vbox{\box\@@bwsp}%
+\mbox{}\hbox to\wd\@@bwsp{\hbox to0pt{\box\@@bwsp\hss}\hss\unhbox\@bwsp\hss}}}
+
+%% \maskbox
+\def\Maskbox#1#2#3#4#5#6{{\setbox2=\hbox{#6}\ltj@tablshift\z@
+\setbox0=\hbox{\@ascgrp#3}%
+\dimen0=#1\@setdim{\dimen0}{\wd0}\dimen1=#2\@setdim{\dimen1}{\ht0}%
+\ifx#4c\skip0=0pt plus1fil\skip1=\skip0\fi
+\ifx#4r\skip0=0pt plus1fil\skip1=0pt\fi
+\ifx#4l\skip1=0pt plus1fil\skip0=0pt\fi
+\hbox{\hbox to0pt{\hbox to\dimen0{\leaders\vbox to\dimen1{\leaders
+\hbox{\@ascgrp#3}\vfil}\hfil}\hss}%
+\vrule width#5\vbox to\dimen1{\hrule height#5\vfil
+\dimen3=#5\advance\dimen0-2\dimen3\advance\dimen0 .15pt
+\hbox to\dimen0{\hskip\skip0\box2\hskip\skip1}%
+\vfil\hrule height#5}\vrule width#5}}}
+
+%% \yen
+%
+% \changes{1996/03/13}{v1.1}{Append \cs{leavevmode} in
+% \cs{yen}, \cs{return}, \cs{Return} command.}
+%
+\def\yen{\leavevmode\hbox{\yoko%
+\setbox0=\hbox{Y}Y\kern-.97\wd0\vbox{\hrule height.1ex width.98\wd0
+\kern.33ex\hrule height.1ex width.98\wd0\kern.45ex}}}
+%
+%% return-key
+\def\return{\leavevmode\hbox{\yoko\@ascgrp\char"20}}
+\def\Return{\leavevmode\hbox{\yoko\@ascgrp @}}
+
+\endinput