![在表格线和矩阵重叠中](https://linux22.com/image/346448/%E5%9C%A8%E8%A1%A8%E6%A0%BC%E7%BA%BF%E5%92%8C%E7%9F%A9%E9%98%B5%E9%87%8D%E5%8F%A0%E4%B8%AD.png)
我在表格中写入矩阵,但它离线太近了。打印出来时看起来很糟糕。
\documentclass[12pt]{beamer}
\usefonttheme{professionalfonts}
\usepackage{siunitx}
\usepackage{newtxtext,newtxmath}
\usepackage{bm}
\mode<presentation>{\usefonttheme{professionalfonts}}
\usepackage[turkish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage[loadonly]{enumitem}
\usepackage{enumitem}
\makeatletter%matris boyu
\renewcommand*\env@matrix[1][\arraystretch]{%
\edef\arraystretch{#1}%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{*\c@MaxMatrixCols c}}
\makeatother
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\begin{document}
\begin{tabular}{ | c | c | c |}
\hline
Örnek1.2a: & Örnek 1.2b: & Örnek1.2c \\
Tek çözüm & Çözümsüz & Sonsuz çözümlü \\ \hline
$D_{A,b}=\begin{bmatrix}
4&3&5\\
10&6&4\\
2&4&7\\
2&5&8
\end{bmatrix}$ & $D_{A,b}=\begin{bmatrix}
4&3&5\\
12&8&6\\
2&4&7\\
0&3&6
\end{bmatrix}$ & $D_{A,b}=\begin{bmatrix}
6&5&7\\
13&9&7\\
2&4&7\\
1&4&7
\end{bmatrix}$ \\ \hline
$R_{A,b}=\begin{bmatrix}
0&1&0\\
0&0&1\\
1&0&0\\
1&0&0
\end{bmatrix}$ & $R_{A,b}=\begin{bmatrix}
0&1&1\\
0&0&0\\
0&0&0\\
1&1&0
\end{bmatrix}$ & $R_{A,b}=\begin{bmatrix}
0&0&1\\
0&0&1\\
0&1&1\\
1&1&1
\end{bmatrix}$ \\ \hline
\end{tabular}
\end{document}
答案1
像这样?
它是通过makecell
宏包\setcellgapes{3pt}
和\makegapedcells
\documentclass[12pt]{beamer}
\usefonttheme{professionalfonts}
\usepackage{siunitx}
\usepackage{newtxtext,newtxmath,bm}
\mode<presentation>{\usefonttheme{professionalfonts}}
%\usepackage[turkish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{makecell}
\setcellgapes{3pt}
\usepackage{tikz}
%\usepackage[loadonly]{enumitem}
%\usepackage{enumitem}
\makeatletter%matris boyu
\renewcommand*\env@matrix[1][\arraystretch]{%
\edef\arraystretch{#1}%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{*\c@MaxMatrixCols c}}
\makeatother
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\begin{document}
\begin{frame}
\makegapedcells
\begin{tabular}{ | c | c | c |}
\hline
Örnek1.2a: & Örnek 1.2b: & Örnek1.2c \\
Tek çözüm & Çözümsüz & Sonsuz çözümlü \\ \hline
$D_{A,b}=\begin{bmatrix}
4&3&5\\
10&6&4\\
2&4&7\\
2&5&8
\end{bmatrix}$ & $D_{A,b}=\begin{bmatrix}
4&3&5\\
12&8&6\\
2&4&7\\
0&3&6
\end{bmatrix}$ & $D_{A,b}=\begin{bmatrix}
6&5&7\\
13&9&7\\
2&4&7\\
1&4&7
\end{bmatrix}$ \\ \hline
$R_{A,b}=\begin{bmatrix}
0&1&0\\
0&0&1\\
1&0&0\\
1&0&0
\end{bmatrix}$ & $R_{A,b}=\begin{bmatrix}
0&1&1\\
0&0&0\\
0&0&0\\
1&1&0
\end{bmatrix}$ & $R_{A,b}=\begin{bmatrix}
0&0&1\\
0&0&1\\
0&1&1\\
1&1&1
\end{bmatrix}$ \\ \hline
\end{tabular}
\end{frame}
\end{document}
答案2
使用{NiceTabular}
和nicematrix
其键cell-space-limits
。
\documentclass[12pt]{beamer}
\usefonttheme{professionalfonts}
\usepackage{siunitx}
\usepackage{newtxtext,newtxmath,bm}
\mode<presentation>{\usefonttheme{professionalfonts}}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{tikz}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\usepackage{nicematrix}
\begin{document}
\begin{frame}
\begin{NiceTabular}{|c|c|c|}[cell-space-limits=4pt]
\hline
Örnek1.2a: & Örnek 1.2b: & Örnek1.2c \\
Tek çözüm & Çözümsüz & Sonsuz çözümlü \\ \hline
$D_{A,b}=\begin{bmatrix}
4&3&5\\
10&6&4\\
2&4&7\\
2&5&8
\end{bmatrix}$ & $D_{A,b}=\begin{bmatrix}
4&3&5\\
12&8&6\\
2&4&7\\
0&3&6
\end{bmatrix}$ & $D_{A,b}=\begin{bmatrix}
6&5&7\\
13&9&7\\
2&4&7\\
1&4&7
\end{bmatrix}$ \\ \hline
$R_{A,b}=\begin{bmatrix}
0&1&0\\
0&0&1\\
1&0&0\\
1&0&0
\end{bmatrix}$ & $R_{A,b}=\begin{bmatrix}
0&1&1\\
0&0&0\\
0&0&0\\
1&1&0
\end{bmatrix}$ & $R_{A,b}=\begin{bmatrix}
0&0&1\\
0&0&1\\
0&1&1\\
1&1&1
\end{bmatrix}$ \\ \hline
\end{NiceTabular}
\end{frame}
\end{document}
您需要多次编译(因为nicematrix
在后台使用 PGF/Tikz 节点)。
答案3
还有一种可能性(由于原始答案已经被接受,因此答案是分开的),即带有密钥的tblr
(新)tabularray
包colsep
:rowsep
\documentclass[12pt]{beamer}
\usefonttheme{professionalfonts}
\usepackage{newtxtext, newtxmath, bm}
\mode<presentation>{\usefonttheme{professionalfonts}}
\usepackage[turkish]{babel}
\usepackage[T1]{fontenc}
\usepackage{tabularray}
\begin{document}
\begin{frame}
\frametitle{Solution by use of the \texttt{tabularray} package}
\centering
\begin{tblr}{hlines, vlines,
cells={c},
colsep=4pt, rowsep=3pt
}
{Örnek1.2a:\\ Tek çözüm}
& {Örnek 1.2b:\\ Çözümsüz}
& {Örnek1.2c\\ Sonsuz çözümlü} \\
$D_{A,b}=\begin{bmatrix}
4&3&5\\
10&6&4\\
2&4&7\\
2&5&8
\end{bmatrix}$
& $D_{A,b}=\begin{bmatrix}
4&3&5\\
12&8&6\\
2&4&7\\
0&3&6
\end{bmatrix}$
& $D_{A,b}=\begin{bmatrix}
6&5&7\\
13&9&7\\
2&4&7\\
1&4&7
\end{bmatrix}$ \\
$R_{A,b}=\begin{bmatrix}
0&1&0\\
0&0&1\\
1&0&0\\
1&0&0
\end{bmatrix}$
& $R_{A,b}=\begin{bmatrix}
0&1&1\\
0&0&0\\
0&0&0\\
1&1&0
\end{bmatrix}$
& $R_{A,b}=\begin{bmatrix}
0&0&1\\
0&0&1\\
0&1&1\\
1&1&1
\end{bmatrix}$ \\
\end{tblr}
\end{frame}
\end{document}