X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Faddons%2Fluatexja-ajmacros.sty;h=016fda3055bd4d1a91fd86e420a564e7b8e9b277;hb=ab23049deb6fb90ca689fdf4924b3783f08f8f2e;hp=0cd516ccfac0eb1440af882a1b22cef14f522ade;hpb=bee8063ebf717af89d29cb13849ac07d0f0156df;p=luatex-ja%2Fluatexja.git diff --git a/src/addons/luatexja-ajmacros.sty b/src/addons/luatexja-ajmacros.sty index 0cd516c..016fda3 100644 --- a/src/addons/luatexja-ajmacros.sty +++ b/src/addons/luatexja-ajmacros.sty @@ -4,9 +4,7 @@ % Original: % \ProvidesPackage{ajmacros}[2005/12/25 13:52 iNOUE Koich! ] % -% Note 1: \aj半角 is renamed \ajHankaku -% Note 2: Comment out \ajQuote -% + %% Avoid multiple loading. \csname\if11luatexjaajmacrosLoaded\fi\endcsname @@ -70,7 +68,7 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja-ajmacros}[2011/09/19 v0.1] + \ProvidesPackage{luatexja-ajmacros}[2014/07/02] \fi % %%------------------ @@ -82,13 +80,14 @@ \ifltj@in@latex\else \def\@tw{\char"2} \def\@ifstar#1#2#3{\ifx*#3\expandafter#1\else#2{#3}\fi} + \long\def\@gobble#1{} \fi {% \gdef\shift@CID#1#2{{\@tempcnta#1\advance\@tempcnta#2\CID{\@tempcnta}}} \gdef\ajTsumesuji{\@ifstar{\@@ajTsumesuji}{\@ajTsumesuji}} \global\let\ajTumesuji\ajTsumesuji -\gdef\@ajTsumesuji#1#2{{\@tempcnta\ifydir\ifcase#1\or780\or247\or9758\or9738\fi +\gdef\@ajTsumesuji#1#2{{\@tempcnta\unless\ifnum\ltjgetparameter{direction}=3 \ifcase#1\or780\or247\or9758\or9738\fi \else\ifcase#1\or8736\or8966\or13274\or13254\fi\fi \aj@expand\aj@Tsumesuji#2\@nil}} \gdef\@@ajTsumesuji#1{\@ajTsumesuji{\aj@expand\aj@count@toks#14321\@nil}{#1}} @@ -227,15 +226,15 @@ % \gdef\ajTsumekakko#1{\aj@expand\@ajTsumekakko#1\@nil} \global\let\ajTumekakko\ajTsumekakko -\gdef\@ajTsumekakko#1#2{\ifx\@nil#2\mbox{\ifydir\rlap{\CID{10233}}\shift@CID{#1}{9872}% +\gdef\@ajTsumekakko#1#2{\ifx\@nil#2\mbox{\unless\ifnum\ltjgetparameter{direction}=3 \rlap{\CID{10233}}\shift@CID{#1}{9872}% \else\CID{13268}\shift@CID{#1}{10185}\CID{13269}\fi}% \expandafter\@gobble - \else\shift@CID{#1}{\ifydir10152\else10174\fi}% + \else\shift@CID{#1}{\unless\ifnum\ltjgetparameter{direction}=3 10152\else10174\fi}% \expandafter\aj@Tsumekakko \fi#2} -\gdef\aj@Tsumekakko#1#2{\ifx\@nil#2\shift@CID{#1}{\ifydir10162\else10196\fi}% +\gdef\aj@Tsumekakko#1#2{\ifx\@nil#2\shift@CID{#1}{\unless\ifnum\ltjgetparameter{direction}=3 10162\else10196\fi}% \expandafter\@gobble - \else\shift@CID{#1}{\ifydir247\else10185\fi}% + \else\shift@CID{#1}{\unless\ifnum\ltjgetparameter{direction}=3 247\else10185\fi}% \expandafter\aj@Tsumekakko \fi#2} \gdef\ajNenrei#1{\ifcase#1\relax\expandafter\ajTsumekakko\or\expandafter\aj@NenreiTu @@ -243,14 +242,14 @@ \or\expandafter\aj@Nenrei@Sai \fi} \gdef\aj@NenreiTu#1{\aj@expand\@aj@NenreiTu#1\@nil} -\gdef\@aj@NenreiTu#1#2{\shift@CID{#1}{\ifydir10152\else10174\fi}% - \ifx\@nil#2\CID{\ifydir10172\else10206\fi}\expandafter\@gobble +\gdef\@aj@NenreiTu#1#2{\shift@CID{#1}{\unless\ifnum\ltjgetparameter{direction}=3 10152\else10174\fi}% + \ifx\@nil#2\CID{\unless\ifnum\ltjgetparameter{direction}=3 10172\else10206\fi}\expandafter\@gobble \else\expandafter\aj@Tsumekakko \fi#2} \gdef\aj@NenreiSai#1{\aj@expand\@aj@NenreiSai#1\@nil} -\gdef\@aj@NenreiSai#1{\shift@CID{#1}{\ifydir10152\else10174\fi}\@aj@NenreiSai@} -\gdef\@aj@NenreiSai@#1{\ifx\@nil#1\CID{\ifydir10173\else10207\fi}% - \else\shift@CID{#1}{\ifydir247\else10185\fi}% +\gdef\@aj@NenreiSai#1{\shift@CID{#1}{\unless\ifnum\ltjgetparameter{direction}=3 10152\else10174\fi}\@aj@NenreiSai@} +\gdef\@aj@NenreiSai@#1{\ifx\@nil#1\CID{\unless\ifnum\ltjgetparameter{direction}=3 10173\else10207\fi}% + \else\shift@CID{#1}{\unless\ifnum\ltjgetparameter{direction}=3 247\else10185\fi}% \expandafter\@aj@NenreiSai@\fi} \gdef\aj@Nenrei@Tu#1{\ifnum#1<10 \shift@CID{#1}{10174}\CID{10206}% \else\expandafter\@aj@Nenrei@Tu\number#1% @@ -326,21 +325,21 @@ %2/3 9376 12892 9696 13212 % % -\def\@ajHankakudef#1{\ifx\@nil#1\else - \expandafter\xdef\csname ajHankaku@#1\endcsname{\noexpand\CID - {\noexpand\ifydir\number\@tempcnta\noexpand\else\number\@tempcntb\noexpand\fi}}% +\def\@aj半角def#1{\ifx\@nil#1\else + \expandafter\xdef\csname aj半角@#1\endcsname{\noexpand\CID + {\noexpand\unless\noexpand\ifnum\noexpand\ltjgetparameter\noexpand{direction\noexpand}=3 \number\@tempcnta\noexpand\else\number\@tempcntb\noexpand\fi}}% \advance\@tempcnta\@ne\advance\@tempcntb\@ne - \expandafter\@ajHankakudef\fi} + \expandafter\@aj半角def\fi} \@tempcnta326 \@tempcntb9084 -\@ajHankakudef  。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゛゜`ヰヱヮヵヶヴガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポ\@nil +\@aj半角def  。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゛゜`ヰヱヮヵヶヴガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポ\@nil \@tempcnta516 -\@ajHankakudef をぁぃぅぇぉゃゅょっあいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわんゐゑゎがぎぐげござじずぜぞだぢづでどばぱびぴぶぷべぺぼぽ\@nil -\gdef\ajHankaku#1{\aj@Hankaku#1\@nil} -\gdef\aj@Hankaku#1{\ifx\@nil#1\else - \expandafter\ifx\csname ajHankaku@#1\endcsname\relax - #1\else\csname ajHankaku@#1\endcsname\fi - \expandafter\aj@Hankaku\fi} +\@aj半角def をぁぃぅぇぉゃゅょっあいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわんゐゑゎがぎぐげござじずぜぞだぢづでどばぱびぴぶぷべぺぼぽ\@nil +\gdef\aj半角#1{\aj@半角#1\@nil} +\gdef\aj@半角#1{\ifx\@nil#1\else + \expandafter\ifx\csname aj半角@#1\endcsname\relax + #1\else\csname aj半角@#1\endcsname\fi + \expandafter\aj@半角\fi} % % \def\@ajligdef#1#2{\expandafter\xdef\csname ajLig\@ajmojifam#1\endcsname{\noexpand\CID{#2}}} @@ -348,7 +347,7 @@ \@ajligdef{#1}{\number\@tempcnta}\advance\@tempcnta\@ne \expandafter\@ajligaturedef\fi} \def\@aj@ligdef#1#2#3{\expandafter\xdef\csname ajLig\@ajmojifam#1\endcsname - {\noexpand\CID{\noexpand\ifydir#2\noexpand\else#3\noexpand\fi}}} + {\noexpand\CID{\noexpand\unless\noexpand\ifnum\noexpand\ltjgetparameter\noexpand{direction\noexpand}=3 #2\noexpand\else#3\noexpand\fi}}} \def\@aj@ligaturedef#1{\ifx\@nil#1\else \@aj@ligdef{#1}{\number\@tempcnta}{\number\@tempcntb}% \advance\@tempcnta\@ne\advance\@tempcntb\@ne @@ -507,10 +506,10 @@ \def\@ajkanadef#1#2#3#4#5#6#7{\expandafter\gdef\csname ajLig#1\endcsname {\if@kana\def\reserved@a{ruby}% \ifx\k@family\reserved@a - \ifydir\CID{#6}\else\CID{#7}\fi - \else\ifydir\CID{#4}\else\CID{#5}\fi + \unless\ifnum\ltjgetparameter{direction}=3 \CID{#6}\else\CID{#7}\fi + \else\unless\ifnum\ltjgetparameter{direction}=3 \CID{#4}\else\CID{#5}\fi \fi - \else\ifydir\CID{#2}\else\CID{#3}\fi + \else\unless\ifnum\ltjgetparameter{direction}=3 \CID{#2}\else\CID{#3}\fi \fi}} \newcount\@tempcntc \newcount\@tempcntd @@ -794,42 +793,45 @@ % \gdef\ajLeader{\@ifnextchar[{\aj@Leader}{\aj@Leader[\z@ plus1fill]}} \gdef\aj@Leader[#1]#2{{\@tempcnta#2\multiply\@tempcnta\tw@ - \advance\@tempcnta1221\ifhmode\ifydir4\else5\fi\else\ifydir5\else4\fi\fi + \advance\@tempcnta1221\ifhmode\unless\ifnum\ltjgetparameter{direction}=3 4\else5\fi\else\unless\ifnum\ltjgetparameter{direction}=3 5\else4\fi\fi \leaders\hbox{\CID{\@tempcnta}}\ifhmode\hskip\else\vskip\fi#1}} % % -%% \toks0{}\toks1{}\toks2{}\toks3{} -%% \def\ajQuotedef#1 #2 #3 #4 {\ifx*#1\else -%% \toks0\expandafter{\the\toks0 \or#1}% -%% \toks1\expandafter{\the\toks1 \or#2}% -%% \toks2\expandafter{\the\toks2 \or#3}% -%% \toks3\expandafter{\the\toks3 \or#4}% -%% \expandafter\ajQuotedef\fi} -%% \ajQuotedef -%% 670 671 12173 12174 -%% 672 673 7956 7957 -%% 674 675 7899 7900 -%% 676 677 7901 7902 -%% 678 679 7903 7904 -%% 680 681 7905 7906 -%% 682 683 7907 7908 -%% 684 685 7909 7910 -%% 686 687 7911 7912 -%% 688 689 7913 7914 -%% 690 691 7915 7916 -%% 7608 7609 7956 7957 -%% 12125 12126 12135 12136 -%% 12127 12128 12137 12138 -%% 12129 12130 12139 12140 -%% 12131 12132 12141 12142 -%% 12171 12172 12173 12174 -%% 16197 16198 16329 16330 -%% * * * * -%% \xdef\ajQuote#1#2{\noexpand\CID{\noexpand\ifydir\noexpand\ifcase#1\the\toks0 -%% \noexpand\fi\noexpand\else\noexpand\ifcase#1\the\toks2 -%% \noexpand\fi\noexpand\fi}#2\inhibitglue\noexpand\CID{\noexpand\ifydir\noexpand\ifcase#1\the\toks1 -%% \noexpand\fi\noexpand\else\noexpand\ifcase#1\the\toks3 -%% \noexpand\fi\noexpand\fi}} +\endlinechar=13 +\toks0{}\toks1{}\toks2{}\toks3{} +\def\ajQuotedef#1 #2 #3 #4 {\ifx*#1\else + \toks0\expandafter{\the\toks0 \or#1}% + \toks1\expandafter{\the\toks1 \or#2}% + \toks2\expandafter{\the\toks2 \or#3}% + \toks3\expandafter{\the\toks3 \or#4}% + \expandafter\ajQuotedef\fi} +\ajQuotedef +670 671 12173 12174 +672 673 7956 7957 +674 675 7899 7900 +676 677 7901 7902 +678 679 7903 7904 +680 681 7905 7906 +682 683 7907 7908 +684 685 7909 7910 +686 687 7911 7912 +688 689 7913 7914 +690 691 7915 7916 +7608 7609 7956 7957 +12125 12126 12135 12136 +12127 12128 12137 12138 +12129 12130 12139 12140 +12131 12132 12141 12142 +12171 12172 12173 12174 +16197 16198 16329 16330 +* * * * +\def\@removetop#1{\toks#1\expandafter\expandafter\expandafter{\expandafter\@gobble\the\toks#1}} +\@removetop0\@removetop1\@removetop2\@removetop3 +\xdef\ajQuote#1#2{\noexpand\CID{\noexpand\unless\noexpand\ifnum\noexpand\ltjgetparameter\noexpand{direction\noexpand}=3 \noexpand\ifcase#1 \the\toks0 + \noexpand\fi\noexpand\else\noexpand\ifcase#1 \the\toks2 + \noexpand\fi\noexpand\fi}#2\inhibitglue\noexpand\CID{\noexpand\unless\noexpand\ifnum\noexpand\ltjgetparameter\noexpand{direction\noexpand}=3 \noexpand\ifcase#1 \the\toks1 + \noexpand\fi\noexpand\else\noexpand\ifcase#1 \the\toks3 + \noexpand\fi\noexpand\fi}} } \ifltj@in@latex\else \ajRedefine@KundokuMacros