如何在 latex beamer 中插入下表?

如何在 latex beamer 中插入下表?
\documentclass[10.5pt,xcolor=dvipsnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{ragged2e}
\usepackage{etoolbox}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage{pdflscape}
\usepackage{amsmath,amsthm,amsfonts,mathrsfs,amssymb}
\usepackage{amssymb,latexsym,pstricks,pst-grad}
\usepackage{enumerate}
\usepackage{array}
\usepackage{multirow}
\usepackage{rotating}
\usepackage{longtable}
\usepackage{pdflscape}
\usepackage[english]{babel}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{colortbl}
\usepackage{array, makecell}
\usepackage{siunitx}
\usepackage{caption}
\usepackage{float}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{fontenc}
\usepackage{multicol}
\apptocmd{\frame}{}{\justifying}{} % Allow optional arguments after frame.
\definecolor{mygray}{gray}{0.6}
\usetheme{focus}
%\usecolortheme{r}
\fontfamily{times new roman}
\justifying
\begin{document}
        \begin{frame}
    \begin{center}
        \begin{equation*}
            (\tilde{d}_{ij})_{m\times n}=
            \begin{table}
            \begin{tabular}{ccccc}
    \hline\\
    &C_1&C_2&\dots&C_n\\
    \hline\\
    A_1& \tilde{d}_{11} & \tilde{d}_{12} &\dots& \tilde{d}_{1n}\\
    A_2& \tilde{d}_{21} & \tilde{d}_{22} &\dots& \tilde{d}_{2n}\\
    \vdots&\vdots&\vdots&\vdots&\vdots\\
        A_m& \tilde{d}_{t1} & \tilde{d}_{t2} &\dots& \tilde{d}_{mn}\\
    \hline
\end{tabular}
            \end{table}
        \end{equation*}
    \end{center} 
    for $i=1,2,\dots,m$ and $j=1,2,\dots,n.$
\end{frame}
\end{document}

答案1

我怀疑你正在经历这样的事情:

在此处输入图片描述

\documentclass[xcolor={table,dvipsnames}]{beamer}
\usepackage{blkarray}

\usepackage{makecell}

\begin{document}
\begin{frame}
    \[
    \renewcommand\arraystretch{1.2}
\Bigl[\tilde{d}_{ij}\Bigr]_{m\times n} = 
\begin{blockarray}{ccc cc}
    & C_1 & C_2 & \dots & C_n       \\
    \begin{block}{c[cc cc]}
A_1 & \tilde{d}_{11}    & \tilde{d}_{12}    & \dots     & \tilde{d}_{1n}    \\
A_2 & \tilde{d}_{21}    & \tilde{d}_{22}    & \dots     & \tilde{d}_{2n}    \\
\vdots
    & \vdots            & \vdots            & \vdots    & \vdots            \\
A_m & \tilde{d}_{t1}    & \tilde{d}_{t2}    & \dots     & \tilde{d}_{mn}    \\
    \end{block}
\end{blockarray}
    \quad\text{for}\quad \makecell[l]{i=1,2,\dots,m \\
                                   j=1,2,\dots,n \;.}
    \]
\end{frame}
\end{document}

编辑: 您的文档示例有几个严重缺陷:

  • 方程不需要在center环境内
  • 浮动环境table不必插入方程中

上面的 MWE 更正了这些错误。还从您的文档中创建了 MWE(最小工作示例),其中文档的序言仅缩减为必要的包。

关于你的序言:这可能是重大的清理工作。例如:

\documentclass[xcolor={table,dvipsnames}]{beamer}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{lmodern}
\usepackage{pdflscape}

% math
\usepackage{blkarray}
\usepackage{mathtools,  % if you really need it, amsmath is loaded by beamer
            amssymb,amsthm,amsfonts}
% tables
\usepackage{rotating}
\usepackage{ragged2e}
\usepackage{booktabs, longtable, makecell, multirow, tabularx}
% drawings
\usepackage{pstricks,pst-grad}
% units
\usepackage{siunitx}

\usepackage{etoolbox}

相关内容