![多列相互包裹](https://linux22.com/image/379954/%E5%A4%9A%E5%88%97%E7%9B%B8%E4%BA%92%E5%8C%85%E8%A3%B9.png)
\documentclass[usenames,dvipsnames]{beamer}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{listings}
\usepackage{dcolumn}
\usepackage{algpseudocode}
\usefonttheme[onlymath]{serif}
\usepackage{amsmath}
\usetheme{Madrid}
\newcolumntype{2}{D{.}{}{2.0}}
\begin{document}
\begin{frame}
\frametitle{Modular Arithmetic operations}
\begin{exampleblock}{To find \[11^{11} \mod 13\] we can procceed as follows}
\begin{equation}
\begin{aligned}
%& 11^2 = 121 = 4(\mod 13)\\
% & 11^4 = (11^2)^2 = 4^2 = 3 (\mod 13)\\
%& 11^7 = 11\times 4\times3 = 132=2(\mod 13)
& 11^2=121\equiv 4\ (\mod 13)\\
& 11^4 = (11^2)^2 \equiv 4^2 \equiv 3\ (\mod 13)\\
& 11^7 = 11 \times 4\times 3\equiv 132\equiv 2\ (\mod 13)\\
\end{aligned}
\end{equation}
\end{exampleblock}
\renewcommand\arraystretch{1.3}
\setlength\doublerulesep{0pt}
\begin{columns}
\footnotesize
\begin{column}{0.4\linewidth}
\begin{tabular}{r||*{8}{2|}}
+ & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\
\hline\hline
\hline
0 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\
\hline
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 0\\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 0 & 1\\
\hline
2 & 3 & 4 & 5 & 6 & 7 & 0 & 1 & 2\\
\hline
3 & 4 & 5 & 6 & 7 & 0 & 1 & 2 & 3\\
\hline
4 & 5 & 6 & 7 & 0 & 1 & 2 & 3 & 4\\
\hline
5 & 6 & 7 & 0 & 1 & 2 & 3 & 4 & 5\\
\hline
6 & 6 & 7 & 0 & 1 & 2 & 3 & 4 & 5\\
\hline
7 & 7 & 0 & 1 & 2 & 3 & 4 & 5 & 6\\
\end{tabular}
\end{column}
\begin{column}{0.4\linewidth}
\begin{tabular}{r||*{8}{2|}}
x & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\
\hline\hline
\hline
0 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\
\hline
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 0\\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 0 & 1\\
\hline
2 & 3 & 4 & 5 & 6 & 7 & 0 & 1 & 2\\
\hline
3 & 4 & 5 & 6 & 7 & 0 & 1 & 2 & 3\\
\hline
4 & 5 & 6 & 7 & 0 & 1 & 2 & 3 & 4\\
\hline
5 & 6 & 7 & 0 & 1 & 2 & 3 & 4 & 5\\
\hline
6 & 6 & 7 & 0 & 1 & 2 & 3 & 4 & 5\\
\hline
7 & 7 & 0 & 1 & 2 & 3 & 4 & 5 & 6\\
\end{tabular}
\end{column}
\end{columns}
\end{frame}
\end{document}
我想将示例标题行放在一行或两行中。并在两个表格之间留出空隙。
我找到了表格解决方案加法和乘法表
答案1
您可以调整列宽和 的值\tabcolsep
。至于示例标题,只需使用内联数学即可:
\documentclass[usenames,dvipsnames]{beamer}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{listings}
\usepackage{dcolumn}
\usepackage{algpseudocode}
\usefonttheme[onlymath]{serif}
\usepackage{amsmath}
\usetheme{Madrid}
\newcolumntype{2}{D{.}{}{2.0}}
\begin{document}
\begin{frame}
\frametitle{Modular Arithmetic operations}
\begin{exampleblock}{To find $\:11^{11} \mod 13$, we can proceed as follows}
\begin{equation}
\begin{aligned}
%& 11^2 = 121 = 4(\mod 13)\\
% & 11^4 = (11^2)^2 = 4^2 = 3 \pmod 13\\
%& 11^7 = 11\times 4\times3 = 132=2(\mod 13)
11^2 & =121\equiv 4 \pmod{13} \\
11^4 & = (11^2)^2 \equiv 4^2 \equiv 3 \pmod{13} \\
11^7 & = 11 \times 4\times 3\equiv 132\equiv 2 \pmod{13} \\
\end{aligned}
\end{equation}
\end{exampleblock}
\renewcommand\arraystretch{1.3}
\setlength\doublerulesep{0pt}
\begin{columns}
\footnotesize
\setlength{\tabcolsep}{3.5pt}
\renewcommand{\arraystretch}{1.1}
\noindent
\begin{column}{0.45\linewidth}
\begin{tabular}{r||*{8}{2|}}
+ & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\
\hline\hline
\hline
0 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\
\hline
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 0\\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 0 & 1\\
\hline
2 & 3 & 4 & 5 & 6 & 7 & 0 & 1 & 2\\
\hline
3 & 4 & 5 & 6 & 7 & 0 & 1 & 2 & 3\\
\hline
4 & 5 & 6 & 7 & 0 & 1 & 2 & 3 & 4\\
\hline
5 & 6 & 7 & 0 & 1 & 2 & 3 & 4 & 5\\
\hline
6 & 6 & 7 & 0 & 1 & 2 & 3 & 4 & 5\\
\hline
7 & 7 & 0 & 1 & 2 & 3 & 4 & 5 & 6\\
\end{tabular}
\end{column}
%
\begin{column}{0.45\linewidth}
\begin{tabular}{r||*{8}{2|}}
x & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\
\hline\hline
\hline
0 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\
\hline
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 0\\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 0 & 1\\
\hline
2 & 3 & 4 & 5 & 6 & 7 & 0 & 1 & 2\\
\hline
3 & 4 & 5 & 6 & 7 & 0 & 1 & 2 & 3\\
\hline
4 & 5 & 6 & 7 & 0 & 1 & 2 & 3 & 4\\
\hline
5 & 6 & 7 & 0 & 1 & 2 & 3 & 4 & 5\\
\hline
6 & 6 & 7 & 0 & 1 & 2 & 3 & 4 & 5\\
\hline
7 & 7 & 0 & 1 & 2 & 3 & 4 & 5 & 6\\
\end{tabular}
\end{column}
\end{columns}
\end{frame}
\end{document}