首先,我完全意识到我的代码可能不是实现我想要做的事情的理想方式。但是我不是专业的 LaTeX 用户,这就是我想出来的方式。
我做了一个最小的例子,希望在编译时可以工作(编译器:LuaLaTeX)来显示我的问题。我正在尝试使用 tabularx-table 制作一个 beamer-frame,它一方面包含内联逐字环境,另一方面包含方程式环境。“Y”列类型是 tabularx 的“X”环境的修改形式,我在另一个 Stackoverflow 线程上找到了它。
现在的确切问题如下:我希望逐字表达式与方程表达式对齐,或者至少在每个单元格中垂直居中。
如前所述,我远非专家,我已经用尽了我所有的想法,所以我非常感谢任何形式的想法和建议。:)
\documentclass[c, 10pt]{beamer}
\usepackage{polyglossia}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage{tabularx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage{placeins}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{verbatim}
\usepackage{fancyvrb}
\usepackage{nicefrac}
\usepackage{array}
\setdefaultlanguage{english}
\usetheme{JuanLesPins}
\usecolortheme{seahorse}
\newcolumntype{Y}{>{\centering\arraybackslash} X}
\begin{document}
\begin{frame}[fragile, allowframebreaks]{Symbols and Commands}
\begin{block}{\centering \large{Division}}
\begin{table}[h]
\centering
\renewcommand\baselinestretch{0.01}\selectfont
\begin{tabularx}{\textwidth}{Y Y Y}
\toprule
\multicolumn{1}{m{.3\textwidth}}{\centering Code} & \multicolumn{2}{m{.6\textwidth}}{\centering Examples}\\
\midrule
\verb|\dfrac{a}{b}| &
{\begin{equation*}
\dfrac{a}{b}
\end{equation*}} &
{\begin{equation*}
\mathrm{e}^{\dfrac{1}{k_BT}}
\end{equation*}} \\
\verb|\frac{a}{b}| &
{\begin{equation*}
\frac{a}{b}
\end{equation*}} &
{\begin{equation*}
\mathrm{e}^{\frac{1}{k_BT}}
\end{equation*}} \\
\verb|\nicefrac{a}{b}| &
{\begin{equation*}
\nicefrac{a}{b}
\end{equation*}} &
{\begin{equation*}
\mathrm{e}^{\nicefrac{1}{k_BT}}
\end{equation*}} \\
\bottomrule
\end{tabularx}
\end{table}
\end{block}
\end{frame}
\end{document}