Re: カッコを自動的に拡大するには.式番号を1行目だけに付けるには.

名前: しっぽ愛好家
日時: 2004-08-04 23:53:25
IPアドレス: 211.4.121.*

>>30689 ・第1点について: 次のようなことは可能ですが,弊害の方が大きいと思われます. %%% また,| や \| のようなものに対しては開き括弧扱いにすべきか %%% 閉じ括弧扱いにすべきか(それとも括弧扱いではないのか)の区別が %%% 記述の意味内容を考えない限り判断できない,という問題もあります. \documentclass{jarticle} %%% (, ) についてのみ例示します. \mathcode`\(="8000 \mathcode`\)="8000 \begingroup \catcode`\(=\active \lccode`\[=`\( \catcode`\)=\active \lccode`\]=`\) \lowercase{% \gdef({\left[}% \gdef){\right]}} \endgroup \begin{document} \[ \|f\|_2 = (\int_X |f(x)|^2 dx)^{1/2} \] \end{document} ・第 2 点について: ディスプレイ数式環境に然るべき再定義を施せば,そういう処理も可能です. しかし,そもそも,数式番号を個々の問題の番号のように扱うこと自体が 疑問で,本来ならば次のように記述すべきところでしょう. %%% \theenumi などは適宜定義しておきます. \begin{enumerate} \item \begin{eqnarray*}%%% align* 環境の類でも可 %%% 適当な数式の記述 \end{eqnarray*} \item \begin{eqnarray*} %%% 適当な数式の記述 \end{eqnarray*} %%% 以下同様 \end{enumerate} もちろん,デフォルトの定義のままでは enumerate 環境の \item による番号の後で 改行されてしまいますので,それが起こらないように各種ディスプレイ数式環境を 再定義することになります. e.g. \documentclass[fleqn]{jarticle}%%% もはや leqno オプションは使用しません. \mathindent=3zw %%% amsmath パッケージによる各種ディスプレイ数式に手を入れるのは %%% 手間ですので,ここでは省略します. \makeatletter % %%% enumerate 環境の番号づけの形式の変更 \def\theenumi{\arabic{enumi}} \def\labelenumi{(\theenumi)} % %%% eqnarray 環境の再定義 \newbox\@eqnarray@saved@label \def\eqnarray{% \@equation@setup \stepcounter{equation}% \def\@currentlabel{\p@equation\theequation}% \global\@eqnswtrue \m@th \global\@eqcnt\z@ \@ifundefined{mathindent}{\tabskip\@centering}{\tabskip\mathindent}% \let\\\@eqncr $$\everycr{}\halign to\displaywidth\bgroup \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel &\global\@eqcnt\@ne\hfil${##}$\hfil &\global\@eqcnt\tw@ $\displaystyle{{}##{}}$\hfil\tabskip\@centering &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup \tabskip\z@skip \cr} \def\@equation@setup{% \if@inlabel \setbox\@eqnarray@saved@label\box\@labels \if@newlist \global\@newlistfalse \fi \global\@inlabelfalse \@minipagefalse \everypar{}% \else \setbox\@eqnarray@saved@label\box\voidb@x \fi} \def\@@eqncr{% \let\reserved@a\relax \ifcase\@eqcnt \def\reserved@a{& & &}% \or \def\reserved@a{& &}% \or \def\reserved@a{&}% \else \let\reserved@a\@empty \@latex@error{Too many columns in eqnarray environment}\@ehc \fi \reserved@a \if@eqnsw\@eqnnum\stepcounter{equation}\fi \ifvoid\@eqnarray@saved@label\else \hbox to1sp{% \kern-\displaywidth \box\@eqnarray@saved@label \hss}% \fi \global\@eqnswtrue\global\@eqcnt\z@\cr} % %%% equation 環境および \[, \] については fleqn.clo での定義を用いても %%% 深刻な問題はありません(が,\mathindent に関する補正を行った方が %%% よいかもしれません). %%% また,amsmath パッケージで再定義された方の equation 環境あるいは \[, \] の %%% 定義は箇条書き環境とは相性が悪いので,これらに関しては上記の再定義例と %%% 同様の変更を施すか,使用しないで済ますことになります. \makeatother \begin{document} \begin{enumerate} \item \begin{eqnarray*} \Gamma(x + 1) & = & \int_0^{\infty} t^x e^{-t} dt \\ & = & \cdots \\ & = & x \Gamma(x) \end{eqnarray*} \item %%% 次の定積分の値を求めよ. \[ \int_0^{\infty} e^{-x^2\!/2} dx \] \end{enumerate} \end{document} %%% このような対処を行うことが手に余るようでしたら, %%% 従来どおり,数式番号を問題番号の類に転用しつつ %%% 不要な番号を消すようにするのが無難です.

この書き込みへの返事:

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