
拡張行列内の表示数式モードで分数をタイプセットしたいのですが、2
ある行の分母の「 」が1
次の行の分子の「 」に接しており、これは適切ではありません。行間の間隔を広げるにはどうすればよいですか?
テキストモードで分数をタイプセットするにはどうすればよいでしょうか?
環境を使用するコードがほしいですarray
。bmatrix
環境を使用するコードで、環境を使用するコードと同様にレンダリングされるものがarray
あれば、それも見たいです。
\documentclass[10pt]{amsart}
\usepackage{mathtools,array}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{equation*}
\renewcommand{\arraystretch}{1.2}
\left[
\begin{array}{@{}ccc|r@{}}
1 & 0 & -1 & a \\
0 & 1 & 0 & \dfrac{1}{2} \, a + \dfrac{1}{2} \, b + \dfrac{1}{2} \, c \\
0 & 0 & 1 & -\dfrac{1}{2} \, a - \dfrac{1}{2} \, b + \dfrac{1}{2} \, c
\end{array}
\right]
\end{equation*}
\end{document}
答え1
最後の列では右揃えは避けます。
私には 3 つの提案があります。私の意見では、最善なのは最後の提案で、最悪なのは真ん中の提案です。
\documentclass{amsart}
\usepackage{mathtools}
\begin{document}
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
1 & 0 & -1 & a \\[1ex]
0 & 1 & 0 & \hphantom{-}\frac{1}{2} a + \frac{1}{2} b + \frac{1}{2} c \\[1ex]
0 & 0 & 1 & -\frac{1}{2} a - \frac{1}{2} b + \frac{1}{2} c \\[0.5ex]
\end{array}\right]
\end{equation*}
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
1 & 0 & -1 & a \\[2ex]
0 & 1 & 0 & \hphantom{-}\dfrac{1}{2} a + \dfrac{1}{2} b + \dfrac{1}{2} c \\[2ex]
0 & 0 & 1 & -\dfrac{1}{2} a - \dfrac{1}{2} b + \dfrac{1}{2} c \\[1ex]
\end{array}\right]
\end{equation*}
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
1 & 0 & -1 & a \\
0 & 1 & 0 & (a + b + c)/2 \\
0 & 0 & 1 & (-a - b + c)/2
\end{array}\right]
\end{equation*}
\end{document}
答え2
数値係数については、まず の中程度の分数を使用しnccmath
、empheq
同名のパッケージの環境を使用して、次に の値を増やします\arraystretch
。
\documentclass[10pt]{amsart}
\usepackage{nccmath}
\usepackage{empheq}
\usepackage{amssymb}
\begin{document}
\begin{empheq}[left = \empheqlbrack, right =\empheqrbrack]{equation*}
\renewcommand{\arraystretch}{1.75}
\begin{array}{@{\,}ccc|l@{\,}}
1 & 0 & 0 & \phantom{-}a \\
0 & \phantom{-}1 & -1 & \phantom{-}\mfrac{1}{2} \, a + \mfrac{1}{2} \, b + \mfrac{1}{2} \, c \\
0 & 0 & 1 & -\mfrac{1}{2} \, a - \mfrac{1}{2} \, b + \mfrac{1}{2} \, c
\end{array}
\end{empheq}
\end{document}
答え3
パッケージを使用した別の解決策nicematrix
。 コマンドを使用して、 a をさらに右にシフトできます\mkern-180mu
。 たとえば、\mkern-150mu
文字a
をさらに右に移動します。
注: ユーザーの正しいコメントは見ていませんミコセット用\renewcommand{\arraystretch}{2}
。
%% Compile and read me!
\documentclass[a4paper,12pt]{article}
\usepackage{nicematrix}
\begin{document}
\renewcommand{\arraystretch}{2}
$\left[\begin{NiceArray}{CCC|R}
1 & 0 & -1 & \mkern-180mu a \\
0 & 1 & 0 & \dfrac{1}{2} a + \dfrac{1}{2} b + \dfrac{1}{2} c \\
0 & 0 & 1 & -\dfrac{1}{2} a - \dfrac{1}{2} b + \dfrac{1}{2} c
\end{NiceArray}\right]$
\end{document}
ない場合は\mkern-180mu
、次の出力が表示されます。
答え4
この配列で を使用する正当な理由がわかりません。の\dfrac
すべてのインスタンスをに変更し、同様に無意味なディレクティブを削除し、 の値を 1.2 から 1.333 に増やし、4 番目の列の列タイプを からに変更し、慎重に選択したディレクティブをいくつか挿入すると、次の結果が得られます。\dfrac
\frac
\,
\arraystretch
r
l
\phantom
\documentclass{amsart}
\begin{document}
\begin{equation*}
\renewcommand{\arraystretch}{1.333}
\left[
\begin{array}{@{}rrr|l@{}}
1 & 0 &-1 & \phantom{-\frac{1}{2}}a \\
0 & 1 & 0 & \phantom{-}\frac{1}{2}a + \frac{1}{2}b + \frac{1}{2}c \\
0 & 0 & 1 & -\frac{1}{2}a - \frac{1}{2}b + \frac{1}{2}c
\end{array}
\right]
\end{equation*}
\end{document}