名前: . 日時: 2005-07-04 05:14:49 IPアドレス: 220.214.19.*
>>36740 ここでは,概ね ・個々の著者名,所属に識別番号を割り振り ・同じ識別番号の所属に対応するメールアドレスたちを集め ・ひとつの所属に複数のアドレスがあるか否かを検査し ・所属とアドレスが1対1対応であるか否かに応じて整形処理をデザイン # メールアドレスを @ の前後で分割するのは,単なるパターンマッチですが, # 文字 @ のカテゴリーコードには注意が必要 しています. # “\authorentry の引数と識別番号の関係”の登録,といった処理も # ありますが,これは“外部仕様”との関係によって生じた処理です. # “LaTeX のリスト”と“配列”の取り扱いに充分に慣れれば, # このような処理は自力で実現できるようになります. \documentclass{jarticle} \makeatletter \let\@jtitle\@empty \let\@jsubtitle\@empty \let\@etitle\@empty \let\@esubtitle\@empty \def\jtitle#1{\gdef\@jtitle{#1}} \def\jsubtitle#1{\gdef\@jsubtitle{#1}} \def\etitle#1{\gdef\@etitle{#1}} \def\esubtitle#1{\gdef\@esubtitle{#1}} \let\@jauthorlist\@empty \let\@eauthorlist\@empty \newcount\@affilcnt \global\@affilcnt\z@ \def\authorlist#1{% #1% \@check@addresses} % \authorentry[address]{jname}{ename}{label} % \@addresslist@label: label に対応する address のリスト \def\authorentry{\@testopt\@authorentry{}} \def\@authorentry[#1]#2#3#4{% \expandafter\ifx\csname @addresslist@#4\endcsname\relax \global\advance\@affilcnt\@ne \expandafter\xdef\csname @affilno@#4\endcsname{\the\@affilcnt}% \global\@namedef{@affillabel@\the\@affilcnt}{#4}% \global\expandafter\let\csname @addresslist@#4\endcsname\@empty \edef\@currid{\the\@affilcnt}% \else \edef\@currid{\@nameuse{@affilno@#4}}% \fi \def\@tempa{#1}% \ifx\@tempa\@empty \@cons\@jauthorlist{{#2}{\@currid}{*}}% \@cons\@eauthorlist{{#3}{\@currid}{*}}% \else \@cons\@jauthorlist{{#2}{\@currid}{}}% \@cons\@eauthorlist{{#3}{\@currid}{}}% \expandafter\@cons\csname @addresslist@#4\endcsname{% {#1}{\@currid}{}}% \fi} \def\@check@addresses{% \let\@@elt\@elt \@tempswafalse \@tempcnta\z@ \def\@elt##1##2##3{\advance\count@\@ne}% \@whilenum\@tempcnta<\@affilcnt\do{% \advance\@tempcnta\@ne \count@\z@ \@nameuse{@addresslist@\@nameuse{@affillabel@\the\@tempcnta}}% \ifnum\count@>\@ne \@tempswatrue \fi}% \if@tempswa% 所属が同じ(でメールアドレスが異なる)著者が複数いる場合 \def\@elt##1##2##3{% \if##3*\relax \@cons\@templist{{##1}{##2}{}}% \else \advance\count@\@ne \@cons\@templist{{##1}{##2}{\the\count@}}% \fi}% \let\@templist\@empty \count@\z@ \@jauthorlist \let\@jauthorlist\@templist \let\@templist\@empty \count@\z@ \@eauthorlist \let\@eauthorlist\@templist %%% ↓変更箇所を“changed”で示します(以下同様). %%% changed %%% \def\@elt##1##2##3{% %%% \advance\count@\@ne %%% \@cons\@templist{{##1}{}{\the\count@}}}% \def\@elt##1##2##3{% \@cons\@templist{{##1}{}{\the\@tempcnta}}}% %%% \@tempcnta\z@ \count@\z@ \@whilenum\@tempcnta<\@affilcnt\do{% \advance\@tempcnta\@ne \let\@templist\@empty \edef\@tempa{@addresslist@\@nameuse{@affillabel@\the\@tempcnta}}% \@nameuse\@tempa \expandafter\let\csname\@tempa\endcsname\@templist}% \fi \let\@elt\@@elt} \let\@affillist\@empty % \affiliate[label]{affiliation} \def\affiliate{\@testopt\@affiliate{}} \def\@affiliate[#1]#2{% \expandafter\ifx\csname @addresslist@#1\endcsname\relax \@latex@warning@no@line{No \string\authorentry\space for ``#1''}% \else \protected@edef\@tempa{#2}% \expandafter\protected@xdef\csname @affiltext@#1\endcsname{% \expandafter\@affiliate@cutoff\@tempa\hskip\@nil% 単に #2 でよい? }% \fi} \def\@affiliate@cutoff#1\hskip#2\@nil{#1} \def\maketitle{% \par \begingroup \if@twocolumn \ifnum \col@number=\@ne \@maketitle \else \twocolumn[\@maketitle]% \fi \else \newpage \global\@topnum\z@ \@maketitle \fi \thispagestyle{plain}% \@thanks \endgroup \setcounter{footnote}{0}% \global\let\maketitle\relax} \def\@maketitle{% \begingroup\centering \normalsize \ifx\@jtitle\@empty\else {\Large\bfseries \@jtitle\par}% \fi \ifx\@jsubtitle\@empty\else \vskip3mm {\bfseries \@jsubtitle\par}% \fi \ifx\@jauthorlist\@empty\else \vskip1.5mm \let\@elt\@put@author@elt \@jauthorlist \unskip\par \fi \ifnum\@affilcnt>\z@ \vskip1.5mm \@tempcnta\z@ \@whilenum\@tempcnta<\@affilcnt\do{% \advance\@tempcnta\@ne \@make@affilmark\@tempcnta\kern\z@ \@nameuse{@affiltext@\@nameuse{@affillabel@\the\@tempcnta}}% \hskip1zw}% \unskip\par \vskip1.5mm \let\@elt\@put@address@elt \@tempcnta\z@ \@whilenum\@tempcnta<\@affilcnt\do{% \advance\@tempcnta\@ne %%% ↓追加部分を“added”で示します(以下同様). \count@\z@%%% added \let\@tempa\@empty%%% ``mark'' or ``mark name@domain'', added \let\@tempb\@empty%%% ``name(s)'' or empty, added \let\@tempc\@empty%%% ``domain'' or empty, added \@nameuse{@addresslist@\@nameuse{@affillabel@\the\@tempcnta}}% \ifnum\count@>\@ne \@tempa\{\@tempb\}@\@tempc%%% added \else \@tempa\@tempb @\@tempc%%% added \fi%%% added \hskip1zw}% \unskip\par \fi % \ifx\@etitle\@empty\else % \vskip3mm % {\large\bfseries \@etitle\par}% % \fi % \ifx\@esubtitle\@empty\else % \vskip3mm % {\small\bfseries \@esubtitle\par}% % \fi % \ifx\@eauthorlist\@empty\else % \vskip1.5mm % \let\@elt\@put@author@elt % \@eauthorlist\par % \fi \par\endgroup} \def\@put@author@elt#1#2#3{% #1\kern\z@ \@make@affilmark{#2}% \if\relax#3\relax\else %%% \,\@make@emailmark{#3}%%% changed \,\@make@emailmark{#2}%%% changed \fi \hskip1zw\relax} \def\@make@affilmark#1{% \textsuperscript{% \ifcase#1\relax \or \textdagger \or \textdagger\textdagger \or \textdagger\textdagger\textdagger \or \textdagger\textdagger\textdagger\textdagger \or \textdagger\textdagger\textdagger\textdagger\textdagger \or \textdagger\textdagger\textdagger \textdagger\textdagger\textdagger \or \textdagger\textdagger\textdagger\textdagger \textdagger\textdagger\textdagger \or \textdagger\textdagger\textdagger\textdagger \textdagger\textdagger\textdagger\textdagger \or \textdagger\textdagger\textdagger\textdagger\textdagger \textdagger\textdagger\textdagger\textdagger \or \textasteriskcentered \or \textasteriskcentered\textasteriskcentered \or \textasteriskcentered\textasteriskcentered\textasteriskcentered \or \textasteriskcentered\textasteriskcentered \textasteriskcentered\textasteriskcentered \or \textasteriskcentered\textasteriskcentered\textasteriskcentered \textasteriskcentered\textasteriskcentered \or \textasteriskcentered\textasteriskcentered\textasteriskcentered \textasteriskcentered\textasteriskcentered\textasteriskcentered \or \textasteriskcentered\textasteriskcentered\textasteriskcentered \textasteriskcentered\textasteriskcentered\textasteriskcentered \textasteriskcentered \or \textasteriskcentered\textasteriskcentered\textasteriskcentered \textasteriskcentered\textasteriskcentered\textasteriskcentered \textasteriskcentered\textasteriskcentered \or \textasteriskcentered\textasteriskcentered\textasteriskcentered \textasteriskcentered\textasteriskcentered\textasteriskcentered \textasteriskcentered\textasteriskcentered\textasteriskcentered \fi}} \def\@make@emailmark#1{% \if\relax#1\relax\else \textsuperscript{\@alph{#1})}\fi} %%% changed %%%\def\@put@address@elt#1#2#3{% %%% \if\relax#2\relax \@make@emailmark{#3}% %%% \else \@make@affilmark{#2}% %%% \fi %%% #1\hskip1zw} \def\@put@address@elt#1#2#3{% \advance\count@\@ne \if\relax#2\relax \def\@tempa{\@make@emailmark{#3}}% \@put@address@elt@{#1}% \edef\@tempb{% \@tempb \ifx\@tempb\@empty\else,\fi \@tempx}% \else \def\@tempa{\@make@affilmark{#2}}% \@put@address@elt@{#1}% \let\@tempb\@tempx \fi} \edef\@put@address@elt@#1{% \noexpand\@put@address@elt@@#1\string @\string @\relax} \begingroup \makeatother \def\:{\expandafter\def \csname @put@address@elt@@\endcsname##1@##2@##3\relax}% \expandafter\endgroup\:{% \def\@tempx{#1}% \def\@tempc{#2}} \makeatother \jtitle{テンプレート (タイトル)} \jsubtitle{− (サブタイトル)−} \etitle{pLaTeX Template (Title)} \esubtitle{−(Subtitle)−} \authorlist{% \authorentry[TARO@abc.co.jp]{日本 太郎}{Taro nihon}{Tokyo}% \authorentry[jiro@def.co.jp]{日本 次郎}{jiro nihon}{Osaka}% \authorentry[ichiro@hij.co.jp]{日本 一郎}{ichiro nihon}{test}% \authorentry[hanako@hij.co.jp]{日本 花子}{hanako nihon}{test}% } \affiliate[Tokyo]{工学部\hskip1zw 〒999--9999 東京都世田谷区x--x--x} \affiliate[Osaka]{開発部\hskip1zw 〒888--8888 大阪府吹田市x--x--x} \affiliate[test]{営業部\hskip1zw 〒777--7777 xxx県xx市x--xx--xx} \begin{document} \maketitle% \maketitle を用いてタイトル部分を出力するものと仮定しました. \end{document}
この書き込みへの返事: