排版方程式,但导致 tabularx 出错

排版方程式,但导致 tabularx 出错

我正在使用 tabularx 如下,代码如下:

\documentclass{article}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{ragged2e}
\newcolumntype{L}{ >{\RaggedRight}X }
\usepackage{siunitx}
\usepackage{makecell}
\renewcommand\theadfont{\normalfont\bfseries}
\setlength\parindent{0pt}
\newcolumntype{Y}{ >{\Centering}X}
\usepackage[justification=centering]{caption}
\setlength\parindent{0pt}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\newcolumntype{C}{>{\Centering\arraybackslash}X}
\renewcommand\theadfont{\normalfont\bfseries}
\newcommand\mc[1]{\multicolumn{2}{c}{#1}}
\setlength\parindent{0pt}
\usepackage{amsmath}
    \noindent 
\newcolumntype{Y}{ >{\Centering}X} 
\begin{tabularx}{\textwidth}{@{} lYY S[table-format=1.4] @{}}  

\toprule 

\thead[lc]{a}& \thead{$(0,0)$} & {\thead{$(\frac{2}{3},\frac{15k-10}{9k})$}} & {\thead{$(k,0)$}} \\

\midrule  

$0<k<\frac{2}{3}$ case with $k=\frac{1}{2}$ & Saddle Point at $(0,0)$ & Saddle Points at $(\frac{2}{3}$,$\frac{-5}{9})$ & Stable Node at $(\frac{1}{2},0)$ \\ \addlinespace

$k = \frac{2}{3}$ & Saddle Point at $(0,0)$ & 0.72 & 0.72 \\ \addlinespace  

$\frac{2}{3} < k < \frac{7}{3}$ case with $k = 1$ & 0 & 0.37 & 1.00 \\ \addlinespace  

$k^{*}\approx 1.2667$ &a & a& a\\ \addlinespace

$k^{*} < k < \frac{7}{3} \text{ with } k = 2$ &a &a &a \\ \addlinespace

$k = \frac{7}{3]$ &a & a& a\\ \addlinespace

$k > \frac{7}{3}$ with $k=3$ &a &a &a \\ \addlinespace

\bottomrule  

\end{tabularx}
\end{document}

我不太清楚为什么我会收到一条错误消息,提示“紧急”,并且 latex 不允许我编译此代码。错误如下:“扫描 \TX@get@body 的使用时文件已结束。<*> newfile1.tex”

***(作业中止,未找到合法的 \end)

有人可以帮帮我吗?

谢谢。

答案1

您已经\frac{7}{3]在倒数第二行了。

如何调试此问题?注释所有表行,然后逐行取消注释,直到找到产生错误的行。

但是,当您解决该问题时,您会发现第二行的第四个单元格包含不适合列的材料S,但这取决于您决定如何处理。

注意:输入

$(\frac{2}{3}$,$\frac{-5}{9})$

应该

$(\frac{2}{3},\frac{-5}{9})$

$k^{*} < k < \frac{7}{3} \text{ with } k = 2$

应该

$k^{*} < k < \frac{7}{3}$ with $k = 2$

相关内容