Re: tabular環境内の環境作成

名前: .
日時: 2009-01-31 17:55:08
IPアドレス: 59.134.169.*

>>52643 \pagegoal,\pagetotal といった内部パラメータについて学習なさってください. とりあえず,次のようなところでしょうか. ただし,私はこの件からはこれで手を引きます. # (この多忙な時期に)これ以上(無償で)「機能追加」に応じていては # 本業に差し支えますので. \documentclass{jarticle} \makeatletter \newcounter{EntryNo} \newdimen\EntryWidth \setlength{\EntryWidth}{45pt} \setlength{\fboxsep}{6pt} \newbox\EntryHeadBox \newbox\EntryContents \def\Entry{% \par \setbox\EntryContents\vbox\bgroup \stepcounter{EntryNo}% \let\@ItemA\@empty \let\@ItemC\@empty \let\@ItemD\@empty \let\@ItemE\@empty \let\@ItemB\@empty \let\@ItemBopt\@empty} \def\endEntry{% \@tempdima=2\fboxsep \advance\@tempdima\EntryWidth \@tempdimb\@tempdima \advance\@tempdima\fboxrule \hrule height\fboxrule \hbox{\vrule width\fboxrule \kern\fboxsep \dimen@=3\@tempdima \advance\dimen@\EntryWidth \vbox{\vskip\fboxsep \hbox to\dimen@{Entry \arabic{EntryNo}\hfill}% \vskip\fboxsep}% \kern\fboxsep \vrule width\fboxrule}% \hrule height\fboxrule \hbox{% \rlap{% \vbox{\vskip\fboxsep \hbox{% \kern\fboxrule \kern\fboxsep \hbox to\EntryWidth{Item A\hfill}% \kern2\fboxsep \kern\fboxrule \dimen@=2\@tempdima \advance\dimen@\EntryWidth \vtop{\hsize\dimen@ \@parboxrestore \@ItemA}}% \vskip\fboxsep}}% \vrule width\fboxrule \kern\@tempdimb \vrule width\fboxrule \kern2\@tempdima \kern\@tempdimb \vrule width\fboxrule}% \hrule height\fboxrule \hbox{% \rlap{% \vbox{\vskip\fboxsep \hbox{% \kern\fboxrule \kern\fboxsep \hbox to\EntryWidth{Item B\hfill}% \kern2\fboxsep \kern\fboxrule \dimen@\@tempdima \advance\dimen@\EntryWidth \vtop{\hsize\dimen@ \@parboxrestore \@ItemB}% \kern2\fboxsep \kern\fboxrule \hbox to\EntryWidth{\@ItemBopt\hfill}}% \vskip\fboxsep}}% \vrule width\fboxrule \kern\@tempdimb \vrule width\fboxrule \kern\@tempdima \kern\@tempdimb \vrule width\fboxrule \kern\@tempdimb \vrule width\fboxrule}% \hrule height\fboxrule \hbox{% \rlap{% \vbox{\vskip\fboxsep \hbox{% \kern\fboxrule \kern\fboxsep \hbox to\EntryWidth{Item C\hfill}% \kern2\fboxsep \kern\fboxrule \hbox to\EntryWidth{\@ItemC\hfill}% \kern2\fboxsep \kern\fboxrule \hbox to\EntryWidth{Item D\hfill}% \kern2\fboxsep \kern\fboxrule \hbox to\EntryWidth{\@ItemD\hfill}}% \vskip\fboxsep}}% \vrule width\fboxrule \kern\@tempdimb \vrule width\fboxrule \kern\@tempdimb \vrule width\fboxrule \kern\@tempdimb \vrule width\fboxrule \kern\@tempdimb \vrule width\fboxrule}% \hrule height\fboxrule \hbox{% \rlap{% \vbox{\vskip\fboxsep \hbox{% \kern\fboxrule \kern\fboxsep \hbox to\EntryWidth{Item E\hfill}% \kern2\fboxsep \kern\fboxrule \dimen@=2\@tempdima \advance\dimen@\EntryWidth \vtop{\hsize\dimen@ \@parboxrestore \@ItemE}}% \vskip\fboxsep}}% \vrule width\fboxrule \kern\@tempdimb \vrule width\fboxrule \kern2\@tempdima \kern\@tempdimb \vrule width\fboxrule}% \hrule height\fboxrule \egroup \ifnum\c@EntryNo<\tw@ \@makeEntryHead \noindent\box\EntryHeadBox \par\nointerlineskip\nobreak \noindent\box\EntryContents \par \else \dimen@\ht\EntryContents \advance\dimen@\pagetotal \ifdim\dimen@>\pagegoal \newpage \@makeEntryHead \noindent\box\EntryHeadBox \par\nointerlineskip\nobreak \noindent\box\EntryContents \par \else \nointerlineskip\vskip-\fboxrule \noindent\box\EntryContents \par \fi \fi} \def\ItemA{\@item@in@entry\@ItemA} \def\ItemC{\@item@in@entry\@ItemC} \def\ItemD{\@item@in@entry\@ItemD} \def\ItemE{\@item@in@entry\@ItemE} \long\def\@item@in@entry#1#2{\def#1{#2}} \def\ItemB{\@testopt\ItemB@{}} \long\def\ItemB@[#1]#2{\def\@ItemBopt{#1}\def\@ItemB{#2}} \def\EntryHead#1{\def\@EntryHead{#1}} \let\@EntryHead\@empty \def\@makeEntryHead{% \ifx\@EntryHead\@empty \setbox\EntryHeadBox\box\voidb@x \else \setbox\EntryHeadBox\vbox{% \hrule height\fboxrule \hbox{% \vrule width\fboxrule \kern\fboxsep \dimen@=4\EntryWidth \advance\dimen@6\fboxsep \advance\dimen@3\fboxrule \vbox{\vskip\fboxsep \hbox to\dimen@{\@EntryHead\hfill}% \vskip\fboxsep}% \kern\fboxsep \vrule width\fboxrule}}% \fi} \makeatother \begin{document} \EntryHead{% \stepcounter{enumi}% Sample Data \#\arabic{enumi}} \begin{center} \begin{Entry} \end{Entry} \begin{Entry} \ItemA{aaa} \ItemB{bbb} \ItemC{ccc} \ItemD{ddd} \ItemE{This is a meaningless sample.} \end{Entry} \begin{Entry} \ItemA{AAA} \ItemB[xxx]{BBB} \ItemC{CCC} \ItemD{DDD} \ItemE{This is a meaningless sample. This is a meaningless sample. This is a meaningless sample. This is a meaningless sample. This is a meaningless sample.} \end{Entry} \begin{Entry} \ItemA{AAA} \ItemB[xxx]{BBB} \ItemC{CCC} \ItemD{DDD} \ItemE{This is a meaningless sample. This is a meaningless sample. This is a meaningless sample. This is a meaningless sample. This is a meaningless sample.} \end{Entry} \begin{Entry} \ItemA{AAA} \ItemB[xxx]{BBB} \ItemC{CCC} \ItemD{DDD} \ItemE{This is a meaningless sample. This is a meaningless sample. This is a meaningless sample. This is a meaningless sample. This is a meaningless sample.} \end{Entry} \begin{Entry} \ItemA{AAA} \ItemB[xxx]{BBB} \ItemC{CCC} \ItemD{DDD} \ItemE{This is a meaningless sample. This is a meaningless sample. This is a meaningless sample. This is a meaningless sample. This is a meaningless sample.} \end{Entry} \end{center} \end{document}

この書き込みへの返事:

お名前
題名 
メッセージ(タグは <a href="...">...</a> だけ使えます。適宜改行を入れてください)