diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/patches')
4 files changed, 161 insertions, 116 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty index 29f38b367ad..e0dba375471 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty @@ -101,15 +101,15 @@ \def\@ltj@hook@family#1#2{ % #1: csname #2: contents \ifcsname @#1hook\endcsname % LaTeX 2020-02-02 - \csappto{@#1hook}{#2}% + \csappto{@#1hook}{#2}% \else % LaTeX 2019-10-01 - \ifcsname #1 \endcsname - \expandafter\patchcmd\csname #1 \endcsname{\selectfont}{#2\selectfont}{}{}% - \else - \PackageWarningNoLine{luatexja}{% - Patching to \expandafter\string\csname #1\endcsname\space failed% - }% - \fi + \ifcsname #1 \endcsname + \expandafter\patchcmd\csname #1 \endcsname{\selectfont}{#2\selectfont}{}{}% + \else + \PackageWarningNoLine{luatexja}{% + Patching to \expandafter\string\csname #1\endcsname\space failed% + }% + \fi \fi } \@ltj@hook@family{rmfamily}{% diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty index 9be20e440c6..3578a84396c 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty @@ -287,16 +287,16 @@ \every@math@size{}% \fontsize{#6}\z@ \ltj@@is@kyenc{#2}\ifin@% - \ltjselectfont@force@definetrue + \ltjselectfont@force@definetrue \usekanji{#2}{#3}{#4}{#5}% \global\let#1\getjfont - \ltjselectfont@force@definefalse + \ltjselectfont@force@definefalse \else \ltj@@is@ktenc{#2}\ifin@% - \ltjselectfont@force@definetrue + \ltjselectfont@force@definetrue \usekanji{#2}{#3}{#4}{#5}% \global\let#1\gettfont - \ltjselectfont@force@definefalse + \ltjselectfont@force@definefalse \else \useroman{#2}{#3}{#4}{#5}% \global\expandafter\let\expandafter#1\the\font @@ -379,7 +379,7 @@ \xdef\font@name{\csname\curr@kfontshape/\f@size\endcsname}% \pickup@jfont \unless\ifnum\ltjgetparameter{direction}=3 \font@name - \ltj@@does@alt@set{\curr@kfontshape}{% + \ltj@@does@alt@set{\curr@kfontshape}{% % alt fonts の定義 \directlua{luatexja.jfont.output_alt_font_cmd('y', '\luatexluaescapestring{\curr@kfontshape}')}% % 定義した alt fonts のデータを \ltjdeclarealtfont に渡すのと同等の処理をする @@ -432,14 +432,14 @@ \bgroup \def\ltj@@dir@patch#1#2#3{% \global\csletcs{ltj@@orig@#1}{#1}% - \protected\expandafter\xdef\csname #1\endcsname{% - \csname ltj@@orig@#1\endcsname + \protected\expandafter\xdef\csname #1\endcsname{% + \csname ltj@@orig@#1\endcsname \unexpanded{\ifnum#3<\z@\let\ltj@@protect\protect\set@typeset@protect}% \unexpanded{\global\let\ltj@afont@name=\font@name}% - \expandonce{\csname ltj@selectfont@#2\endcsname}% + \expandonce{\csname ltj@selectfont@#2\endcsname}% \unexpanded{\global\let\font@name=\ltj@afont@name}% \unexpanded{\let\protect\ltj@@protect\fi}% - }% + }% } \ltj@@dir@patch{yoko}{yoko}{\ltj@curjfnt} \ltj@@dir@patch{tate}{tate}{\ltj@curtfnt} @@ -601,7 +601,7 @@ \else \@tempswafalse \def\cdp@elt##1{\ifcsname ##1+#1\endcsname% - \@tempswatrue\def\cdp@elt####1\relax{}% + \@tempswatrue\def\cdp@elt####1\relax{}% \fi}% \directlua{luatexja.jfont.search_ffam_declared()}\relax% \if@tempswz @@ -659,8 +659,8 @@ } \else % !!! pl 3, 4 \def\set@target@series@kanji#1{% - \edef\k@series{#1}% - \edef\k@series{\expandafter\series@drop@one@m\k@series mm\series@drop@one@m}% + \edef\k@series{#1}% + \edef\k@series{\expandafter\series@drop@one@m\k@series mm\series@drop@one@m}% } \fi\fi @@ -670,7 +670,7 @@ \set@target@series@kanji{#2}% \else \begingroup\let\f@encoding\k@encoding\let\f@family\k@family - \maybe@load@fontshape\endgroup + \maybe@load@fontshape\endgroup \edef\reserved@a{\k@encoding /\k@family /#1/\k@shape}% \ifcsname \reserved@a \endcsname \set@target@series@kanji{#1}% @@ -702,7 +702,7 @@ \fi \else \begingroup\let\f@encoding\k@encoding\let\f@family\k@family - \maybe@load@fontshape\endgroup + \maybe@load@fontshape\endgroup \edef\reserved@a{\k@encoding /\k@family /\k@series/#1}% \ifcsname \reserved@a\endcsname \edef\k@shape{#1}% @@ -965,8 +965,8 @@ \let\extract@afont\extract@font \def\pickup@jfont{% \ifnum - \unless\ifnum\ltjgetparameter{direction}=3 1\else - \ifltjselectfont@force@define 1\else 0\fi\fi =1 % + \unless\ifnum\ltjgetparameter{direction}=3 1\else + \ifltjselectfont@force@define 1\else 0\fi\fi =1 % \expandafter \ifx \font@name \relax \let\extract@font\extract@jfont \define@newfont @@ -974,20 +974,20 @@ \fi \let\getjfont\font@name \else - \begingroup\escapechar\m@ne - \ifcsname ltj@@fontjfm/\expandafter\string\font@name\endcsname\else - \let\extract@font\extract@jfont@onlyjfm - \define@newfont - \let\extract@font\extract@afont - \fi - \endgroup - \csname ltj@@fontjfm/\expandafter\expandafter\expandafter\@gobble\expandafter\string\font@name\endcsname + \begingroup\escapechar\m@ne + \ifcsname ltj@@fontjfm/\expandafter\string\font@name\endcsname\else + \let\extract@font\extract@jfont@onlyjfm + \define@newfont + \let\extract@font\extract@afont + \fi + \endgroup + \csname ltj@@fontjfm/\expandafter\expandafter\expandafter\@gobble\expandafter\string\font@name\endcsname \fi } \def\pickup@tfont{% \ifnum - \ifnum\ltjgetparameter{direction}=3 1\else - \ifltjselectfont@force@define 1\else 0\fi\fi =1 % + \ifnum\ltjgetparameter{direction}=3 1\else + \ifltjselectfont@force@define 1\else 0\fi\fi =1 % \expandafter \ifx \font@name \relax \let\extract@font\extract@tfont \define@newfont @@ -995,14 +995,14 @@ \fi \let\gettfont\font@name \else - \begingroup\escapechar\m@ne - \ifcsname ltj@@fontjfm/\expandafter\string\font@name\endcsname\else - \let\extract@font\extract@tfont@onlyjfm - \define@newfont - \let\extract@font\extract@afont - \fi - \endgroup - \csname ltj@@fontjfm/\expandafter\expandafter\expandafter\@gobble\expandafter\string\font@name\endcsname + \begingroup\escapechar\m@ne + \ifcsname ltj@@fontjfm/\expandafter\string\font@name\endcsname\else + \let\extract@font\extract@tfont@onlyjfm + \define@newfont + \let\extract@font\extract@afont + \fi + \endgroup + \csname ltj@@fontjfm/\expandafter\expandafter\expandafter\@gobble\expandafter\string\font@name\endcsname \fi } @@ -1010,18 +1010,18 @@ % わざと「ゴミをつける」 \def\ltj@@patch@external@font#1 at{% \directlua{ - local s = '\luatexluaescapestring{#1}' - local is_braced, is_quoted - if s:sub(1,1)=='{' and s:sub(-1)=='}' then is_braced=true; s=s:sub(2,-2) end - if s:sub(1,1)=='"' and s:sub(-1)=='"' then is_quoted=true; s=s:sub(2,-2) end - s=s..luatexja.jfont.print_aftl_address() - if is_braced then s='{'..s..'}' elseif is_quoted then s='"'..s..'"' end - %print(s, is_quoted, is_braced) + local s = '\luatexluaescapestring{#1}' + local is_braced, is_quoted + if s:sub(1,1)=='{' and s:sub(-1)=='}' then is_braced=true; s=s:sub(2,-2) end + if s:sub(1,1)=='"' and s:sub(-1)=='"' then is_quoted=true; s=s:sub(2,-2) end + s=s..luatexja.jfont.print_aftl_address() + if is_braced then s='{'..s..'}' elseif is_quoted then s='"'..s..'"' end + %print(s, is_quoted, is_braced) tex.sprint(-2, s)}% \space at% } \def\extract@jfont{% - \get@external@font + \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}% }% @@ -1029,7 +1029,7 @@ \csname \f@encoding+\f@family\endcsname \csname\curr@fontshape\endcsname} \def\extract@tfont{% - \get@external@font + \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}% }% @@ -1044,15 +1044,15 @@ } \luadef\ltj@@jfont@@jfmonly \ltj@@jfont@@jfmonly@@inner \def\extract@jfont@onlyjfm{% - \get@external@font - \csxdef{ltj@@fontjfm/\expandafter\string\font@name}{% - \ltj@@jfont@@jfmonly{\external@font}{yoko}% - }} + \get@external@font + \csxdef{ltj@@fontjfm/\expandafter\string\font@name}{% + \ltj@@jfont@@jfmonly{\external@font}{yoko}% +}} \def\extract@tfont@onlyjfm{% - \get@external@font - \csxdef{ltj@@fontjfm/\expandafter\string\font@name}{% - \ltj@@jfont@@jfmonly{\external@font}{tate}% - }} + \get@external@font + \csxdef{ltj@@fontjfm/\expandafter\string\font@name}{% + \ltj@@jfont@@jfmonly{\external@font}{tate}% +}} \let\ltj@@al@do@subst@correction=\do@subst@correction \def\ltj@@ja@do@subst@correction{% @@ -1106,7 +1106,7 @@ \math@bgroup \expandafter\ifx\csname M@\f@encoding\endcsname#1\else #1\fi\ltj@tempcnta=#2 - \expandafter\ltj@@mathJapaneseFonts\string#1/\relax% + \expandafter\ltj@@mathJapaneseFonts\string#1/\relax% \ifin@\jfam#2\relax\else\mathgroup#2\relax\fi \expandafter\math@egroup\fi}% @@ -1138,7 +1138,7 @@ \the\ltj@tempcnta,\the\ltj@tempcntb, '\luatexluaescapestring{\ltj@temp@afont}', '\luatexluaescapestring{\ltj@temp@bfont}')}% - } +} %%%% \ClearAlternateKanjiFont<Benc><Bfam><Bser><Bshape> % いつも global @@ -1161,59 +1161,4 @@ \ltj@@getjfontnumber#1% \directlua{luatexja.jfont.pickup_alt_font_b(\the\ltj@tempcntc,'\luatexluaescapestring{#2}')}% } - -%%%% patch \@text@composite because of {y,t}albaselineshift - -% %% \pltx@isletter from plfonts.dtx -% \def\pltx@mark{\pltx@mark@} -% \let\pltx@scanstop\relax -% \long\def\pltx@cond#1\fi{% -% #1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} -% \long\def\pltx@isletter#1{% -% \expandafter\pltx@isletter@i#1\pltx@scanstop} -% \long\def\pltx@isletter@i#1\pltx@scanstop{% -% \pltx@cond\ifx\pltx@mark#1\pltx@mark\fi{\@firstoftwo}% -% {\pltx@isletter@ii\pltx@scanstop#1\pltx@scanstop{}#1\pltx@mark}} -% \long\def\pltx@isletter@ii#1\pltx@scanstop#{% -% \pltx@cond\ifx\pltx@mark#1\pltx@mark\fi% -% {\pltx@isletter@iii}{\pltx@isletter@iv}} -% \long\def\pltx@isletter@iii#1\pltx@mark{\@secondoftwo} -% \long\def\pltx@isletter@iv#1#2#3\pltx@mark{% -% \pltx@cond\ifx\pltx@mark#3\pltx@mark\fi{% -% \pltx@cond{\ifnum0\ifcat A\noexpand#21\fi\ifcat=\noexpand#21\fi>\z@}\fi -% {\@firstoftwo}{\@secondoftwo}% -% }{\@secondoftwo}} -% -% \def\@text@composite@x#1#2{% -% \ifx#1\relax -% #2% -% \else\pltx@isletter{#1}{#1}{% -% \begingroup -% \setbox\z@\hbox\bgroup% -% \ltj@yablshift\z@ \ltj@tablshift\z@ -% #1% -% \@tempcntb\directlua{luatexja.pltx_composite_last_node_char()}%) -% \xdef\pltx@composite@temp{\noexpand\@tempcntb=\the\@tempcntb\relax}% -% \aftergroup\pltx@composite@temp -% \egroup -% \ifnum\ltjgetparameter{direction}=3 % -% \@tempdima=\ltj@tablshift sp\else\@tempdima=\ltj@yablshift sp\fi -% \ifnum\@tempcntb<\z@\@tempcnta\z@\else -% \@tempcnta=\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{\@tempcntb}}\relax -% \ifnum\@tempcnta=\z@\@tempdima\z@\fi -% \fi -% \ifnum\@tempcnta>\z@ -% \ifodd\ltjgetparameter{alxspmode}{\@tempcntb}\else\leavevmode\hbox{}\fi -% \begingroup\mathsurround\z@$% -% \hbox{\lower\@tempdima\box\z@} -% $\endgroup% -% \ifnum\ltjgetparameter{alxspmode}{\@tempcntb}<2\hbox{}\fi -% \else -% \ifdim\@tempdima=\z@{\ltj@yablshift\z@ \ltj@tablshift\z@#1}% -% \else\lower\@tempdima\box\z@\fi -% \fi -% \endgroup}% -% \fi -% } - \endinput diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-atbegshi.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-atbegshi.sty new file mode 100644 index 00000000000..ecdfd48c225 --- /dev/null +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-atbegshi.sty @@ -0,0 +1,79 @@ +% +% lltjp-atbegshi.sty +% + +\ifdefined\NeedsTeXFormat + \NeedsTeXFormat{LaTeX2e} + \ProvidesPackage{lltjp-atbegshi}[2020-07-30 Patch to atbegshi for LuaTeX-ja] + \RequirePackage{atbegshi} +\else + \input atbegshi.sty +\fi + +%-------------------------------------- +% following codes are almost copied from +% pxatbegshi.sty 2019/09/07 v0.5 (in platex-tools bundle, by H. Yamashita). + +%% internal macros are locally effective +\begingroup + +%--------------------------------------- helpers + +%% unique tokens +\def\pxabgs@mark{\pxabgs@mark@} +\def\pxabgs@fin{\pxabgs@fin@} + +%% \pxabgs@patch@cmd\CMD{<orig>}{<new>} +\def\pxabgs@patch@cmd#1#2#3{% + \ifx#1\relax\else + \def\pxabgs@next##1#2##2\pxabgs@mark##3\pxabgs@fin{% + \ifx\pxabgs@mark##3\pxabgs@mark + \let#1\relax + \else + \def\pxabgs@fragment{##2}% + \def#1{##1#3##2}% + \fi}% + \expandafter\pxabgs@next#1\pxabgs@mark#2\pxabgs@mark\pxabgs@fin + \fi +} + +%--------------------------------------- + +% concept: execute all hooks inside yoko direction \vbox + +% prepare +\let\pxabgs@AtBegShi@Output\AtBegShi@Output +% try first patch +\pxabgs@patch@cmd\pxabgs@AtBegShi@Output + {\let\AtBegShi@OrgProtect\protect}% + {\setbox8\vbox\bgroup\yoko\let\AtBegShi@OrgProtect\protect} +\pxabgs@patch@cmd\pxabgs@AtBegShi@Output + {\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox}% + {\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox\egroup} +\pxabgs@patch@cmd\pxabgs@AtBegShi@Output + {% + \begingroup + \setbox\AtBeginShipoutBox\box\AtBeginShipoutBox + \endgroup + \let\protect\AtBegShi@OrgProtect + }{% + \begingroup + \setbox\AtBeginShipoutBox\box\AtBeginShipoutBox + \endgroup + \let\protect\AtBegShi@OrgProtect + \egroup + } +% commit the change only when successful +\ifx\pxabgs@AtBegShi@Output\relax + \@PackageWarningNoLine{lltjp-atbegshi}{% + Failed in patching \string\AtBegShi@Output.\MessageBreak + This may cause error in tate direction% + } +\else + \global\let\AtBegShi@Output\pxabgs@AtBegShi@Output +\fi + +\endgroup +%% internal macros are no longer effective + +\endinput diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-everyshi.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-everyshi.sty new file mode 100644 index 00000000000..e9510e24870 --- /dev/null +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-everyshi.sty @@ -0,0 +1,21 @@ +% +% lltjp-everyshi.sty 2020-07-27 +% almost the same as pxeveryshi package by ZR +% + +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{everyshi} + +\def\@EveryShipout@Output{% + \setbox8\vbox{% + \yoko + \@EveryShipout@Hook + \@EveryShipout@AtNextHook + \global\setbox\luatexoutputbox=\box\luatexoutputbox + }% + \gdef\@EveryShipout@AtNextHook{}% + \@EveryShipout@Org@Shipout\box\luatexoutputbox +} + + +\endinput |