発言者: Dora
発言日: 2009 10/19 03:27
発言元: nttkyo692118.tkyo.nt.ftth.ppp.infoweb.ne.jp
無理矢理ですが,\[ \] の定義や amsmath の定義を変更して,
fleqn 時の数式の左インデントに \leftskip を加味させるようにしてみました。
これで
「EMchangeLRskip環境内での \mathindent の変更」
にも対応できたように思いますが,思わぬ副作用があるかもしれません。
しばらく実験してみます。
\@ifundefined{mathindent}{}{%
\renewcommand\[{\relax
\ifmmode\@badmath
\else
\@tempdimb=\mathindent % ここを追加
\advance\@tempdimb\leftskip % ここを追加
\begin{trivlist}%
\@beginparpenalty\predisplaypenalty
\@endparpenalty\postdisplaypenalty
\item[]\leavevmode
\hb@xt@\linewidth\bgroup $\m@th\displaystyle %$
\hskip\@tempdimb\bgroup % ここを変更
\fi}
\renewcommand\]{\relax
\ifmmode
\egroup $\hfil% $
\egroup
\end{trivlist}%
\else \@badmath
\fi}
}
\def\gmeasure@#1{%
\begingroup
\measuring@true
\totwidth@\z@
\global\let\tag@lengths\@empty
\savecounters@
\setbox\@ne\vbox{%
\everycr{\noalign{\global\tag@false
\global\let\raise@tag\@empty \global\column@\z@}}%
\let\label\@gobble
\halign{%
\setboxz@h{$\m@th\displaystyle{##}$}%
\ifdim\wdz@>\totwidth@
\global\totwidth@\wdz@
\fi
&\setboxz@h{\strut@{##}}%
\savetaglength@
\crcr
#1%
\math@cr@@@
}%
}%
\restorecounters@
\if@fleqn
\global\advance\totwidth@\@mathmargin
\global\advance\totwidth@\leftskip % ここを追加
\fi
\iftagsleft@
\ifdim\totwidth@>\displaywidth
\global\let\gdisplaywidth@\totwidth@
\else
\global\let\gdisplaywidth@\displaywidth
\fi
\fi
\endgroup
}
\def\calc@shift@gather{%
\dimen@\mintagsep\relax
\tagwidth@\tag@width\row@\relax
\if@fleqn
\global\eqnshift@\@mathmargin
\global\advance\eqnshift@\leftskip % ここを追加
\ifdim\tagwidth@>\z@
\advance\dimen@\tagwidth@
\iftagsleft@
\ifdim\dimen@>\@mathmargin
\global\shifttag@true
\fi
\else
\advance\dimen@\@mathmargin
\advance\dimen@\wdz@
\ifdim\dimen@>\displaywidth
\global\shifttag@true
\fi
\fi
\fi
\else
\global\eqnshift@\displaywidth
\global\advance\eqnshift@-\wdz@
\ifdim\tagwidth@>\z@
\multiply\dimen@\tw@
\advance\dimen@\wdz@
\advance\dimen@\tagwidth@
\ifdim\dimen@>\displaywidth
\global\shifttag@true
\else
\ifdim\eqnshift@<4\tagwidth@
\global\advance\eqnshift@-\tagwidth@
\fi
\fi
\fi
\global\divide\eqnshift@\tw@
\iftagsleft@
\global\eqnshift@-\eqnshift@
\global\advance\eqnshift@\displaywidth
\global\advance\eqnshift@-\wdz@
\fi
\ifdim\eqnshift@<\z@
\global\eqnshift@\z@
\fi
\fi
}
\def\measure@#1{%
\begingroup
\measuring@true
\global\eqnshift@\z@
\global\alignsep@\z@
\global\let\tag@lengths\@empty
\global\let\field@lengths\@empty
\savecounters@
\global\setbox0\vbox{%
\let\math@cr@@@\math@cr@@@align@measure
\everycr{\noalign{\global\tag@false
\global\let\raise@tag\@empty \global\column@\z@}}%
\let\label\@gobble
\global\row@\z@
\tabskip\z@
\halign{\span\align@preamble\crcr
#1%
\math@cr@@@
\global\column@\z@
\add@amps\maxfields@\cr
}%
}%
\restorecounters@
\ifodd\maxfields@
\global\advance\maxfields@\@ne
\fi
\ifnum\xatlevel@=\tw@
\ifnum\maxfields@<\thr@@
\let\xatlevel@\z@
\fi
\fi
\setbox\z@\vbox{%
\unvbox\z@ \unpenalty \global\setbox\@ne\lastbox
}%
\global\totwidth@\wd\@ne
\if@fleqn
\global\advance\totwidth@\@mathmargin
\global\advance\totwidth@\leftskip % ここを追加
\fi
\global\let\maxcolumn@widths\@empty
\begingroup
\let\or\relax
\loop
\global\setbox\@ne\hbox{%
\unhbox\@ne \unskip \global\setbox\thr@@\lastbox
}%
\ifhbox\thr@@
\xdef\maxcolumn@widths{ \or \the\wd\thr@@ \maxcolumn@widths}%
\repeat
\endgroup
\dimen@\displaywidth
\advance\dimen@-\totwidth@
\ifcase\xatlevel@
\global\alignsep@\z@
\let\minalignsep\z@
\@tempcntb\z@
\if@fleqn
\@tempcnta\@ne
\global\eqnshift@\@mathmargin
\global\advance\eqnshift@\leftskip % ここを追加
\else
\@tempcnta\tw@
\global\eqnshift@\dimen@
\global\divide\eqnshift@\@tempcnta
\fi
\or
\@tempcntb\maxfields@
\divide\@tempcntb\tw@
\@tempcnta\@tempcntb
\advance\@tempcntb\m@ne
\if@fleqn
\global\eqnshift@\@mathmargin
\global\advance\eqnshift@\leftskip % ここを追加
\global\alignsep@\dimen@
\global\divide\alignsep@\@tempcnta
\else
\global\advance\@tempcnta\@ne
\global\eqnshift@\dimen@
\global\divide\eqnshift@\@tempcnta
\global\alignsep@\eqnshift@
\fi
\or
\@tempcntb\maxfields@
\divide\@tempcntb\tw@
\global\advance\@tempcntb\m@ne
\global\@tempcnta\@tempcntb
\global\eqnshift@\z@
\global\alignsep@\dimen@
\if@fleqn
\global\advance\alignsep@\@mathmargin\relax
\global\advance\alignsep@\leftskip\relax % ここを追加
\fi
\global\divide\alignsep@\@tempcntb
\fi
\ifdim\alignsep@<\minalignsep\relax
\global\alignsep@\minalignsep\relax
\ifdim\eqnshift@>\z@
\if@fleqn\else
\global\eqnshift@\displaywidth
\global\advance\eqnshift@-\totwidth@
\global\advance\eqnshift@-\@tempcntb\alignsep@
\global\divide\eqnshift@\tw@
\fi
\fi
\fi
\ifdim\eqnshift@<\z@
\global\eqnshift@\z@
\fi
\calc@shift@align
\global\tagshift@\totwidth@
\global\advance\tagshift@\@tempcntb\alignsep@
\if@fleqn
\ifnum\xatlevel@=\tw@
\global\advance\tagshift@-\@mathmargin\relax
\global\advance\tagshift@-\leftskip\relax % ここを追加
\fi
\else
\global\advance\tagshift@\eqnshift@
\fi
\iftagsleft@ \else
\global\advance\tagshift@-\displaywidth
\fi
\dimen@\minalignsep\relax
\global\advance\totwidth@\@tempcntb\dimen@
\ifdim\totwidth@>\displaywidth
\global\let\displaywidth@\totwidth@
\else
\global\let\displaywidth@\displaywidth
\fi
\endgroup
}
\def\multline@#1{%
\Let@
\@display@init{\global\advance\row@\@ne \global\dspbrk@lvl\m@ne}%
\chardef\dspbrk@context\z@
\restore@math@cr
\let\tag\tag@in@align
\global\tag@false \global\let\raise@tag\@empty
\mmeasure@{#1}%
\let\tag\gobble@tag \let\label\@gobble
\@tempdimb=\@mathmargin % ここを追加
\advance\@tempdimb\leftskip % ここを追加
\tabskip \if@fleqn \@tempdimb \else \z@skip \fi % ここを変更
\totwidth@\displaywidth
\if@fleqn
\advance\totwidth@-\@mathmargin
\fi
\halign\bgroup
\hbox to\totwidth@{%
\if@fleqn
\hskip \@centering \relax
\else
\hfil
\fi
\strut@
$\m@th\displaystyle{}##\endmultline@math
\hfil
}%
\crcr
\if@fleqn
\hskip-\@mathmargin
\def\multline@indent{\hskip\@mathmargin}% put it back
\else
\hfilneg
\def\multline@indent{\hskip\multlinegap}%
\fi
\iftagsleft@
\iftag@
\begingroup
\ifshifttag@
\rlap{\vbox{%
\normalbaselines
\hbox{%
\strut@
\make@display@tag
}%
\vbox to\lineht@{}%
\raise@tag
}}%
\multline@indent
\else
\setbox\z@\hbox{\make@display@tag}%
\dimen@\@mathmargin \advance\dimen@-\wd\z@
\ifdim\dimen@<\multlinetaggap
\dimen@\multlinetaggap
\fi
\box\z@ \hskip\dimen@\relax
\fi
\endgroup
\else
\multline@indent
\fi
\else
\multline@indent
\fi
#1%
}
▼関連発言
│
└◆8386:mawarikomi環境内でのindentation環境の使用 [Dora] 10/16 13:32
└◆8387:Re:mawarikomi環境内でのindentation環境の使用 [tDB] 10/16 16:18
├◆8390:Re[2]:mawarikomi環境内でのindentation環境の使用 [Dora] 10/16 23:09
└◆8392:Re[2]:mawarikomi環境内でのindentation環境の使用 [Dora] 10/18 08:56
└◆8393:Re[3]:mawarikomi環境内でのindentation環境の使用 [tDB] 10/18 13:31
├◆8394:Re[4]:mawarikomi環境内でのindentation環境の使用 [Dora] 10/18 15:57
├◆8395:Re[4]:mawarikomi環境内でのindentation環境の使用 [Dora] 10/18 21:05
│└◆8396:Re[5]:mawarikomi環境内でのindentation環境の使用 [tDB] 10/18 22:22
│ └◆8397:Re[6]:mawarikomi環境内でのindentation環境の使用 [Dora] 10/19 03:27
└◆8398:Re[4]:mawarikomi環境内でのindentation環境の使用 [Dora] 10/21 16:56
└◆8401:Re[5]:mawarikomi環境内でのindentation環境の使用 [tDB] 10/22 12:23
├◆8402:Re[6]:mawarikomi環境内でのindentation環境の使用 [Dora] 10/22 12:57
│└◆8403:Re[7]:mawarikomi環境内でのindentation環境の使... [tDB] 10/22 20:09
└◆8407:Re[6]:mawarikomi環境内でのindentation環境の使用 [Dora] 10/27 14:41
└◆8410:Re[7]:mawarikomi環境内でのindentation環境の使... [tDB] 10/29 12:54<-last