我在 Overleaf 中同时收到 7 个错误,这些错误来自同一件事,编译器将其描述为:
Missing $ inserted.
Extra }, or forgotten $.
Missing } inserted.
我是 LaTeX 的新手,我知道这个错误很常见,但我无法解决它。我已能够将错误来源缩小到下表中:
\begin{table}[H]
\resizebox{\textwidth}{!}{$
\begin{array}{cc|ccc}
\toprule
T \; (\pm 0.1 ^\circ C) &
\Delta t \; (\pm 0.25s) &
\eta \; (g \cdot cm^{-1} \cdot s^{-1}) &
\eta_{Laden} \; (g \cdot cm^{-1} \cdot s^{-1}) &
\eta_{Fax} \; (g \cdot cm^{-1} \cdot s^{-1}) \\
\midrule
\multirow{5}{*}{27.6 \pm 1.2} & 14.48 & 8.1 \pm \, 1.4 & 7.7 \pm \, 1.3 & 7.7 \pm \, 1.3 \\
& 14.50 & 8.1 \pm \, 1.4 & 7.7 \pm \, 1.3 & 7.7 \pm \, 1.3 \\
& 13.44 & 7.5 \pm \, 1.3 & 7.1 \pm \, 1.2 & 7.2 \pm \, 1.2 \\
& 13.33 & 7.5 \pm \, 1.2 & 7.1 \pm \, 1.2 & 7.1 \pm \, 1.2 \\
& 14.29 & 8.0 \pm \, 1.3 & 7.6 \pm \, 1.3 & 7.6 \pm \, 1.3 \\
& & & & \\
\multirow{5}{*}{38.1 \pm 1.4} & 7.16 & 4.0 \pm \, 0.7 & 3.8 \pm \, 0.6 & 3.8 \pm \, 0.7 \\
& 7.00 & 3.9 \pm \, 0.7 & 3.7 \pm \, 0.6 & 3.7 \pm \, 0.6 \\
& 7.39 & 4.1 \pm \, 0.7 & 3.9 \pm \, 0.7 & 3.9 \pm \, 0.7 \\
& 7.93 & 4.4 \pm \, 0.8 & 4.2 \pm \, 0.7 & 4.2 \pm \, 0.7 \\
& 7.72 & 4.3 \pm \, 0.7 & 4.1 \pm \, 0.7 & 4.1 \pm \, 0.7 \\
& & & & \\
\multirow{5}{*}{48.25 \pm 1.25} & 4.48 & 2.5 \pm \, 0.4 & 2.4 \pm \, 0.4 & 2.4 \pm \, 0.4 \\
& 4.59 & 2.6 \pm \, 0.5 & 2.4 \pm \, 0.4 & 2.4 \pm \, 0.4 \\
& 4.26 & 2.4 \pm \, 0.4 & 2.3 \pm \, 0.4 & 2.3 \pm \, 0.4 \\
& 4.20 & 2.4 \pm \, 0.4 & 2.2 \pm \, 0.4 & 2.2 \pm \, 0.4 \\
& 4.24 & 2.4 \pm \, 0.4 & 2.3 \pm \, 0.4 & 2.3 \pm \, 0.4 \\
& & & & \\
\multirow{5}{*}{53.25 \pm 1.25} & 3.38 & 1.9 \pm \, 0.3 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 \\
& 3.32 & 1.9 \pm \, 0.3 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 \\
& 3.44 & 1.9 \pm \, 0.4 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 \\
& 3.30 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 \\
& 3.36 & 1.9 \pm \, 0.3 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 \\
\bottomrule
\end{array}
$}
\caption{\eta vs T}
\end{table}
我使用的软件包如下:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english, main=spanish]{babel}
\usepackage{graphicx}
\usepackage[margin=1.5in,footskip=0.25in]{geometry}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{float}
\restylefloat{table}
\usepackage{array}
\usepackage[sorting=none]{biblatex}
\usepackage{csquotes}
\addbibresource{references.bib}
答案1
两个问题:
数学的使用
\caption
需要$
分隔符。数学的使用
\multirow
需要$
分隔符。
我还擅自设置Fax
了Laden
\mathrm
妇女权利委员会:
\documentclass{article}
%\usepackage[utf8]{inputenc}
%\usepackage[english, main=spanish]{babel}
\usepackage{graphicx}
\usepackage[margin=1.5in,footskip=0.25in]{geometry}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{float}
%\restylefloat{table}
\usepackage{array}
%\usepackage[sorting=none]{biblatex}
%\usepackage{csquotes}
%\addbibresource{references.bib}
\begin{document}
\begin{table}[H]
\resizebox{\textwidth}{!}{$
\begin{array}{cc|ccc}
\toprule
T \; (\pm 0.1 ^\circ C) &
\Delta t \; (\pm 0.25s) &
\eta \; (g \cdot cm^{-1} \cdot s^{-1}) &
\eta_{\mathrm{Laden}} \; (g \cdot cm^{-1} \cdot s^{-1}) &
\eta_{\mathrm{Fax}} \; (g \cdot cm^{-1} \cdot s^{-1}) \\
\midrule
\multirow{5}{*}{$27.6 \pm 1.2$} & 14.48 & 8.1 \pm \, 1.4 & 7.7 \pm \, 1.3 & 7.7 \pm \, 1.3 \\
& 14.50 & 8.1 \pm \, 1.4 & 7.7 \pm \, 1.3 & 7.7 \pm \, 1.3 \\
& 13.44 & 7.5 \pm \, 1.3 & 7.1 \pm \, 1.2 & 7.2 \pm \, 1.2 \\
& 13.33 & 7.5 \pm \, 1.2 & 7.1 \pm \, 1.2 & 7.1 \pm \, 1.2 \\
& 14.29 & 8.0 \pm \, 1.3 & 7.6 \pm \, 1.3 & 7.6 \pm \, 1.3 \\
& & & & \\
\multirow{5}{*}{$38.1 \pm 1.4$} & 7.16 & 4.0 \pm \, 0.7 & 3.8 \pm \, 0.6 & 3.8 \pm \, 0.7 \\
& 7.00 & 3.9 \pm \, 0.7 & 3.7 \pm \, 0.6 & 3.7 \pm \, 0.6 \\
& 7.39 & 4.1 \pm \, 0.7 & 3.9 \pm \, 0.7 & 3.9 \pm \, 0.7 \\
& 7.93 & 4.4 \pm \, 0.8 & 4.2 \pm \, 0.7 & 4.2 \pm \, 0.7 \\
& 7.72 & 4.3 \pm \, 0.7 & 4.1 \pm \, 0.7 & 4.1 \pm \, 0.7 \\
& & & & \\
\multirow{5}{*}{$48.25 \pm 1.25$} & 4.48 & 2.5 \pm \, 0.4 & 2.4 \pm \, 0.4 & 2.4 \pm \, 0.4 \\
& 4.59 & 2.6 \pm \, 0.5 & 2.4 \pm \, 0.4 & 2.4 \pm \, 0.4 \\
& 4.26 & 2.4 \pm \, 0.4 & 2.3 \pm \, 0.4 & 2.3 \pm \, 0.4 \\
& 4.20 & 2.4 \pm \, 0.4 & 2.2 \pm \, 0.4 & 2.2 \pm \, 0.4 \\
& 4.24 & 2.4 \pm \, 0.4 & 2.3 \pm \, 0.4 & 2.3 \pm \, 0.4 \\
& & & & \\
\multirow{5}{*}{$53.25 \pm 1.25$} & 3.38 & 1.9 \pm \, 0.3 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 \\
& 3.32 & 1.9 \pm \, 0.3 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 \\
& 3.44 & 1.9 \pm \, 0.4 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 \\
& 3.30 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 \\
& 3.36 & 1.9 \pm \, 0.3 & 1.8 \pm \, 0.3 & 1.8 \pm \, 0.3 \\
\bottomrule
\end{array}
$}
\caption{$\eta$ vs $T$}
\end{table}
\end{document}
答案2
除了前面的答案之外,这里还有一些使用该siunitx
包的改进:
\documentclass{article}
\usepackage[margin=1.5in,footskip=0.25in]{geometry}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{float}
\usepackage{siunitx}
\sisetup{inter-unit-product = \ensuremath{{}\cdot{}}, separate-uncertainty = true}
\begin{document}
\begin{table}[H]
\centering
\begin{tabular}{S[table-format=2.2(2)] S[table-format=2.2] *{3}{S[table-format=1.1(2)]}}
\toprule
{T} &
{$\Delta t$} &
{$\eta$} &
{$\eta_{\text{Laden}}$} &
{$\eta_{\text{Fax}}$} \\
{($\pm$ \SI{0.1}{\celsius})} &
{($\pm$ \SI{0.25}{\s})} &
{(\si{\g\per\cm\per\s})} &
{(\si{\g\per\cm\per\s})} &
{(\si{\g\per\cm\per\s})} \\
\midrule
& 14.48 & 8.1(14) & 7.7(13) & 7.7(13) \\
& 14.50 & 8.1(14) & 7.7(13) & 7.7(13) \\
27.6(12) & 13.44 & 7.5(13) & 7.1(12) & 7.2(12) \\
& 13.33 & 7.5(12) & 7.1(12) & 7.1(12) \\
& 14.29 & 8.0(13) & 7.6(13) & 7.6(13) \\
\addlinespace
& 7.16 & 4.0(07) & 3.8(06) & 3.8(07) \\
& 7.00 & 3.9(07) & 3.7(06) & 3.7(06) \\
38.1(14) & 7.39 & 4.1(07) & 3.9(07) & 3.9(07) \\
& 7.93 & 4.4(08) & 4.2(07) & 4.2(07) \\
& 7.72 & 4.3(07) & 4.1(07) & 4.1(07) \\
\addlinespace
& 4.48 & 2.5(04) & 2.4(04) & 2.4(04) \\
& 4.59 & 2.6(05) & 2.4(04) & 2.4(04) \\
48.25(125) & 4.26 & 2.4(04) & 2.3(04) & 2.3(04) \\
& 4.20 & 2.4(04) & 2.2(04) & 2.2(04) \\
& 4.24 & 2.4(04) & 2.3(04) & 2.3(04) \\
\addlinespace
& 3.38 & 1.9(03) & 1.8(03) & 1.8(03) \\
& 3.32 & 1.9(03) & 1.8(03) & 1.8(03) \\
53.25(125) & 3.44 & 1.9(04) & 1.8(03) & 1.8(03) \\
& 3.30 & 1.8(03) & 1.8(03) & 1.8(03) \\
& 3.36 & 1.9(03) & 1.8(03) & 1.8(03) \\
\bottomrule
\end{tabular}
\caption{$\eta$ vs $T$}
\end{table}
\end{document}