1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
% tone.sty -- TIPA option package
% 1996/06/10 FUKUI Rei
\RequirePackage{tipa}[1996/06/10 TIPA version 1.0]
\newif\if@longtone
\newdimen\@tonebarhtunit
\newdimen\@tonebarhalfwd
\newcommand\tone[1]{\@inittone\leavevmode
\hbox{\kern\@sidegap\@tone#1\relax\kern-\@tonebarhalfwd{\tipaencoding|}}}
\newcommand\rtone[1]{\@inittone\leavevmode
\hbox{{\tipaencoding|}\kern-\@tonebarhalfwd\@tone#1\relax\kern\@sidegap}}
\newcommand\@tone[1]{%
\ifx#1\relax
\ifx\pr@vpr@vtone\relax \@outputtone\pr@vtone\pr@vtone
\else \@outputtone\pr@vpr@vtone\pr@vtone\fi
\let\next\relax
\else
\ifx\pr@vpr@vtone\relax\else
\@longtonefalse\@outputtone\pr@vpr@vtone\pr@vtone\fi
\let\pr@vpr@vtone\pr@vtone\def\pr@vtone{#1}%
\let\next\@tone \fi
\next}
\newcommand\@outputtone[2]{{%
\count\z@ #1\advance\count\z@ -#2\def\@mintone{#2}%
\ifnum\count\z@>0\count\@ne128\advance\count\@ne \count\z@
\edef\@tonecode{\the\count\@ne}% falling tone
\else
\ifnum\count\z@<0\count\@ne132\advance\count\@ne -\count\z@
\edef\@tonecode{\the\count\@ne}\def\@mintone{#1}% rising tone
\else
\def\@tonecode{128}\fi\fi % level tone
\if@longtone\else\count\z@\@tonecode
\advance\count\z@ 9 \def\@tonecode{\the\count\z@}\fi
\@longtonefalse
\count\@ne\@mintone \advance\count\@ne \m@ne
\dimen\z@\the\count\@ne\@tonebarhtunit
\raise\dimen\z@\hbox{%
\@accshift{-\dimen\z@}%
{\tipaencoding\char\@tonecode}%
\@accshift{\dimen\z@}}}}
\newcommand\@toneshift[1]{\dimen\@ne#1}
\newcommand\@inittone{%
\@getaccshift \let\c@lcshift\@toneshift
\let\pr@vtone\relax\let\pr@vpr@vtone\relax
\@longtonetrue{\setbox\z@\hbox{\tipaencoding|}%
\global\@tonebarhtunit.25\ht\z@
\global\@tonebarhalfwd.5\wd\z@}}
\endinput
|