3 개 어레이 정렬 : 첫 번째는 왼쪽, 두 번째는 오른쪽 상단, 세 번째는 오른쪽 하단
Aug 19 2020
차원이 다른 3 개의 배열이 있습니다. 첫 번째 배열은 왼쪽에, 두 번째는 오른쪽 상단에, 세 번째는 오른쪽 하단에 배치하고 싶습니다. 지금까지 두 개의 배열 만 배치 할 수 있습니다. 아래 코드는 다음과 같습니다.
\documentclass[12 pt, a4paper]{book}
\usepackage{multicol}
\usepackage{geometry}
\geometry{
a4paper,
total={170 mm,257 mm},
left=20 mm,
top=20 mm,
}
\usepackage{amsmath,bm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{soul}
\usepackage{indentfirst}
\usepackage[utf8]{inputenc}
\usepackage{palatino}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{array}
\usepackage{enumitem}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{arydshln}
\usepackage{calc}
\setlength{\parindent}{2em}
\newcommand{\wt}[2]{\underset{\substack{\textstyle\uparrow\\\hidewidth\mathstrut#2\hidewidth}}{#1}}
\definecolor{mygray}{gray}{0.6}
\begin{document}
\textbf{Solution :}
\[
\left.
\hspace{1 cm}
\arraycolsep=0.2em
\begin{array}{rrllllll}
& & & & 1 & 2 & 5 & 5 \\
\cline{3-8}
5 & 2 & ) & 6 & 5 & 2 & 9 & 6 \\
& & - & 5 & 2 & & & \\
\cline{4-6}
& & & 1 & 3 & 2 & & \\
& & - & 1 & 0 & 4 & & \\
\cline{4-7}
& & & 0 & 2 & 8 & 9 & \\
& & & - & 2 & 6 & 0 & \\
\cline{5-8}
& & & & 0 & 2 & 9 & 6 \\
& & & & - & 2 & 6 & 0 \\
\cline{6-8}
& & & & & 0 & 3 & 6 \\
\end{array}
\right. \hspace{0.25 cm}\vline \hspace{0.1 cm}
\arraycolsep=0.2em
\begin{array}[b]{ccccc@{\hskip 0.5in}ccccc@{\hskip 0.5in}ccccc}
52 & \times & 1 & = & 52 & 52 & \times & 5 & = & 260 \\
52 & \times & 2 & = & 104 & 52 & \times & 6 & = & 312 & 52 & \times & 9 & = & 468 \\
52 & \times & 3 & = & 156 & 52 & \times & 7 & = & 364 & 52 & \times & 10 & = & 520 \\
52 & \times & 4 & = & 208 & 52 & \times & 8 & = & 416 \\\\
\hdashline \\
\end{array}
\]
\end{document}
내 코드의 출력은 다음과 같습니다.

세 번째 배열의 코드는 다음과 같습니다.
\[
\begin{array}{ccccccccc}
& & \textbf{Difference} & \textbf{Value} & & \textbf{Base} & & \textbf{Borrow} & \textbf{Prev. Bit} \\
11 - 15 & = & -4 < 0 & 11 & + & 16 & = & 27 & \mathrm{A} \rightarrow \underline{9} \\
\underline{9} - 14 & = & -5 < 0 & 9 & + & 16 & = & 25 & \mathrm{F} \rightarrow \underline{\mathrm{E}}
\end{array}
\]
원하는 출력 :

또한 일시적이 아닌 표준 솔루션을 원합니다. 따라서 배열의 크기가 변경되면 작동합니다. 누구든지 이것으로 나를 도울 수 있습니까?
답변
1 Mico Aug 19 2020 at 22:50
array
두 개의 중첩 된 tabular
환경에 세 가지 환경 을 포함하는 것이 좋습니다 . "외부", 2 열 tabular
은 array
왼쪽 열의 환경, 수직 규칙 및 tabular
오른쪽 열의 "내부"1 열로 구성됩니다. "내부"테이블 형식에는 두 가지 array
환경 이 포함 됩니다. 이 설정은 처음에는 약간 복잡하게 들릴 수 있지만 "일시적인 것이 아닌 표준 솔루션"에 대한 요구 사항을 충족한다고 생각합니다.
아, Palatino를 기본 텍스트 글꼴로 사용 했으므로 Palatino 수학 글꼴도 사용하는 것이 좋습니다. 이것은 \usepackage{newpxtext, newpxmath}
프리앰블에서 실행 하여 달성 할 수 있습니다 .

\documentclass[12pt, a4paper]{book}
%% (I've pared the preamble down to the bare minimum needed
%% to get your code to compile.)
\usepackage{geometry}
\geometry{total={170mm,257mm}, left=20mm, top=20mm}
\usepackage{amsmath,bm,amssymb}
\usepackage[utf8]{inputenc}
\usepackage{newpxtext,newpxmath}
\usepackage{arydshln}
\begin{document}
\noindent
\textbf{Solution :}
\begin{center}
\setlength\tabcolsep{1cm}
\setlength\arraycolsep{0.2em}
\begin{tabular}{@{} c | c @{}} % "outer" tabular
$\begin{array}{@{} rrllllll @{}} & & & & 1 & 2 & 5 & 5 \\ \cline{3-8} 5 & 2 & ) & 6 & 5 & 2 & 9 & 6 \\ & & - & 5 & 2 & & & \\ \cline{4-6} & & & 1 & 3 & 2 & & \\ & & - & 1 & 0 & 4 & & \\ \cline{4-7} & & & 0 & 2 & 8 & 9 & \\ & & & - & 2 & 6 & 0 & \\ \cline{5-8} & & & & 0 & 2 & 9 & 6 \\ & & & & - & 2 & 6 & 0 \\ \cline{6-8} & & & & & 0 & 3 & 6 \\ \end{array}$ &
\begin{tabular}{@{} c @{}} % "inner" tabular
$\begin{array}{@{} *{2}{ccccc@{\hskip 0.5in}} ccccc @{}} 52 & \times & 1 & = & 52 & 52 & \times & 5 & = & 260 \\ 52 & \times & 2 & = & 104 & 52 & \times & 6 & = & 312 & 52 & \times & 9 & = & 468 \\ 52 & \times & 3 & = & 156 & 52 & \times & 7 & = & 364 & 52 & \times & 10 & = & 520 \\ 52 & \times & 4 & = & 208 & 52 & \times & 8 & = & 416 \end{array}$\\\\
\hdashline \\
$\begin{array}{@{} *{9}{c} @{}} & & \text{Diff.} & \text{Value} & & \text{Base} & & \text{Borrow} & \text{Prev.\ Bit} \\ 11 - 15 & = & -4 < 0 & 11 & + & 16 & = & 27 & \mathrm{A} \rightarrow \underline{9} \\ \underline{9} - 14 & = & -5 < 0 & 9 & + & 16 & = & 25 & \mathrm{F} \rightarrow \underline{\mathrm{E}} \end{array}$
\end{tabular} % end of inner tabular
\end{tabular} % end of outer tabular
\end{center}
\end{document}
1 egreg Aug 20 2020 at 00:51
나는 여전히 그것이 tabularx
갈 길이 라고 생각합니다 .
\documentclass[12 pt, a4paper]{book}
\usepackage{multicol}
\usepackage{geometry}
\geometry{
a4paper,
total={170 mm,257 mm},
left=20 mm,
top=20 mm,
}
\usepackage{amsmath,bm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{soul}
\usepackage{indentfirst}
\usepackage[utf8]{inputenc}
\usepackage{palatino}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{array}
\usepackage{enumitem}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{arydshln}
\usepackage{calc}
\usepackage{tabularx}
\setlength{\parindent}{2em}
\newcommand{\wt}[2]{\underset{\substack{\textstyle\uparrow\\\hidewidth\mathstrut#2\hidewidth}}{#1}}
\definecolor{mygray}{gray}{0.6}
\begin{document}
\textbf{Solution:}
\[
\setlength{\arraycolsep}{0.2em}
\begin{tabularx}{\displaywidth}{ @{\hspace{1cm}} c | X @{} }
$\begin{array}{rrllllll} & & & & 1 & 2 & 5 & 5 \\ \cline{3-8} 5 & 2 & ) & 6 & 5 & 2 & 9 & 6 \\ & & - & 5 & 2 & & & \\ \cline{4-6} & & & 1 & 3 & 2 & & \\ & & - & 1 & 0 & 4 & & \\ \cline{4-7} & & & 0 & 2 & 8 & 9 & \\ & & & - & 2 & 6 & 0 & \\ \cline{5-8} & & & & 0 & 2 & 9 & 6 \\ & & & & - & 2 & 6 & 0 \\ \cline{6-8} & & & & & 0 & 3 & 6 \\ \end{array}$
&
\begin{tabular}{@{}w{c}{\linewidth}@{}}
$\begin{array}[b]{ccccc@{\hskip 0.5in}ccccc@{\hskip 0.5in}ccccc} 52 & \times & 1 & = & 52 & 52 & \times & 5 & = & 260 \\ 52 & \times & 2 & = & 104 & 52 & \times & 6 & = & 312 & 52 & \times & 9 & = & 468 \\ 52 & \times & 3 & = & 156 & 52 & \times & 7 & = & 364 & 52 & \times & 10 & = & 520 \\ 52 & \times & 4 & = & 208 & 52 & \times & 8 & = & 416 \end{array}$
\\ \\
\hdashline
\\
$\begin{array}{ccccccccc} & & \textbf{Difference} & \textbf{Value} & & \textbf{Base} & & \textbf{Borrow} & \textbf{Prev. Bit} \\ 11 - 15 & = & -4 < 0 & 11 & + & 16 & = & 27 & \mathrm{A} \rightarrow \underline{9} \\ \underline{9} - 14 & = & -5 < 0 & 9 & + & 16 & = & 25 & \mathrm{F} \rightarrow \underline{\mathrm{E}} \end{array}$
\end{tabular}
\end{tabularx}
\]
\end{document}
