名前: しっぽ愛好家 日時: 2003-03-08 20:50:48 IPアドレス: 211.4.36.*
>>17405 >eclbkbox.styのbreakbox環境を使うと,実践で囲むことになりますが >それを点線で囲みたいのです。 eclbkbox パッケージを読み込んだ後に,次の記述を追加してみてください. そうすると,ページ分割可能な破線の枠で囲んだテキストを出力する breakdashbox 環境を使用できるようになります. %%% 一部の処理を eclbkbox.sty から流用しているので,eclbkbox.sty も %%% 読み込んでください. \makeatletter % %%% 枠に用いる破線の実線部分の長さ \newdimen\breakdashboxlinelength \breakdashboxlinelength=20pt % %%% 枠に用いる破線の空白部分の長さ \newdimen\breakdashboxlinegap \breakdashboxlinegap=10pt % %%% 枠線の太さは,eclbkbox.sty での処理に準じて \fboxrule で与えます. % \newdimen\bk@lastgap \newdimen\bk@processed@height \newdimen\bk@remaining@height \newbox\bk@sideline \let\breakdashbox\breakbox \def\endbreakdashbox{% \egroup \ifhmode \par \fi {\noindent\bk@lcnt\@ne \@bkconttrue \baselineskip\z@ \lineskiplimit\z@ \lineskip\z@ \vfuzz\maxdimen \vbadness\@M \bk@remaining@height\ht\bk@bxb \advance\bk@remaining@height\dp\bk@bxb \advance\bk@remaining@height\tw@\fboxsep \bk@processed@height\z@ \@tempdima\bk@remaining@height \advance\@tempdima-\breakdashboxlinelength \@tempdimb\breakdashboxlinelength \advance\@tempdimb\breakdashboxlinegap \dimen@\@tempdima \divide\@tempdima\@tempdimb \multiply\@tempdima\@tempdimb \advance\dimen@-\@tempdima \advance\dimen@\breakdashboxlinegap \divide\dimen@\tw@ \bk@lastgap\dimen@ \bk@split \bk@addfsepht \bk@addskipdp \ifvoid\bk@bxb % Only one line \def\bk@fstln{% \bk@addfsepdp \bk@make@sideline \vbox{% \bk@hdashline \bk@line@with@vdashlines \bk@hdashline}}% \else % More than one line \def\bk@fstln{% \bk@make@sideline \vbox{\bk@hdashline \bk@line@with@vdashlines}\hfil \advance\bk@lcnt\@ne \loop \bk@split \bk@addskipdp \leavevmode \ifvoid\bk@bxb % The last line \@bkcontfalse \bk@addfsepdp \bk@make@sideline \vtop{% \bk@line@with@vdashlines \bk@hdashline}% \else % 2,...,(n-1) \bk@make@sideline \bk@line@with@vdashlines \fi \hfil \advance\bk@lcnt\@ne \if@bkcont\repeat}% \fi \leavevmode\bk@fstln\par}% \vskip\breakboxskip\relax} \def\bk@hdashline{% \hbox to\linewidth{% \@tempdima\breakdashboxlinelength\relax \@tempdima.5\@tempdima \@tempdimb\breakdashboxlinegap\relax \@tempdimb.5\@tempdimb \vrule\@width\@tempdima \@height\fboxrule \cleaders \hbox{% \hskip\@tempdimb \vrule\@width\tw@\@tempdima \@height\fboxrule \hskip\@tempdimb}% \hfil \vrule\@width\@tempdima \@height\fboxrule}} \def\bk@make@sideline{% \dimen@.5\breakdashboxlinelength \advance\dimen@\bk@lastgap \@tempdima\ht\bk@bxa \advance\@tempdima\dp\bk@bxa \ifdim\bk@processed@height<\dimen@ \@tempdimb\@tempdima \advance\@tempdimb\bk@processed@height \advance\bk@remaining@height-\@tempdima \ifdim\@tempdimb<\dimen@ %%% 最初の断片の一部 \setbox\bk@sideline\hbox{% \ifdim\bk@processed@height<.5\breakdashboxlinelength \advance\@tempdimb-.5\breakdashboxlinelength \ifdim\@tempdimb<\z@ \@tempdimb\z@ \fi \vrule \@height\@tempdima \@depth-\@tempdimb \@width\fboxrule \fi \vrule\@height\@tempdima \@width\z@}% \else \ifdim\bk@remaining@height<\dimen@ %%% 最初の断片から始まり,最後の断片に入る場合 \ifdim\@tempdima<\breakdashboxlinelength \setbox\bk@sideline\hbox{% \vrule\@height\@tempdima \@width\fboxrule}% \else \setbox\bk@sideline\vbox to\@tempdima{% \hbox{% \dimen@ii\dimen@ \advance\dimen@ii-\bk@processed@height \ifdim\bk@processed@height<.5\breakdashboxlinelength \vrule \@height\dimen@ii \@depth-\bk@lastgap \@width\fboxrule \fi \vrule\@height\dimen@ii \@width\z@}% \bk@sideline@patterns \vskip-\breakdashboxlinegap \hbox{% \dimen@ii\dimen@ \advance\dimen@ii-\bk@remaining@height \ifdim\bk@remaining@height<.5\breakdashboxlinelength \@tempdimb.5\breakdashboxlinelength \advance\@tempdimb-\bk@remaining@height \vrule \@height\@tempdimb \@width\fboxrule \fi \vrule\@height\dimen@ii \@width\z@}}% \fi \else %%% 最初の断片から始まり,中間部分で止まる場合 \setbox\bk@sideline\vbox to\@tempdima{% \hbox{% \dimen@ii\dimen@ \advance\dimen@ii-\bk@processed@height \ifdim\bk@processed@height<.5\breakdashboxlinelength \vrule \@height\dimen@ii \@depth-\bk@lastgap \@width\fboxrule \fi \vrule\@height\dimen@ii \@width\z@}% \bk@sideline@patterns \bk@sideline@lastpiece}% \fi \fi \else \ifdim\bk@remaining@height<\dimen@ %%% 最後の断片の一部 \setbox\bk@sideline\hbox{% \@tempdimb\bk@remaining@height \dimen@ii\@tempdimb \advance\@tempdimb-\@tempdima \ifdim\@tempdimb<\z@ \@tempdimb\z@ \fi \ifdim\@tempdimb<.5\breakdashboxlinelength \ifdim\dimen@ii>.5\breakdashboxlinelength \dimen@ii.5\breakdashboxlinelength \fi \advance\dimen@ii-\@tempdimb \vrule \@height\dimen@ii \@width\fboxrule \fi \vrule\@height\@tempdima \@width\z@}% \advance\bk@remaining@height-\@tempdima \else \advance\bk@remaining@height-\@tempdima \ifdim\bk@remaining@height<\dimen@ %%% 中間部分から始まり,最後の断片に入る場合 \setbox\bk@sideline\vbox to\@tempdima{% \bk@sideline@firstpiece \bk@sideline@patterns \vskip-\breakdashboxlinegap \hbox{% \dimen@ii\dimen@ \advance\dimen@ii-\bk@remaining@height \ifdim\bk@remaining@height<.5\breakdashboxlinelength \@tempdimb.5\breakdashboxlinelength \advance\@tempdimb-\bk@remaining@height \vrule \@height\@tempdimb \@width\fboxrule \fi \vrule\@height\dimen@ii \@width\z@}}% \else %%% 中間部分の内部 \setbox\bk@sideline\vbox to\@tempdima{% \bk@get@firstpiece@number \bk@get@lastpiece@number \ifnum\@tempcnta<\@tempcntb \bk@sideline@firstpiece \bk@sideline@patterns \bk@sideline@lastpiece \else \bk@sideline@intermediatepiece \fi}% \fi \fi \fi \setbox\bk@sideline\hbox{\lower\dp\bk@bxa\box\bk@sideline}% \advance\bk@processed@height\@tempdima} \def\bk@sideline@patterns{% \cleaders \hbox{% \dimen@ii\breakdashboxlinelength \advance\dimen@ii\breakdashboxlinegap \vrule\@height\dimen@ii \@depth-\breakdashboxlinegap}% \vfil} \def\bk@sideline@firstpiece{% \bk@get@firstpiece@number \advance\@tempcnta\@ne \@tempdimb\@tempcnta\dimen@ii \advance\@tempdimb-\bk@processed@height \advance\@tempdimb\dimen@ \hbox{% \ifdim\@tempdimb>\breakdashboxlinegap \vrule \@height\@tempdimb \@depth-\breakdashboxlinegap \fi \vrule\@height\@tempdimb \@width\z@}} \def\bk@get@firstpiece@number{% \dimen@ii\breakdashboxlinelength \advance\dimen@ii\breakdashboxlinegap \@tempdimb\bk@processed@height \advance\@tempdimb-\dimen@ \divide\@tempdimb\dimen@ii \@tempcnta\@tempdimb} \def\bk@sideline@lastpiece{% \bk@get@lastpiece@number \multiply\@tempdimb\dimen@ii \advance\@tempdimb-\bk@processed@height \advance\@tempdimb-\@tempdima \advance\@tempdimb\dimen@ \@tempdimb-\@tempdimb \dimen@ii\breakdashboxlinelength \advance\dimen@ii-\@tempdimb \ifdim\dimen@ii>\z@ \dimen@ii\z@ \fi \hbox{\vrule \@height\@tempdimb \@depth\dimen@ii \@width\fboxrule}} \def\bk@get@lastpiece@number{% \dimen@ii\breakdashboxlinelength \advance\dimen@ii\breakdashboxlinegap \@tempdimb\bk@processed@height \advance\@tempdimb\@tempdima \advance\@tempdimb-\dimen@ \divide\@tempdimb\dimen@ii \@tempcntb\@tempdimb} \def\bk@sideline@intermediatepiece{% \bk@get@firstpiece@number \multiply\@tempdimb\dimen@ii \advance\@tempdimb-\bk@processed@height \advance\@tempdimb\dimen@ \@tempdimb-\@tempdimb \dimen@ii\@tempdimb \advance\dimen@ii\@tempdima \hbox{% \ifdim\@tempdimb<\breakdashboxlinelength \ifdim\dimen@ii>\breakdashboxlinelength \dimen@ii\breakdashboxlinelength \fi \advance\dimen@ii-\@tempdima \advance\dimen@ii-\@tempdimb \vrule\@height\@tempdima \@depth\dimen@ii \@width\fboxrule \fi \vrule\@height\@tempdima \@width\z@}} \def\bk@line@with@vdashlines{% \hbox to \linewidth{% \ifbkcount\smash{\llap{\the\bk@lcnt\ }}\fi \copy\bk@sideline \hskip\fboxsep \box\bk@bxa\hfil \hskip\fboxsep \box\bk@sideline}} \makeatother [蛇足] 破線(の断片)をうまく出力するための計算が面倒,というだけなのですが…
この書き込みへの返事: