名前: misc 日時: 2004-03-11 15:48:49 IPアドレス: 210.230.18.*
>>27048 (dotseqn パッケージの処理と,本質的には変わりありませんが)ご参考まで. \documentclass{jarticle} \makeatletter \newif\if@eqn@alttag \newbox\@eqnbox@i \newbox\@eqnbox@ii \newbox\@eqnbox@iii \newdimen\@eqn@labelsize \def\eqnarraywithleader{% \stepcounter{equation}% \def\@currentlabel{\p@equation\theequation}% \global\@eqnswtrue \global\@eqn@alttagfalse \m@th \global\@eqcnt\z@ \tabskip\@centering \let\\\@eqncr \let\tag\@eqnarray@tag \global\let\@eqn@currtag\@empty \global\setbox\@eqnbox@i \box\voidb@x \global\setbox\@eqnbox@ii \box\voidb@x \global\setbox\@eqnbox@iii \box\voidb@x \let\@@eqncr\@@eqncr@with@leader $$% \everycr{}% \halign to\displaywidth\bgroup \global\setbox\@eqnbox@i\hbox{$\displaystyle\tabskip\z@skip{##}$}% & \global\@eqcnt\@ne \global\setbox\@eqnbox@ii\hbox{$\displaystyle{{}##{}}$}% & \global\@eqcnt\tw@ \global\setbox\@eqnbox@iii\hbox{$\displaystyle{##}$}% & \global\@eqcnt\thr@@ \hskip\@centering##\@eqnsel & \hfil##\hfil & ##\hfil\tabskip\@centering & ##\tabskip\z@skip \cr &&&&&&\crcr\noalign{\vskip-\baselineskip}} \def\endeqnarraywithleader{% \@@eqncr \egroup \global\advance\c@equation\m@ne $$% \@ignoretrue} \def\@@eqncr@with@leader{% \let\reserved@a\relax \ifcase\@eqcnt \def\reserved@a{& & &}% \or \def\reserved@a{& &}% \or \def\reserved@a{&}% \else \let\reserved@a\@empty \@latex@error{Too many columns in eqnarraywithleader environment}\@ehc \fi \reserved@a \if@eqnsw \hphantom{% \if@eqn@alttag (\@eqn@currtag)% \else \@eqnnum \fi}% \fi \box\@eqnbox@i & \box\@eqnbox@ii & \box\@eqnbox@iii \span \if@eqnsw \leaders\hbox to.3333zw{\hss\raise.5ex\hbox{.}\hss}\hfill \if@eqn@alttag (\@eqn@currtag)% \else \@eqnnum \stepcounter{equation}% \fi \fi \global\@eqnswtrue \global\@eqn@alttagfalse \global\let\@eqn@currtag\@empty \global\@eqcnt\z@ \global\setbox\@eqnbox@i \box\voidb@x \global\setbox\@eqnbox@ii \box\voidb@x \global\setbox\@eqnbox@iii \box\voidb@x \cr} \def\@eqnarray@tag#1{% \global\@eqn@alttagtrue \gdef\@eqn@currtag{#1}} \makeatother \begin{document} sample \begin{eqnarraywithleader} a & = & b + 1 \tag{3 points}\\ & = & b - 1 \tag{5 points} \end{eqnarraywithleader} sample \begin{eqnarraywithleader} a & = & b + 1 \nonumber \\ & = & b - 1 \end{eqnarraywithleader} sample \end{document}
この書き込みへの返事: