![表格中的前缀标记不合法](https://linux22.com/image/267087/%E8%A1%A8%E6%A0%BC%E4%B8%AD%E7%9A%84%E5%89%8D%E7%BC%80%E6%A0%87%E8%AE%B0%E4%B8%8D%E5%90%88%E6%B3%95.png)
tabular
我在构建环境并用 进行编译时遇到了麻烦pdflatex
。以下是我正在尝试执行的操作:
\documentclass{article}
\usepackage[pdftex]{graphicx}
\usepackage{caption,tabularx,booktabs}
\begin{document}
\begin{minipage}{\linewidth}
\centering
\captionof{table}{Left side FBD} \label{tab:title2}
\begin{tabular}{ C C }\toprule[1.5pt]
\bf X & \b
f Y \\\midrule
$0$ & $-F_g$\\
$F_t \sin \theta$ & $F_t \cos \theta$\\
$-F_e$ & $0$\\
\bottomrule[1.25pt]
$0$ & $0$\\
\end{tabular}
\end{minipage}
\end{document}
然而,我收到以下错误:
! Package array Error: Illegal pream-token (C): `c' used.
See the array package documentation for explanation.
Type H <return> for immediate help.
...
l.8 \begin{tabular}{ C C }
\toprule[1.5pt]
! Package array Error: Illegal pream-token (C): `c' used.
我尝试过给出每个C
参数,就像我在其他源代码中看到的那样(我仍然不确定该参数的具体用途),但还是收到另一条错误消息。当我用替换时,C
我C{.85in}
现在得到:
! Package array Error: Illegal pream-token (C): `c' used.
See the array package documentation for explanation.
Type H <return> for immediate help.
...
l.8 \begin{tabular}{ C{.85in} C{.85in} }
\toprule[1.5pt]
! Package array Error: Illegal pream-token (.85in): `c' used.
有人知道我做错了什么吗tabular
?提前谢谢!
答案1
这是固定的 MWE:
\documentclass{article}
\usepackage[pdftex]{graphicx}
\usepackage{caption,tabularx,booktabs}
\begin{document}
\begin{minipage}{\linewidth}
\centering
\captionof{table}{Left side FBD} \label{tab:title2}
\begin{tabular}{ c c }\toprule[1.5pt]
\bf X & \b
f Y \\\midrule
$0$ & $-F_g$\\
$F_t \sin \theta$ & $F_t \cos \theta$\\
$-F_e$ & $0$\\
\bottomrule[1.25pt]
$0$ & $0$\\
\end{tabular}
\end{minipage}
\end{document}
C 应替换为 c