我正在尝试创建一个包含一些方程式的表格,但没有成功。我使用以下代码:
\begin{center}
\begin{tabular}{ m{8em} | m{7cm}}
\hline
Index & Formula \\
\hline
Burn Area Index (BAI) &\[\frac{1}{(0.1 - Red)\textsuperscript{2} + (0.06 - NIR)\textsuperscript{2}}\]\\
Difference Vegetation Index (dvi)&NIR - Red\\
Enhanced Vegetation Index (EVI)&2.5\times\[\frac{NIR - Red}{(NIR + 6\times Red - 7.5\times Blue + 1)}\]\\
Normalised Difference Vegetation Index (NDVI)&\textrm{NDVI}=\[\frac{NIR - Red}{(NIR + Red}\]\\
Leaf Area Index (LAI)&3.618\times EVI - 0.118\\
Normalised Burn Ration (NBR)&\[\frac{(NIR - SWIR)}{(NIR + SWIR)}\]\\
Difference Normalised Burn Ration (DNBR)& (Pre-fire NBR) - (Post- fire NBR) \\
Normalised Difference Water Index (NDWI)&[\frac{($\rho_857$ - $\rho_1241$)}{($\rho_857$ - $\rho_1241$)}\] \\
\hline
\end{tabular}
\end{center}
如果我仅在文本中使用分数,则不会遇到任何问题(例如\[\frac{(NIR - SWIR)}{(NIR + SWIR)}\]
),并且我在这里看不到问题。
有任何想法吗?
答案1
我不会对第二列中的每个公式应用显示样式的数学模式,而是重新定义列类型,以便其内容自动被视为数学模式材料。在下面的代码中,我使用c
右侧列的列类型,因为换行似乎不是一个好主意。
\documentclass{article}
\usepackage{array,ragged2e,booktabs}
%% Define a new column type, for centered automatic displaystyle math mode material
\newcolumntype{C}{>{$\displaystyle}c<{$}}
\begin{document}
\begin{center}
\begin{tabular}{@{}
>{\RaggedRight}m{8em}
C % <-- note use of "C" column type
@{}}
\toprule
Index & \multicolumn{1}{c}{Formula} \\
\midrule
Burn Area Index (BAI)
& \frac{1}{(0.1-\mathrm{Red})^2 + (0.06-\mathrm{NIR})^2} \\
\addlinespace
Difference Vegetation Index (dvi)
&\mathrm{NIR} - \mathrm{Red}\\
\addlinespace
Enhanced Vegetation Index (EVI)
&2.5\times\frac{\mathrm{NIR} - \mathrm{Red}}{%
(\mathrm{NIR} + 6\times \mathrm{Red}
- 7.5\times \mathrm{Blue} + 1)}\\
\addlinespace
Normalised Difference Vegetation Index (NDVI)
&\textrm{NDVI}=\frac{\mathrm{NIR} - \mathrm{Red}}{%
\mathrm{NIR} + \mathrm{Red}}\\
\addlinespace
Leaf Area Index (LAI)
&3.618\times \mathrm{EVI} - 0.118\\
\addlinespace
Normalised Burn Ration (NBR)
&\frac{\mathrm{NIR} - \mathrm{SWIR}}{%
\mathrm{NIR} + \mathrm{SWIR}}\\
\addlinespace
Difference Normalised Burn Ration (DNBR)
& (\textrm{Pre-fire NBR}) - (\textrm{Post-fire NBR}) \\
\addlinespace
Normalised Difference Water Index (NDWI)
&\frac{\rho_{857} - \rho_{1241}}{\rho_{857} - \rho_{1241}} \\
\bottomrule
\end{tabular}
\end{center}
\end{document}