Graphics, Figures & TablesProblem with equation in table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mexxwel
Posts: 1
Joined: Mon Nov 16, 2015 10:54 am

Problem with equation in table

Post by mexxwel »

Hey there!

I'd like to create a table with two parameters and the corresponding equation.
Somehow Latex gives me the error: '! Missing $ inserted.' and I don't know what that means...

Code: Select all

Code, edit and compile here:
\begin{table}[H]
\centering
\caption{XXX}
\label{tab:XXX}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{c c}
\hline\hline
\vspace{0.25cm}
Parameter & Mathematical Equation \\ \hline
\vspace{0.25cm}
Standard Deviation & \sigma=\sqrt{\frac{\sum(X-\mu)$^2$}{N}} \\
\vspace{0.25cm}
Variance & \sigma^2=\frac{\sum(X-\mu)$^2$}}{N} \\
\\ \hline
\end{tabular}
\end{adjustbox}
\end{table}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Thanks for your help!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Problem with equation in table

Post by Johannes_B »

Welcome,

you put only the superscript in mathmode, but the whole equation needs to be in mathmode. Below, an example that sets the second column in math mode as a whole.

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage{array}
\setlength{\defaultaddspace}{.75em}
\begin{document}
\begin{tabular}{c >{$\displaystyle}c<{$}}
\toprule
Parameter & $Mathematical Equation$ \\
\midrule
Standard Deviation & \sigma=\sqrt{\frac{\sum(X-\mu)^2}{N}} \\\addlinespace
Variance & \sigma^2=\frac{\sum(X-\mu)^2}{N} \\
\bottomrule
\end{tabular}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply