Re: マージン

名前: しっぽ愛好家
日時: 2003-09-06 13:20:26
IPアドレス: 219.108.37.*

>>21565 マージンをページごとに変える,というのは, 確かにページ出力処理の側で扱うこともできます. 実際に個々のページを出力する際にページの中身を適切な位置に 置ければよいので,\@outputpage あたりに適当な処理を追加することも できるでしょう. 例えば,次のようなところでしょうか. %%% この例では,ページごとにマージンを(\@leftmargin@page@<page>, %%% \@topmargin@page@<page> を通じて)与えることにしていますが, %%% ``\thispageleftmargin'' のようなものを導入するのも大差ありません. %%% %%% \@leftmargin@page@<page> が定義されているか,を検査する代わりに, %%% %%% マージンが変更されたか否かを表すフラグを導入すればよいわけです. \documentclass{jarticle} \textheight.5\textheight \makeatletter \@namedef{@leftmargin@page@1}{10mm}%%% 1 ページ目の左余白 \@namedef{@leftmargin@page@3}{30mm}%%% 3 ページ目の左余白 \oddsidemargin 20mm %%% 左余白のデフォルトを 20mm に設定 \advance\oddsidemargin-1in \newdimen\@curr@themargin \def\@outputpage{% \begingroup% the \endgroup is put in by \aftergroup \iftdir \dimen\z@\textwidth \textwidth\textheight \textheight\dimen\z@ \fi \let\protect\noexpand \@resetactivechars \global\let\@@if@newlist\if@newlist \global\@newlistfalse \@parboxrestore \shipout\vbox{% \yoko \set@typeset@protect \aftergroup\endgroup \aftergroup\set@typeset@protect \if@specialpage \global\@specialpagefalse\@nameuse{ps@\@specialstyle}% \fi %%% \@themargin を設定している箇所を変更 \if@twoside \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot \@ifundefined{@leftmargin@page@\the\c@page}% {\iftdir \let\@themargin\evensidemargin \else \let\@themargin\oddsidemargin \fi}% {\@curr@themargin\@nameuse{@leftmargin@page@\the\c@page}\relax \advance\@curr@themargin -1in \let\@themargin\@curr@themargin}% \else \let\@thehead\@evenhead \let\@thefoot\@evenfoot \@ifundefined{@leftmargin@page@\the\c@page}% {\iftdir \let\@themargin\oddsidemargin \else \let\@themargin\evensidemargin \fi}% {\@curr@themargin\@nameuse{@leftmargin@page@\the\c@page}\relax \advance\@curr@themargin -1in \let\@themargin\@curr@themargin}% \fi \else \@ifundefined{@leftmargin@page@\the\c@page}% {\let\@themargin\oddsidemargin}% {\@curr@themargin\@nameuse{@leftmargin@page@\the\c@page}\relax \advance\@curr@themargin -1in \let\@themargin\@curr@themargin}% \fi %%% \@@topmargin を設定している箇所も変更 \@ifundefined{@topmargin@page@\the\c@page}% {\@@topmargin\topmargin}% {\@@topmargin\@nameuse{@topmargin@page@\the\c@page}\relax \advance\@@topmargin-1in\relax}% \iftombow \@@paperwidth\paperwidth \advance\@@paperwidth 6mm\relax \@@paperheight\paperheight \advance\@@paperheight 16mm\relax \advance\@@topmargin 1in\relax \advance\@themargin 1in\relax \fi \reset@font \normalsize \normalsfcodes \let\label\@gobble \let\index\@gobble \let\glossary\@gobble \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@ \@begindvi \@outputtombow \vskip \@@topmargin \moveright\@themargin\vbox{% \setbox\@tempboxa\vbox to\headheight{% \vfil \color@hbox \normalcolor \hb@xt@\textwidth{\@thehead}% \color@endbox}%%% 22 Feb 87 \dp\@tempboxa\z@ \box\@tempboxa \vskip\headsep \box\@outputbox \baselineskip\footskip \color@hbox \normalcolor \hb@xt@\textwidth{\@thefoot}% \color@endbox}}% \global\let\if@newlist\@@if@newlist \global\@colht\textheight \stepcounter{page}% \let\firstmark\botmark} \makeatother \begin{document} \def\text{% ぱたぱたおよよあれれとほほおっとっと ぱたぱたおよよあれれとほほおっとっと ぱたぱたおよよあれれとほほおっとっと ぱたぱたおよよあれれとほほおっとっと ぱたぱたおよよあれれとほほおっとっと\par} \text\text\text\text\text \text\text\text\text\text \text\text\text\text\text \text\text\text\text\text \text\text\text\text\text \end{document} 一方,行長の一時的な変更については, ・行分割処理は段落単位で行われる ・ページ分割位置を事前に知ることはできない という事情により,一般的な状況において特定のページのみでの行長を 一時的に変更するのは困難でしょう. (つまり,段落の途中でページが変わると困るわけです.) %%% 明示的に \newpage/\clearpage によるページ分割を行ってよいのであれば… %%% \leftskip/\rightskip を用いても,他のものを流用しても,大差ないようです.

この書き込みへの返事:

お名前
題名 
メッセージ(タグは <a href="...">...</a> だけ使えます)