如何获得足够的空间来存储分数?

如何获得足够的空间来存储分数?
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
& polarity & $\displaystyle \frac{\textrm{charge}}{\textrm{mass}}$\\
\hline
\textbf{A} & negative & $\displaystyle \frac{E}{g}$\\
\textbf{B} & negative & $\displaystyle \frac{g}{E}$\\
\textbf{C} & positive & $\displaystyle \frac{E}{g}$\\
\textbf{D} & positive & $\displaystyle \frac{g}{E}$\\
\hline
\end{tabular}
\end{center}

在此处输入图片描述

答案1

我建议使用以下组合:(a) 将的值\arraystretch从 1(默认值)增加到 2,(b) 在\frac第 1、3 和 5 行表达式的分母项中插入“支柱”。(在这些行中,分母中的字母不包含降部。)如果不插入支柱,则需要增加的值\arraystretch

另外,在标题单元格中,请使用\textnormal而不是来\textrm表示分数项。

在此处输入图片描述

\documentclass{article}
\usepackage{array} % for "\newcolumntype" macro
\newcolumntype{C}{>{$\displaystyle}c<{$}}
\newcommand\myfrac[2]{\frac{#1}{#2\mathstrut}}
\begin{document}

\begin{center}
\renewcommand\arraystretch{2}
\begin{tabular}{|c|c|C|}
\hline
& polarity & \myfrac{\textnormal{charge}}{\textnormal{mass}}\\
\hline
\textbf{A} & negative & \frac{E}{g}  \\
\textbf{B} & negative & \myfrac{g}{E}  \\
\textbf{C} & positive & \frac{E}{g}  \\
\textbf{D} & positive & \myfrac{g}{E} \\
\hline
\end{tabular}
\end{center}

\end{document}

相关内容