diff options
author | Karl Berry <karl@freefriends.org> | 2017-04-27 21:35:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-04-27 21:35:21 +0000 |
commit | 6165f44cf87ca75b6071efd3b3d171f9f7cf9f5f (patch) | |
tree | c4ac588e1ab0dd9ba8d00923fae646389c415ea0 /Master/texmf-dist/tex/platex | |
parent | 47a48398c30bb42ac7944d0f1481a436647d27b2 (diff) |
pxrubrica (27apr17)
git-svn-id: svn://tug.org/texlive/trunk@44082 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/platex')
-rw-r--r-- | Master/texmf-dist/tex/platex/pxrubrica/pxrubrica.sty | 892 |
1 files changed, 879 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/platex/pxrubrica/pxrubrica.sty b/Master/texmf-dist/tex/platex/pxrubrica/pxrubrica.sty index 7bc67f1b6a2..3efd8853ac3 100644 --- a/Master/texmf-dist/tex/platex/pxrubrica/pxrubrica.sty +++ b/Master/texmf-dist/tex/platex/pxrubrica/pxrubrica.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{pxrubrica} - [2017/04/20 v1.2 PX Japanese-style ruby] + [2017/04/27 v1.3 PX Japanese-style ruby] \RequirePackage{keyval} \def\pxrr@pkgname{pxrubrica} \def\pxrr@error{% @@ -159,6 +159,9 @@ \chardef\pxrr@evensp=1 \chardef\pxrr@revensp=1 \chardef\pxrr@fullsize=1 +\let\pxrr@c@ruby@font\@undefined +\let\pxrr@c@size@ratio\@undefined +\let\pxrr@c@inter@gap\@undefined \let\pxrr@body@list\@undefined \let\pxrr@body@count\@undefined \let\pxrr@ruby@list\@undefined @@ -609,6 +612,27 @@ \def#1{?}% } \fi\fi +\pxrr@jchardef\pxrr@zspace=\pxrr@jc{2121:3000} +\ifpxrr@in@uptex + \kchardef\pxrr@jghost@char="113000 +\else\ifpxrr@in@luatexja + \let\pxrr@jghost@char\pxrr@zspace + \def\pxrr@jghost@check{% + \begingroup + \setbox\z@\hbox{\char"3001\char"3000}% + \setbox\tw@\hbox{\char"3001\inhibitglue\char"3000}% + \ifdim\wd\tw@=\wd\z@ + \global\chardef\pxrr@jghost@char@="00A0 + \gdef\pxrr@jghost@char{\ltjjachar\pxrr@jghost@char@}% + \fi + \endgroup + } + \AtBeginDocument{% + \pxrr@jghost@check + } +\else + \let\pxrr@jghost@char\pxrr@zspace +\fi\fi \pxrr@jchardef\pxrr@x@K=\pxrr@jc{306C:4E00} \ifpxrr@in@ptex \def\pxrr@get@iiskip#1{% @@ -711,17 +735,61 @@ \fi\fi\fi\fi \ifpxrr@in@ptex \def\pxrr@get@prebreakpenalty#1#2{% - #1=\prebreakpenalty`#2\relax + #1=\prebreakpenalty#2\relax } \else\ifpxrr@in@luatexja \def\pxrr@get@prebreakpenalty#1#2{% - #1=\ltjgetparameter{prebreakpenalty}{`#2}\relax + #1=\ltjgetparameter{prebreakpenalty}{#2}\relax } \else \def\pxrr@get@prebreakpenalty#1#2{% #1=\z@ } \fi\fi +\ifpxrr@in@ptex + \def\pxrr@get@postbreakpenalty#1#2{% + #1=\postbreakpenalty#2\relax + } +\else\ifpxrr@in@luatexja + \def\pxrr@get@postbreakpenalty#1#2{% + #1=\ltjgetparameter{postbreakpenalty}{#2}\relax + } +\else + \def\pxrr@get@postbreakpenalty#1#2{% + #1=\z@ + } +\fi\fi +\ifpxrr@in@ptex + \def\pxrr@check@punct@char#1#2{% + \pxrr@okfalse + \ifcase#2\relax + \ifnum\xspcode#1=\thr@@\else + \pxrr@oktrue + \fi + \else + \ifnum\inhibitxspcode#1=\thr@@\else + \pxrr@oktrue + \fi + \fi + } +\else\ifpxrr@in@luatexja + \def\pxrr@check@punct@char#1#2{% + \ifnum\ltjgetparameter{jaxspmode}{#1}=\thr@@ + \pxrr@okfalse + \else + \pxrr@oktrue + \fi + } +\else + \def\pxrr@check@punct@char#1#2{% + \pxrr@okfalse + } +\fi\fi +\ifx\inhibitglue\@undefined + \let\pxrr@inhibitglue\relax +\else + \let\pxrr@inhibitglue\inhibitglue +\fi \newif\ifpxrr@in@setup \pxrr@in@setupfalse \newcommand*\rubysetup[1]{% \pxrr@in@setuptrue @@ -1131,6 +1199,9 @@ \if g\pxrr@mode\else \chardef\pxrr@evensp\@ne \fi + \ifpxrr@combo + \pxrr@ck@check@option + \fi } \let\pxrr@ruby@fsize\pxrr@zeropt \let\pxrr@body@zw\pxrr@zeropt @@ -1142,7 +1213,7 @@ \let\pxrr@iaiskip\pxrr@zeropt \def\pxrr@assign@fsize{% \@tempdima=\f@size\p@ - \@tempdima\pxrr@size@ratio\@tempdima + \@tempdima\pxrr@c@size@ratio\@tempdima \edef\pxrr@ruby@fsize{\the\@tempdima}% \pxrr@get@zwidth\pxrr@body@zw \begingroup @@ -1164,7 +1235,7 @@ \advance\@tempdimb-\pxrr@htratio\@tempdimb \advance\@tempdima\@tempdimb \@tempdimb\pxrr@body@zw\relax - \advance\@tempdima\pxrr@inter@gap\@tempdimb + \advance\@tempdima\pxrr@c@inter@gap\@tempdimb \edef\pxrr@ruby@raise{\the\@tempdima}% \@tempdima\pxrr@body@zw\relax \advance\@tempdima-\pxrr@htratio\@tempdima @@ -1172,14 +1243,17 @@ \@tempdimb\pxrr@htratio\@tempdimb \advance\@tempdima\@tempdimb \@tempdimb\pxrr@body@zw\relax - \advance\@tempdima\pxrr@inter@gap\@tempdimb + \advance\@tempdima\pxrr@c@inter@gap\@tempdimb \edef\pxrr@ruby@lower{\the\@tempdima}% + \ifpxrr@combo + \pxrr@ck@assign@fsize + \fi } \def\pxrr@use@ruby@font{% \pxrr@without@macro@trace{% \let\rubyfontsize\pxrr@ruby@fsize \fontsize{\pxrr@ruby@fsize}{\z@}\selectfont - \pxrr@ruby@font + \pxrr@c@ruby@font }% } \chardef\pxrr@locate@inner=1 @@ -1368,6 +1442,8 @@ } \def\pxrr@compose@oneside@block@do#1#2#3#4{% \setbox\pxrr@boxa\pxrr@hbox{#2}% + \edef\pxrr@ck@body@natwd{\the\wd\pxrr@boxa}% + \let\pxrr@ck@locate\pxrr@locate@inner \setbox\pxrr@boxr\pxrr@hbox{% \pxrr@use@ruby@font #3% @@ -1382,6 +1458,7 @@ \let\pxrr@locate@temp\pxrr@locate@head \fi \fi + \let\pxrr@ck@locate\pxrr@locate@temp \pxrr@decompose{#2}% \edef\pxrr@natwd{\the\wd\pxrr@boxa}% \pxrr@evenspace@int\pxrr@locate@temp\pxrr@boxa\relax @@ -1409,6 +1486,9 @@ \lower\pxrr@ruby@lower\box\pxrr@boxr \fi }% + \ifnum \ifpxrr@combo\pxrr@ck@ruby@combo\else\z@\fi >\z@ + \pxrr@ck@compose{#2}% + \fi \ht\z@\z@ \dp\z@\z@ \@tempdima\wd\z@ \setbox\pxrr@boxr\hbox{% @@ -1426,6 +1506,8 @@ } \def\pxrr@compose@twoside@block@do#1#2#3#4{% \setbox\pxrr@boxa\pxrr@hbox{#2}% + \edef\pxrr@ck@body@natwd{\the\wd\pxrr@boxa}% + \let\pxrr@ck@locate\pxrr@locate@inner \setbox\pxrr@boxr\pxrr@hbox{% \pxrr@use@ruby@font #3% @@ -1449,6 +1531,7 @@ \let\pxrr@locate@temp\pxrr@locate@head \fi \fi + \let\pxrr@ck@locate\pxrr@locate@temp \ifdim\wd\pxrr@boxr<\wd\pxrr@boxb \pxrr@compose@twoside@block@sub{#2}{#3}% \pxrr@boxr\pxrr@boxb @@ -1487,6 +1570,9 @@ \kern-\@tempdima \lower\pxrr@ruby@lower\box\pxrr@boxb }% + \ifnum \ifpxrr@combo\pxrr@ck@ruby@combo\else\z@\fi >\z@ + \pxrr@ck@compose{#2}% + \fi \ht\z@\z@ \dp\z@\z@ \@tempdima\wd\z@ \setbox\pxrr@boxr\hbox{% @@ -1643,7 +1729,7 @@ \pxrr@check@kinsoku@c#1#1% } \def\pxrr@check@kinsoku@c#1{% - \pxrr@get@prebreakpenalty\pxrr@cntr{#1}% + \pxrr@get@prebreakpenalty\pxrr@cntr{`#1}% \pxrr@tempb } \def\pxrr@tempa#1#2\pxrr@nil{% @@ -1834,8 +1920,21 @@ \else F% \fi\fi T% } +\def\pxrr@bind@param{% + \ifpxrr@apply@combo + \pxrr@apply@combofalse + \pxrr@combotrue + \pxrr@ck@bind@param + \else + \pxrr@combofalse + \fi + \let\pxrr@c@ruby@font\pxrr@ruby@font + \let\pxrr@c@size@ratio\pxrr@size@ratio + \let\pxrr@c@inter@gap\pxrr@inter@gap +} \def\pxrr@ruby@proc#1#2{% \pxrr@prepare@fallback{#1}% + \pxrr@bind@param \pxrr@assign@fsize \pxrr@parse@option\pxrr@option \pxrr@decompbar{#2}% @@ -1873,6 +1972,7 @@ } \def\pxrr@truby@proc#1#2#3{% \pxrr@prepare@fallback{#1}% + \pxrr@bind@param \pxrr@assign@fsize \pxrr@parse@option\pxrr@option \def\pxrr@all@input{{#1}{#2}{#3}}% @@ -2213,16 +2313,16 @@ } \let\pxrr@ruby@main@mg\@undefined \newif\ifpxrr@ghost -\pxrr@jchardef\pxrr@zspace=\pxrr@jc{2121:3000} \def\pxrr@jprologue{% \ifpxrr@jghost - \pxrr@zspace + \pxrr@jghost@char + \pxrr@inhibitglue \fi \begingroup \pxrr@abodyfalse \pxrr@csletcs{ifpxrr@ghost}{ifpxrr@jghost}% \ifpxrr@jghost - \setbox\pxrr@boxa\hbox{\pxrr@zspace}% + \setbox\pxrr@boxa\hbox{\pxrr@jghost@char}% \kern-\wd\pxrr@boxa \fi } @@ -2266,12 +2366,13 @@ } \def\pxrr@jepilogue{% \ifpxrr@jghost - \setbox\pxrr@boxa\hbox{\pxrr@zspace}% + \setbox\pxrr@boxa\hbox{\pxrr@jghost@char}% \kern-\wd\pxrr@boxa \fi \endgroup \ifpxrr@jghost - \pxrr@zspace + \pxrr@inhibitglue + \pxrr@jghost@char \fi } \def\pxrr@aepilogue{% @@ -2339,6 +2440,771 @@ \typeout{----\pxrr@pkgname\space resolve-mode: \meaning\pxrr@mode}% } +\def\pxrr@warn@na@kmark#1{% + \pxrr@warn{Unavailable kenten mark '#1'}% +} +\def\pxrr@err@invalid@value#1{% + \pxrr@error{Invalid value '#1'}% + {\@eha}% +} +\let\pxrr@k@ymark\@undefined +\let\pxrr@k@ysmark\@undefined +\let\pxrr@k@tmark\@undefined +\let\pxrr@k@tsmark\@undefined +\AtEndOfPackage{% + \pxrr@k@get@mark\pxrr@k@ymark{bullet*}% + \pxrr@k@get@mark\pxrr@k@ysmark{sesame*}% + \pxrr@k@get@mark\pxrr@k@tmark{sesame*}% + \pxrr@k@get@mark\pxrr@k@tsmark{bullet*}% +} +\let\pxrr@k@ruby@font\@empty +\def\pxrr@k@size@ratio{0.5} +\newif\ifpxrr@k@ghost \pxrr@k@ghosttrue +\def\pxrr@k@inter@gap{0} +\def\pxrr@k@ruby@inter@gap{0} +\chardef\pxrr@k@d@side=0 +\chardef\pxrr@k@d@mark=0 +\chardef\pxrr@k@ruby@combo=1 +\chardef\pxrr@k@d@full=0 +\chardef\pxrr@k@mark=0 +\chardef\pxrr@k@full=0 +\let\pxrr@k@the@mark\relax +\newif\ifpxrr@avail@UTF +\def\pxrr@decide@avail@UTF{% + \global\let\pxrr@decide@avail@UTF\relax + \ifx\UTF\@undefined \global\pxrr@avail@UTFfalse + \else \global\pxrr@avail@UTFtrue + \fi +} +\def\pxrr@k@decompose#1{% + \let\pxrr@res\@empty + \pxrr@cntr=\z@ + \pxrr@k@decompose@loopa#1\pxrr@end +} +\def\pxrr@k@decompose@loopa{% + \futurelet\pxrr@token\pxrr@k@decompose@loopb +} +\def\pxrr@k@decompose@loopb{% + \pxrr@cond\ifx\pxrr@token\pxrr@end\fi{% + \pxrr@appto\pxrr@res{\pxrr@post}% + }{\pxrr@if@kspan@cmd\pxrr@token{% + \pxrr@k@decompose@special\pxrr@k@decompose@kspan + }{\pxrr@if@ruby@cmd\pxrr@token{% + \pxrr@k@decompose@special\pxrr@k@decompose@ruby + }{\pxrr@if@truby@cmd\pxrr@token{% + \pxrr@k@decompose@special\pxrr@k@decompose@truby + }{\pxrr@if@kenten@cmd\pxrr@token{% + \pxrr@k@decompose@special\pxrr@k@decompose@kenten + }{\pxrr@cond\ifx\pxrr@token\@sptoken\fi{% + \pxrr@k@decompose@loope + }{% + \pxrr@setok{\pxrr@ifx{\pxrr@token\bgroup}}% + \pxrr@k@decompose@loopc + }}}}}}% +} +\def\pxrr@k@decompose@loopc#1{% + \pxrr@appto\pxrr@res{\pxrr@entry}% + \ifpxrr@ok + \pxrr@appto\pxrr@res{{{#1}}}% + \else + \pxrr@appto\pxrr@res{{#1}}% + \fi + \pxrr@k@decompose@loopd +} +\def\pxrr@k@decompose@loopd{% + \advance\pxrr@cntr\@ne + \pxrr@k@decompose@loopa +} +\expandafter\def\expandafter\pxrr@k@decompose@loope\space{% + \pxrr@okfalse + \pxrr@k@decompose@loopc{ }% +} +\def\pxrr@k@decompose@special#1#2#{% + #1{#2}% +} +\def\pxrr@k@decompose@kspan#1#2{% + \pxrr@appto\pxrr@res{\pxrr@entry@kspan{#1{#2}}}% + \pxrr@k@decompose@loopd +} +\def\pxrr@k@decompose@ruby#1#2#3{% + \pxrr@appto\pxrr@res{\pxrr@entry@ruby{#1{#2}{#3}}}% + \pxrr@k@decompose@loopd +} +\def\pxrr@k@decompose@truby#1#2#3#4{% + \pxrr@appto\pxrr@res{\pxrr@entry@ruby{#1{#2}{#3}{#4}}}% + \pxrr@k@decompose@loopd +} +\def\pxrr@k@decompose@kenten#1#2{% + \pxrr@appto\pxrr@res{\pxrr@entry@kenten{#1{#2}}}% + \pxrr@k@decompose@loopd +} +\def\pxrr@cmd@ruby{\jruby} +\def\pxrr@cmd@kenten{\jkenten} +\def\pxrr@if@ruby@cmd#1{% + \if \ifcat\noexpand#1\relax + \ifx#1\pxrr@cmd@ruby T% + \else\ifx#1\jruby T% + \else\ifx#1\aruby T% + \else F% + \fi\fi\fi + \else F% + \fi T\expandafter\@firstoftwo + \else \expandafter\@secondoftwo + \fi +} +\def\pxrr@if@truby@cmd#1{% + \if \ifcat\noexpand#1\relax + \ifx#1\truby T% + \else\ifx#1\atruby T% + \else F% + \fi\fi + \else F% + \fi T\expandafter\@firstoftwo + \else \expandafter\@secondoftwo + \fi +} +\def\pxrr@if@kspan@cmd#1{% + \pxrr@cond\ifx#1\kspan\fi +} +\def\pxrr@if@kenten@cmd#1{% + \if \ifcat\noexpand#1\relax + \ifx#1\pxrr@cmd@kenten T% + \else\ifx#1\jkenten T% + \else F% + \fi\fi + \else F% + \fi T\expandafter\@firstoftwo + \else \expandafter\@secondoftwo + \fi +} +\newcommand*\kentensetup[1]{% + \pxrr@in@setuptrue + \pxrr@fatal@errorfalse + \pxrr@k@parse@option{#1}% + \ifpxrr@fatal@error\else + \let\pxrr@k@d@side\pxrr@side + \let\pxrr@k@d@mark\pxrr@k@mark + \let\pxrr@k@d@full\pxrr@k@full + \fi + \pxrr@in@setupfalse +} +\newcommand*\kentenfontsetup{} +\def\kentenfontsetup#{% + \def\pxrr@k@ruby@font +} +\newcommand*\kentensizeratio[1]{% + \edef\pxrr@k@size@ratio{#1}% +} +\newcommand*\kentenintergap[1]{% + \edef\pxrr@k@inter@gap{#1}% +} +\newcommand*\kentenrubyintergap[1]{% + \edef\pxrr@k@ruby@inter@gap{#1}% +} +\newcommand*\kentenmarkinyoko[1]{% + \pxrr@k@get@mark\pxrr@k@ymark{#1}% +} +\newcommand*\kentensubmarkinyoko[1]{% + \pxrr@k@get@mark\pxrr@k@ysmark{#1}% +} +\newcommand*\kentenmarkintate[1]{% + \pxrr@k@get@mark\pxrr@k@tmark{#1}% +} +\newcommand*\kentensubmarkintate[1]{% + \pxrr@k@get@mark\pxrr@k@tsmark{#1}% +} +\chardef\pxrr@k@ruby@combo@ruby=0 +\chardef\pxrr@k@ruby@combo@both=1 +\newcommand*\kentenrubycombination[1]{% + \pxrr@letcs\pxrr@tempa{pxrr@k@ruby@combo@#1}% + \ifx\pxrr@tempa\relax + \pxrr@err@invalid@value{#1}% + \else + \let\pxrr@k@ruby@combo\pxrr@tempa + \fi +} +\def\pxrr@k@declare@mark#1{% + \global\@namedef{pxrr@k@mark@@#1}% +} +\def\pxrr@k@let@mark#1{% + \global\pxrr@cslet{pxrr@k@mark@@#1}% +} +\def\pxrr@k@get@mark#1#2{% + \futurelet\pxrr@token\pxrr@k@get@mark@a#2\pxrr@nil#1% +} +\def\pxrr@k@get@mark@a{% + \pxrr@cond\ifcat A\noexpand\pxrr@token\fi{% + \pxrr@k@get@mark@c + }{%else + \pxrr@k@get@mark@b + }% +} +\def\pxrr@k@get@mark@b#1\pxrr@nil#2{% + \def#2{#1}% +} +\def\pxrr@k@get@mark@c#1#2\pxrr@nil#3{% + \ifnum`#1<128 + \pxrr@letcs\pxrr@tempa{pxrr@k@mark@@#1#2}% + \ifx\pxrr@tempa\relax + \pxrr@warn@na@kmark{#1#2}% + \else + \let#3\pxrr@tempa + \fi + \else + \pxrr@k@get@mark@b#1#2\pxrr@nil#3% + \fi +} +\def\pxrr@k@declare@mark@char#1#2{% + \pxrr@k@declare@mark@char@a{#1}#2\pxrr@end +} +\def\pxrr@k@declare@mark@char@a#1#2:#3\pxrr@end{% + \pxrr@jchardef\pxrr@tempa\pxrr@jc{#2:#3}% + \ifnum\pxrr@tempa=\pxrr@zspace + \pxrr@k@declare@mark{#1}{\pxrr@k@char@UTF{#1}{#3}}% + \else + \pxrr@k@let@mark{#1}\pxrr@tempa + \fi +} +\def\pxrr@k@char@UTF#1#2{% + \pxrr@decide@avail@UTF + \ifpxrr@avail@UTF + \pxrr@k@declare@mark{#1}{\UTF{#2}}% + \UTF{#2}% + \else + \pxrr@k@let@mark{#1}\@empty + \pxrr@warn@na@kmark{#1}% + \fi +} +\pxrr@k@declare@mark@char{bullet} {2121:2022} +\pxrr@k@declare@mark@char{triangle}{2225:25B2} +\pxrr@k@declare@mark@char{Triangle}{2224:25B3} +\pxrr@k@declare@mark@char{fisheye} {2121:25C9} +\pxrr@k@declare@mark@char{Circle} {217B:25CB} +\pxrr@k@declare@mark@char{bullseye}{217D:25CE} +\pxrr@k@declare@mark@char{circle} {217C:25CF} +\pxrr@k@declare@mark@char{Bullet} {2121:25E6} +\pxrr@k@declare@mark@char{sesame} {2121:FE45} +\pxrr@k@declare@mark@char{Sesame} {2121:FE46} +\pxrr@jchardef\pxrr@ja@dot=\pxrr@jc{2126:30FB} +\pxrr@jchardef\pxrr@ja@comma=\pxrr@jc{2122:3001} +\pxrr@k@declare@mark{bullet*}{% + \pxrr@dima=\pxrr@ruby@zw\relax + \hb@xt@\pxrr@dima{% + \kern-.5\pxrr@dima + \pxrr@if@in@tate{}{\lower.38\pxrr@dima}% + \hbox{% + \pxrr@dima=\f@size\p@ + \fontsize{2\pxrr@dima}{\z@}\selectfont + \pxrr@ja@dot + }% + \hss + }% +} +\pxrr@k@declare@mark{sesame*}{% + \pxrr@dima=\pxrr@ruby@zw\relax + \hb@xt@\pxrr@dima{% + \pxrr@if@in@tate{\kern.1\pxrr@dima}{\kern.05\pxrr@dima}% + \pxrr@if@in@tate{\lower.85\pxrr@dima}{\raise.3\pxrr@dima}% + \hbox{% + \pxrr@dima=\f@size\p@ + \fontsize{2.4\pxrr@dima}{\z@}\selectfont + \pxrr@ja@comma + }% + \hss + }% +} +\def\pxrr@k@parse@option#1{% + \edef\pxrr@tempa{#1}% + \let\pxrr@side\pxrr@k@d@side + \let\pxrr@k@mark\pxrr@k@d@mark + \let\pxrr@k@full\pxrr@k@d@full + \expandafter\pxrr@k@parse@option@loop\pxrr@tempa @\pxrr@end +} +\def\pxrr@k@parse@option@loop#1{% + \pxrr@letcs\pxrr@tempa{pxrr@k@po@PR@#1}% + \pxrr@cond\ifx\pxrr@tempa\relax\fi{% + \pxrr@fatal@knx@letter{#1}% + \pxrr@k@parse@option@exit + }{% + \pxrr@tempa + \pxrr@k@parse@option@loop + }% +} +\def\pxrr@k@parse@option@exit#1\pxrr@end{% + \ifpxrr@in@setup\else + \pxrr@k@check@option + \pxrr@if@in@tate{% + \ifcase\pxrr@k@mark \let\pxrr@k@the@mark\pxrr@k@tmark + \or \let\pxrr@k@the@mark\pxrr@k@tsmark + \fi + }{% + \ifcase\pxrr@k@mark \let\pxrr@k@the@mark\pxrr@k@ymark + \or \let\pxrr@k@the@mark\pxrr@k@ysmark + \fi + }% + \fi +} +\def\pxrr@k@po@PR@@{% + \pxrr@k@parse@option@exit +} +\def\pxrr@k@po@PR@P{% + \chardef\pxrr@side\z@ +} +\def\pxrr@k@po@PR@S{% + \chardef\pxrr@side\@ne +} +\def\pxrr@k@po@PR@p{% + \chardef\pxrr@k@mark\z@ +} +\def\pxrr@k@po@PR@s{% + \chardef\pxrr@k@mark\@ne +} +\def\pxrr@k@po@PR@F{% + \chardef\pxrr@k@full\z@ +} +\def\pxrr@k@po@PR@f{% + \chardef\pxrr@k@full\@ne +} +\def\pxrr@k@check@option{% +} +\def\pxrr@k@compose@block#1#2{% + \setbox\pxrr@boxa\pxrr@hbox{#1}% + \pxrr@k@make@rep@list{\copy\pxrr@boxb}{#2}% + \let\pxrr@natwd\pxrr@zeropt + \pxrr@evenspace@int\pxrr@locate@inner\pxrr@boxr + \relax{\wd\pxrr@boxa}% + \setbox\z@\hbox{% + \ifnum\pxrr@side=\z@ + \raise\pxrr@ruby@raise\box\pxrr@boxr + \else + \lower\pxrr@ruby@lower\box\pxrr@boxr + \fi + }% + \ht\z@\z@ \dp\z@\z@ + \@tempdima\wd\z@ + \setbox\pxrr@boxr\hbox{% + \box\z@ + \kern-\@tempdima + \box\pxrr@boxa + }% +} +\def\pxrr@k@make@rep@list#1#2{% + \def\pxrr@res{\pxrr@pre{#1}}% + \pxrr@cntr=#2\relax + \ifnum\pxrr@cntr>\@ne + \@tempcnta\pxrr@cntr \advance\@tempcnta\m@ne + \@whilenum{\@tempcnta>\z@}\do{% + \pxrr@appto\pxrr@res{\pxrr@inter{#1}}% + \advance\@tempcnta\m@ne + }% + \fi + \pxrr@appto\pxrr@res{\pxrr@post}% +} +\newif\ifpxrr@k@first@entry +\newif\ifpxrr@k@last@entry +\newif\ifpxrr@k@prev@is@block +\let\pxrr@k@accum@res\relax +\mathchardef\pxrr@k@prebreakpenalty\z@ +\mathchardef\pxrr@k@postbreakpenalty\z@ +\chardef\pxrr@k@entry@res@type\z@ +\def\pxrr@k@list@pre{% + \pxrr@k@first@entrytrue + \pxrr@k@last@entryfalse + \pxrr@k@prev@is@blockfalse + \let\pxrr@k@accum@res\@empty + \chardef\pxrr@k@block@seq@state\z@ +} +\def\pxrr@k@entry@with#1#2{% + \pxrr@if@last{% + \pxrr@k@last@entrytrue + \pxrr@k@entry@with@a#1{#2}% + }{% + \pxrr@k@entry@with@a#1{#2}% + }% +} +\def\pxrr@k@entry@with@a#1#2{% + \mathchardef\pxrr@k@prebreakpenalty\z@ + \mathchardef\pxrr@k@postbreakpenalty\z@ + #1{#2}% + \ifnum\pxrr@k@entry@res@type=\z@ + \expandafter\pxrr@appto\expandafter\pxrr@k@accum@res + \expandafter{\pxrr@res}% + \else + \pxrr@k@accum@res + \let\pxrr@k@accum@res\@empty + \fi + \ifnum\pxrr@k@prebreakpenalty>\z@ + \@tempcntb\lastpenalty \unpenalty + \advance\@tempcntb\pxrr@k@prebreakpenalty + \penalty\@tempcntb + \fi + \ifnum\pxrr@k@entry@res@type=\tw@ + \ifpxrr@k@prev@is@block + \pxrr@inter@mono + \fi + \pxrr@k@prev@is@blocktrue + \else + \pxrr@k@prev@is@blockfalse + \fi + \ifnum\pxrr@k@entry@res@type>\z@ + \unhbox\pxrr@boxr + \fi + \ifnum\pxrr@k@postbreakpenalty>\z@ + \penalty\pxrr@k@postbreakpenalty + \fi + \pxrr@k@first@entryfalse +} +\def\pxrr@k@list@post{% + \pxrr@k@accum@res + \let\pxrr@k@accum@res\@empty +} +\def\pxrr@kenten@entry{% + \pxrr@k@entry@with\pxrr@kenten@entry@ +} +\def\pxrr@kenten@entry@#1{% + \pxrr@k@check@char{#1}% + \ifpxrr@ok + \pxrr@k@compose@block{#1}\@ne + \chardef\pxrr@k@entry@res@type=\tw@ + \else + \def\pxrr@res{#1}% + \chardef\pxrr@k@entry@res@type=\z@ + \fi +} +\def\pxrr@kenten@entry@kspan{% + \pxrr@k@entry@with\pxrr@kenten@entry@kspan@ +} +\def\pxrr@kenten@entry@kspan@#1{% + \pxrr@kenten@entry@kspan@a#1% +} +\def\pxrr@kenten@entry@kspan@a#1{% + \@ifstar{% + \@testopt\pxrr@kenten@entry@kspan@c{}% + }{% + \@testopt\pxrr@kenten@entry@kspan@b{}% + }% +} +\def\pxrr@kenten@entry@kspan@b[#1]#2{% + \setbox\z@\pxrr@hbox{#2}% + \@tempdima\pxrr@body@zw\relax + \@tempdimb\wd\z@ \advance\@tempdimb.25\@tempdima + \divide\@tempdimb\@tempdima + \edef\pxrr@kenten@entry@tempa{\number\@tempdimb}% + \pxrr@k@compose@block{#2}\pxrr@kenten@entry@tempa + \chardef\pxrr@k@entry@res@type=\tw@ +} +\def\pxrr@kenten@entry@kspan@c[#1]#2{% + \def\pxrr@res{#2}% + \chardef\pxrr@k@entry@res@type=\z@ +} +\def\pxrr@kenten@entry@kenten{% + \pxrr@k@entry@with\pxrr@kenten@entry@kenten@ +} +\def\pxrr@kenten@entry@kenten@#1{% + \setbox\pxrr@boxr\hbox{#1}% + \chardef\pxrr@k@entry@res@type=\@ne +} +\def\pxrr@kenten@entry@ruby{% + \pxrr@k@entry@with\pxrr@kenten@entry@ruby@ +} +\def\pxrr@kenten@entry@ruby@#1{% + \pxrr@apply@combotrue + \setbox\pxrr@boxr\hbox{#1}% + \chardef\pxrr@k@entry@res@type=\@ne +} +\newcommand*\kspan{% + \@ifstar{% + \@testopt\pxrr@kspan@a{}% + }{% + \@testopt\pxrr@kspan@a{}% + }% +} +\pxrr@add@protect\kspan +\def\pxrr@kspan@a[#1]#2{% + \begingroup + #2% + \endgroup +} +\def\pxrr@k@check@char#1{% + \futurelet\pxrr@token\pxrr@k@check@char@a#1\pxrr@end +} +\def\pxrr@k@check@char@a#1\pxrr@end{% + \pxrr@cond\ifx\pxrr@token\bgroup\fi{% + \pxrr@oktrue + }{\pxrr@cond\ifx\pxrr@token\@sptoken\fi{% + \pxrr@okfalse + }{% + \pxrr@check@char\pxrr@token + \ifcase\pxrr@cntr + \pxrr@okfalse + \or + \pxrr@oktrue + \chardef\pxrr@check@char@temp\z@ + \or + \pxrr@oktrue + \chardef\pxrr@check@char@temp\@ne + \fi + \ifnum\pxrr@k@full=\z@\ifpxrr@ok + \pxrr@check@punct@char{`#1}\pxrr@check@char@temp + \ifpxrr@ok \pxrr@okfalse + \else \pxrr@oktrue + \fi + \fi\fi + \ifpxrr@ok + \pxrr@get@prebreakpenalty\@tempcnta{`#1}% + \mathchardef\pxrr@k@prebreakpenalty\@tempcnta + \pxrr@get@postbreakpenalty\@tempcnta{`#1}% + \mathchardef\pxrr@k@postbreakpenalty\@tempcnta + \fi + }}% +} +\AtBeginDocument{% + \providecommand*{\kenten}{\jkenten}% +} +\newcommand*{\jkenten}{% + \pxrr@k@prologue + \pxrr@kenten +} +\pxrr@add@protect\jkenten +\def\pxrr@kenten{% + \@testopt\pxrr@kenten@a{}% +} +\def\pxrr@kenten@a[#1]{% + \def\pxrr@option{#1}% + \ifpxrr@safe@mode + \expandafter\@firstofone + \else + \expandafter\pxrr@kenten@proc + \fi +} +\def\pxrr@k@bind@param{% + \let\pxrr@c@ruby@font\pxrr@k@ruby@font + \let\pxrr@c@size@ratio\pxrr@k@size@ratio + \let\pxrr@c@inter@gap\pxrr@k@inter@gap +} +\def\pxrr@kenten@proc#1{% + \pxrr@prepare@fallback{#1}% + \pxrr@k@bind@param + \pxrr@assign@fsize + \pxrr@k@parse@option\pxrr@option + \pxrr@if@alive{% + \pxrr@k@decompose{#1}% + \let\pxrr@body@list\pxrr@res + \pxrr@kenten@main + }% + \pxrr@kenten@exit +} +\def\pxrr@kenten@main{% + \setbox\pxrr@boxb\pxrr@hbox@to\z@{% + \pxrr@use@ruby@font + \hss\pxrr@k@the@mark\hss + }% + \let\pxrr@entry\pxrr@kenten@entry + \let\pxrr@entry@kspan\pxrr@kenten@entry@kspan + \let\pxrr@entry@ruby\pxrr@kenten@entry@ruby + \let\pxrr@entry@kenten\pxrr@kenten@entry@kenten + \let\pxrr@post\pxrr@k@list@post + \pxrr@k@list@pre + \pxrr@body@list +} +\def\pxrr@k@prologue{% + \ifpxrr@k@ghost + \pxrr@jghost@char + \pxrr@inhibitglue + \fi + \begingroup + \ifpxrr@k@ghost + \setbox\pxrr@boxa\hbox{\pxrr@jghost@char}% + \kern-\wd\pxrr@boxa + \fi +} +\def\pxrr@kenten@exit{% + \ifpxrr@fatal@error + \pxrr@fallback + \fi + \pxrr@k@epilogue +} +\def\pxrr@k@epilogue{% + \ifpxrr@k@ghost + \setbox\pxrr@boxa\hbox{\pxrr@jghost@char}% + \kern-\wd\pxrr@boxa + \fi + \endgroup + \ifpxrr@k@ghost + \pxrr@inhibitglue + \pxrr@jghost@char + \fi +} +\def\pxrr@debug@show@kenten@input{% + \typeout{% +pxrr@k@the@mark=\meaning\pxrr@k@the@mark^^J% +pxrr@side=\meaning\pxrr@side^^J% +pxrr@body@list=\meaning\pxrr@body@list^^J% + }% +} +\newif\ifpxrr@apply@combo +\newif\ifpxrr@combo +\let\pxrr@ck@ruby@font\relax +\let\pxrr@ck@size@ratio\relax +\let\pxrr@ck@inter@gap\relax +\let\pxrr@ck@ruby@inter@gap\relax +\let\pxrr@ck@side\relax +\let\pxrr@ck@the@mark\relax +\let\pxrr@ck@ruby@combo\relax +\newif\ifpxrr@ck@kenten@head +\newif\ifpxrr@ck@kenten@end +\def\pxrr@ck@bind@param{% + \let\pxrr@ck@ruby@font\pxrr@c@ruby@font + \let\pxrr@ck@size@ratio\pxrr@c@size@ratio + \let\pxrr@ck@inter@gap\pxrr@c@inter@gap + \let\pxrr@ck@ruby@inter@gap\pxrr@k@ruby@inter@gap + \let\pxrr@ck@side\pxrr@side + \let\pxrr@ck@the@mark\pxrr@k@the@mark + \let\pxrr@ck@ruby@combo\pxrr@k@ruby@combo + \pxrr@csletcs{ifpxrr@ck@kenten@head}{ifpxrr@k@first@entry}% + \pxrr@csletcs{ifpxrr@ck@kenten@end}{ifpxrr@k@last@entry}% +} + +\let\pxrr@ck@zw\relax +\let\pxrr@ck@raise@P\relax +\let\pxrr@ck@raise@S\relax +\let\pxrr@ck@raise@t\relax +\def\pxrr@ck@check@option{% + \ifpxrr@ck@kenten@head + \let\pxrr@bintr@\@empty + \let\pxrr@bscomp=.\relax + \pxrr@bnobrtrue + \fi + \ifpxrr@ck@kenten@end + \let\pxrr@aintr@\@empty + \let\pxrr@ascomp=.\relax + \pxrr@anobrtrue + \fi +} +\def\pxrr@ck@assign@fsize{% + \begingroup + \@tempdima=\f@size\p@ + \@tempdima\pxrr@ck@size@ratio\@tempdima + \edef\pxrr@ruby@fsize{\the\@tempdima}% + \let\pxrr@c@ruby@font\pxrr@ck@ruby@font + \pxrr@use@ruby@font + \pxrr@get@zwidth\pxrr@ck@zw + \global\let\pxrr@gtempa\pxrr@ck@zw + \endgroup + \let\pxrr@ck@zw\pxrr@gtempa + \ifcase\pxrr@ck@side + \@tempdimc\pxrr@ck@zw + \advance\@tempdimc-\pxrr@htratio\@tempdimc + \@tempdima\pxrr@ruby@raise\relax + \@tempdimb\pxrr@ruby@zw\relax + \advance\@tempdima\pxrr@htratio\@tempdimb + \@tempdimb\pxrr@body@zw\relax + \advance\@tempdima\pxrr@ck@ruby@inter@gap\@tempdimb + \advance\@tempdima\@tempdimc + \edef\pxrr@ck@raise@P{\the\@tempdima}% + \@tempdima\pxrr@body@zw\relax + \@tempdima\pxrr@htratio\@tempdima + \@tempdimb\pxrr@body@zw\relax + \advance\@tempdima\pxrr@ck@inter@gap\@tempdimb + \advance\@tempdima\@tempdimc + \edef\pxrr@ck@raise@S{\the\@tempdima}% + \let\pxrr@ck@raise@t\pxrr@ck@raise@P + \or + \@tempdimc\pxrr@ck@zw + \@tempdimc\pxrr@htratio\@tempdimc + \@tempdima-\pxrr@ruby@lower\relax + \@tempdimb\pxrr@ruby@zw\relax + \advance\@tempdimb-\pxrr@htratio\@tempdimb + \advance\@tempdima-\@tempdimb + \@tempdimb\pxrr@body@zw\relax + \advance\@tempdima-\pxrr@ck@ruby@inter@gap\@tempdimb + \advance\@tempdima-\@tempdimc + \edef\pxrr@ck@raise@S{\the\@tempdima}% + \@tempdima-\pxrr@body@zw\relax + \advance\@tempdima-\pxrr@htratio\@tempdima + \@tempdimb\pxrr@body@zw\relax + \advance\@tempdima-\pxrr@ck@inter@gap\@tempdimb + \advance\@tempdima-\@tempdimc + \edef\pxrr@ck@raise@P{\the\@tempdima}% + \let\pxrr@ck@raise@t\pxrr@ck@raise@S + \fi +} +\let\pxrr@ck@body@natwd\relax +\let\pxrr@ck@locate\relax +\let\pxrr@ck@kenten@list\relax +\def\pxrr@ck@compose#1{% + \setbox\tw@\pxrr@hbox@to\z@{% + \@tempdima=\f@size\p@ + \@tempdima\pxrr@ck@size@ratio\@tempdima + \edef\pxrr@ruby@fsize{\the\@tempdima}% + \let\pxrr@c@ruby@font\pxrr@ck@ruby@font + \pxrr@use@ruby@font + \hss\pxrr@ck@the@mark\hss + }% + \pxrr@save@listproc + \pxrr@decompose{#1}% + \def\pxrr@pre{% + \let\pxrr@res\@empty + \pxrr@ck@compose@entry\pxrr@pre + }% + \def\pxrr@inter{% + \pxrr@ck@compose@entry\pxrr@inter + }% + \def\pxrr@post{% + \pxrr@appto\pxrr@res{\pxrr@post}% + }% + \pxrr@res + \pxrr@restore@listproc + \let\pxrr@natwd\pxrr@ck@body@natwd + \pxrr@evenspace@int\pxrr@ck@locate\pxrr@boxb\relax + {\wd\pxrr@boxa}% + \setbox\z@\hbox{% + \unhcopy\z@ + \kern-\wd\z@ + \ifcase\pxrr@side + \raise\pxrr@ck@raise@P + \or + \raise\pxrr@ck@raise@S + \or + \raise\pxrr@ck@raise@t + \fi + \hb@xt@\wd\pxrr@boxa{\hss\copy\pxrr@boxb\hss}% + }% +} +\def\pxrr@ck@compose@entry#1#2{% + \setbox\pxrr@boxb\pxrr@hbox{#2}% + \edef\pxrr@tempa{% + \noexpand\pxrr@appto\noexpand\pxrr@res{\noexpand#1{% + \hb@xt@\the\wd\pxrr@boxb{\hss\copy\tw@\hss}}}% + }\pxrr@tempa +} +\def\pxrr@dumb@sub#1#2#{#1} +\def\pxrr@dumb@ruby{% + \pxrr@dumb@sub\pxrr@dumb@ruby@ +} +\def\pxrr@dumb@ruby@#1#2{#1} +\def\pxrr@dumb@truby{% + \pxrr@dumb@sub\pxrr@dumb@truby@ +} +\def\pxrr@dumb@truby@#1#2#3{#1} +\def\pxrr@dumb@kenten{% + \pxrr@dumb@sub\pxrr@dumb@kenten@ +} +\def\pxrr@dumb@kenten@#1{#1} +\providecommand*\pdfstringdefPreHook{} +\g@addto@macro\pdfstringdefPreHook{% + \ifx\pxrr@cmd@ruby\ruby + \let\ruby\pxrr@dumb@ruby + \fi + \let\jruby\pxrr@dumb@ruby + \let\aruby\pxrr@dumb@ruby + \let\truby\pxrr@dumb@truby + \let\atruby\pxrr@dumb@truby + \ifx\pxrr@cmd@kenten\kenten + \let\kenten\pxrr@dumb@kenten + \fi + \let\kspan\pxrr@dumb@kenten +} \endinput %% %% End of file `pxrubrica.sty'. |