
증강 행렬 내의 디스플레이 수학 모드에서 분수를 조판하고 싶습니다. 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
마지막 열에서는 오른쪽 정렬을 피하겠습니다.
나에게는 세 가지 제안이 있습니다. 제 생각에는 가장 좋은 제안은 마지막 제안입니다. 최악은 중간이다.
\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
이 배열에 사용하는 유효한 이유를 볼 수 없습니다 . 의 모든 인스턴스를 \dfrac
to 으로 변경하고 \frac
, 똑같이 동기가 없는 지시어를 제거하고 \,
, 값을 \arraystretch
1.2에서 1.333으로 늘리고, 네 번째 열의 열 유형을 에서 로 변경하고 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}