% tnamisen.sty by Shinsaku Fujita
% Copyright (C) S. Fujita (1998). All rights reserved. 
% 無保証
\typeout{tnamisen.sty(v1.00) by S. Fujita 1998/08/26}
\typeout{藤田眞作著「続LaTeX2e階梯(縦組み編)」参照}
% 
% From warichu.sty by Shinsaku Fujita 
% Copyright (C) S. Fujita (1995). All rights reserved. 
% Version 1.00 1995/09/09
% ****************************************************
% * For separating an augument list to each argument *
% ****************************************************
% delimiter == as A==B== ... ==Z
%
\long\def\@fordbleq#1:=#2\do#3{%
  %\edef\@fortmp{#2}%LaTeX2.09での定義
  \expandafter\def\expandafter\@fortmp\expandafter{#2}%
                   %LaTeX2eでの定義
    \ifx\@fortmp\@empty \else%
    \expandafter\@dbleql@@p#2==\@nil==\@nil\@@#1{#3}\fi}
\long\def\@dbleql@@p#1==#2==#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else%
       #5\def#4{#2}\ifx #4\@nnil \else#5\@idbleql@@p #3\@@#4{#5}\fi\fi}
\long\def\@idbleql@@p#1==#2\@@#3#4{\def#3{#1}\ifx #3\@nnil%
%       \let\@nextwhile=\@fornoop \else%
       \expandafter\@fornoop \else%
%      #4\relax\let\@nextwhile=\@idbleql@@p\fi\@nextwhile#2\@@#3{#4}}
      #4\relax\expandafter\@idbleql@@p\fi#2\@@#3{#4}}
%
% 波線命令 1998/08/26 by Shinsaku Fujita
%
% \miginamisen{前部==中部== ... ==後部} 
%
\def\namisen{\raise.3zw\hbox{$\widetilde{\null\kern0.41zw}$}}
\def\miginamisen#1{%
\@tempcnta=\z@\relax
\@fordbleq\member:=#1\do{\global\advance\@tempcnta\@ne}%
\ifnum\@tempcnta=1\relax
\setbox\z@=\hbox{#1}\leavevmode
\hbox to\z@{\hskip.15zw\hbox to\wd\z@{%
\leaders\hbox to 0.41zw{\hfil\namisen\hfil}\hfill}\hss}%
\box\z@
\else
 \@tempcntb=0
 \@fordbleq\member:=#1\do{%
 \advance\@tempcntb\@ne
 \ifnum\@tempcntb=1\relax
   \setbox\z@=\hbox{\member}\leavevmode
   \hbox to\z@{\hskip.15zw\hbox to\wd\z@{%
   \leaders\hbox to 0.41zw{\hfil\namisen\hfil}\hfill}\hss}%
   \box\z@\break
  \else
   \ifnum\@tempcntb=\@tempcnta
    \setbox\z@=\hbox{\member}\leavevmode
    \hbox to\z@{\hskip.15zw\hbox to\wd\z@{%
    \leaders\hbox to 0.41zw{\hfil\namisen\hfil}\hfill}\hss}%
    \box\z@
   \else
    \setbox\z@=\hbox{\member}\leavevmode
    \hbox to\z@{\hskip.15zw\hbox to\wd\z@{%
    \leaders\hbox to 0.41zw{\hfil\namisen\hfil}\hfill}\hss}%
    \box\z@\break
   \fi\fi}%
 \fi}%
%
% 二重傍線命令 1998/08/26 by Shinsaku Fujita
%
% \def\miginijusen{前部==中部== ... ==後部} 
%
\def\nijusen{%
\raise.65zw\hbox to.25zw{\hss
\vrule\@width.25zw \@depth\z@ \@height.4\p@\hss}%
\kern-.25zw
\raise.8zw\hbox to.25zw{\hss
\vrule\@width.25zw \@depth\z@ \@height.4\p@\hss}}
%
\def\miginijusen#1{%
\@tempcnta=\z@\relax
\@fordbleq\member:=#1\do{\global\advance\@tempcnta\@ne}%
\ifnum\@tempcnta=1\relax
\setbox\z@=\hbox{#1}\leavevmode
\hbox to\z@{\kern.1zw\hbox to\wd0{%
\leaders\hbox{\hfil\nijusen\hfil}\hfill}\hss}%
\box\z@
\else
 \@tempcntb=0\relax
 \@fordbleq\member:=#1\do{%
 \advance\@tempcntb\@ne
 \ifnum\@tempcntb=1\relax
   \setbox\z@=\hbox{\member}\leavevmode
   \hbox to\z@{\kern.1zw\hbox to\wd0{%
   \leaders\hbox{\hfil\nijusen\hfil}\hfill}\hss}%
   \box\z@\break
  \else
   \ifnum\@tempcntb=\@tempcnta
   \setbox\z@=\hbox{\member}\leavevmode
   \hbox to\z@{\kern.1zw\hbox to\wd0{%
   \leaders\hbox{\hfil\nijusen\hfil}\hfill}\hss}%
   \box\z@
   \else
   \setbox\z@=\hbox{\member}\leavevmode
   \hbox to\z@{\kern.1zw\hbox to\wd0{%
   \leaders\hbox{\hfil\nijusen\hfil}\hfill}\hss}%
   \box\z@\break
   \fi\fi}%
 \fi}%
\endinput
