I was trying to create a table, and I'm having these two following errors:
"! Missing { inserted.
<to be read again>
^
l.149 ... $n_J\cdot x_i$ & $v_j=x_j-\overline{x^'}
$ & $v^2_j$ & $n_jv^2_j$ \..."
Here's the corresponding code:
\documentclass{article} %%% use \documentstyle for old LaTeX compilers
\usepackage[english]{babel} %%% 'french', 'german', 'spanish', 'danish', etc.
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{txfonts}
\usepackage{mathdots}
\usepackage[classicReIm]{kpfonts}
\usepackage[dvips]{graphicx} %%% use 'pdftex' instead of 'dvips' for PDF output
% You can include more LaTeX packages here
\begin{document}
%\selectlanguage{english} %%% remove comment delimiter ('%') and select language if required
\begin{tabular}{|p{0.6in}|p{0.6in}|p{0.6in}|p{0.6in}|p{0.6in}|p{0.6in}|p{0.6in}|} \hline
\multicolumn{3}{|p{1in}|}{Messungen} & \multicolumn{4}{|p{2.4in}|}{Berechnungen} \\ \hline
$x_j$ & $h_j\ (mm$)\newline & $n_j$ & $n_jx_j$ & $v_j=x_j-\overline{x^'}$ & $v^2_j$ & $n_jv^2_j$ \\ \hline
-6 & 7 & 39 & -234 & -5,9 & 34,81 & 1357,59 \\ \hline
-5 & 12 & 66 & -330 & -4,9 & 24,01 & 1584,66 \\ \hline
-4 & 14 & 77 & -308 & -3,9 & 15,21 & 1171,17 \\ \hline
-3 & 24 & 133 & -399 & -2,9 & 8,41 & 1118,53 \\ \hline
-2 & 34 & 188 & -376 & -1,9 & 3,61 & 678,68 \\ \hline
-1 & 43 & 238 & -238 & -0,9 & 0,81 & 192,78 \\ \hline
0 & 42 & 233 & 0 & 0,1 & 0,01 & 2,33 \\ \hline
1 & 36 & 200 & 200 & 1,1 & 1,21 & 242 \\ \hline
2 & 32 & 177 & 354 & 2,1 & 4,41 & 780,57 \\ \hline
3 & 23 & 127 & 381 & 3,1 & 9,61 & 1120,47 \\ \hline
4 & 13 & 72 & 288 & 4,1 & 16,81 & 1210,32 \\ \hline
5 & 8 & 44 & 220 & 5,1 & 26,01 & 1144,44 \\ \hline
6 & 10 & 35 & 210 & 6,1 & 37,21 & 302,35 \\ \hline
\end{tabular}
\end{document}
\overline{x^'}
by\overline{x'}
. The prime is automatically a superscript, so if you add another^
this essentially leads to^^
, which throws an error.^'
by$\vphantom{\dfrac{!}{!}}x_j$ & $h_j$ (mm)\newline & $n_j$ & $n_jx_j$ & $v_j=x_j-\overline{x'}$ & $v^2_j$ & $n_jv^2_j$ \\[-0.6em] \hline
.\documentclass{article} %%% use \documentstyle for old LaTeX compilers
"old" here means from before 1993, latex209 hasn't been included in standard distributions for decades... none of the\usepackage
would work for latex2.09 either.\usepackage[dvips]{graphicx} %%% use 'pdftex' instead of 'dvips' for PDF output
it would be much better to not use[dvips]
or[pdftex]
and let the system pick the correct option automatically.txfonts
and thekpfonts
package. Load one or the other, but not both.