Minipage in Latex failing to compile - latex

I want to put a table and figure above/below one another in my article tex file as they are related. Until now it has worked in this document but suddenly it isn't working and I can't compile in Overleaf. Please help.
\begin{document}
\begin{minipage}[b]{1\textwidth}
\centering
\captionof{table}{Best Case Scenario A IC values when synthesis, desiccation (and algae collection) have been excluded from the system.}
\label{tab:BestA_synthANDdesiccation_excluded}
\begin{tabular}{#{}llcc#{}}
\toprule
IC & Unit & Total (no collection) & Total (with collection) \\ \midrule
CC & kg CO2 eq & -1.1E+03 & -7.0E+02 \\
Ecotox & CTUe & 2.1E+02 & 1.4E+04 \\
HTnc & CTUh & 6.9E-08 & 1.4E-05 \\
PM & disease inc. & 3.7E-07 & 1.0E-05 \\
RUf & MJ & 9.3E+01 & 5.6E+03 \\
RUm & kg Sb eq & 8.0E-06 & 3.6E-02 \\ \bottomrule
\end{tabular}
\end{minipage}
\begin{minipage}
\includegraphics[width=1\textwidth]{Pictures/A_best_nosynANDnodesiccationANDnocollection.png}
\captionof{figure}{Characterisation of the sub-systems in best-case scenario A when synthesis, desiccation and algae collection have been excluded from the system boundaries. Method: EF 3.0 Method (adapted) V1.00}
\label{fig:Abest_nosyn_nodesiccation}
\end{minipage}
\end{document}

The main problem is that the minipage has an mandatory argument to specify the width, so you'll need
\begin{minipage}{\linewidth}
Some other comments:
best not specify a file type for your image \includegraphics[width=1\textwidth]{Pictures/A_best_nosynANDnodesiccationANDnocollection}. If you have the same image in different formats latex will then include the one best suited for the engine you use to compile your document
Unless your minipage is in a float environment like figure or table you want to add \noindent before the minipage. Without this there is not enough space in your line to fit a minipage with \textwidth
if you want to have the numbers in your table nicely aligned, have a look at the siunitx package
\documentclass{article}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{graphicx}
\begin{document}
\noindent%
\begin{minipage}[b]{1\textwidth}
\centering
\captionof{table}{Best Case Scenario A IC values when synthesis, desiccation (and algae collection) have been excluded from the system.}
\label{tab:BestA_synthANDdesiccation_excluded}
\begin{tabular}{#{}llcc#{}}
\toprule
IC & Unit & Total (no collection) & Total (with collection) \\ \midrule
CC & kg CO2 eq & -1.1E+03 & -7.0E+02 \\
Ecotox & CTUe & 2.1E+02 & 1.4E+04 \\
HTnc & CTUh & 6.9E-08 & 1.4E-05 \\
PM & disease inc. & 3.7E-07 & 1.0E-05 \\
RUf & MJ & 9.3E+01 & 5.6E+03 \\
RUm & kg Sb eq & 8.0E-06 & 3.6E-02 \\ \bottomrule
\end{tabular}
\end{minipage}
\begin{minipage}{\linewidth}
\includegraphics[width=1\textwidth]{example-image-duck}
\captionof{figure}{Characterisation of the sub-systems in best-case scenario A when synthesis, desiccation and algae collection have been excluded from the system boundaries. Method: EF 3.0 Method (adapted) V1.00}
\label{fig:Abest_nosyn_nodesiccation}
\end{minipage}
\end{document}

Related

Overfull \hbox and Package array Errors. Latex tabular

I am getting trouble to fit my table - tabular to the paragraph width.
This is the error:
Overfull \hbox (341.06795pt too wide) in paragraph at lines 391--411
Package array Error: Illegal pream-token (M): `c' used.
Package array Error: Illegal pream-token (4cm): `c' used
I have been trying one thousand things and nothing seems to work.
I am using this template from Overleaf, where you can find the document class.
This is my code.
\documentclass{JASSS}
\usepackage{amsmath,systeme}
\usepackage{tabularx,colortbl}
\usepackage{booktabs}
\title{XXXXX}
\reviewcopy{true}
\author[1]{}
\affil[1]{}
\email{XX}
\usepackage{natbib}
\setcitestyle{authoryear,round,aysep={}}
\begin{document}
\maketitle
\begin{abstract}
Bla bla
\end{abstract}
\section{xxxx}
\begin{table}[h!]
\centering
\begin{tabular}{ |M{4cm}||M{4cm}|M{4cm}|M{4cm}|}
% \begin{tabular}{|c|c|c|c|}
\cline{2-4}
\multicolumn{1}{c|}{} & \multicolumn{3}{c|}{Initial value parameter combinations ($t_0=1932$)} \\
\hline
Scenarios from 2020 & $\phi_{B}=\phi_{C}=0.05$ and 1932 electoral results & $\phi_{B}=0.05, \phi_{C}=0.055$ and 1932 electoral results & $\phi_{B}=\phi_{C}=0.05$ and electoral tie \\
\hline
$\phi_{D}=\phi_{E}=0.01$, $\gamma_{B}=\gamma_{C}=\gamma_{D}=\gamma_{E}=0.01$ & S0000 & S0100 & S1000 \\
\hline
\rowcolor{blue!20}
$\phi_{D}=0.015,\phi_{E}=0.01$, $\gamma_{B}=\gamma_{C}=\gamma_{D}=\gamma_{E}=0.01$ & S0001 & S0101 & S1001 \\
\hline
\rowcolor{red!20}
$\phi_{D}=0.01,\phi_{E}=0.015$, $\gamma_{B}=\gamma_{C}=\gamma_{D}=\gamma_{E}=0.01$ & S0010 & S0110 & S1010 \\
\hline
\rowcolor{yellow!20}
$\phi_{D}=0.01,\phi_{E}=0.01$, $\gamma_{B}=\gamma_{C}=\gamma_{D}=\gamma_{E}=0.015$ & S0011 & S0111 & S1011 \\
\hline
\end{tabular}
\bibliographystyle{jasss}
\bibliography{references}
\end{document}
The M column type is not defined by default. If you want to use it, you have to somehow define it. I don't know what you indent it to do, but here some dummy code:
\documentclass{JASSS}
\usepackage{array}
\usepackage{amsmath,systeme}
\usepackage{tabularx,colortbl}
\usepackage{booktabs}
\newcolumntype{M}[1]{p{#1}}
\begin{document}
\begin{table}[h!]
\centering
\begin{tabular}{ |M{4cm}||M{4cm}|M{4cm}|M{4cm}|}
% \begin{tabular}{|c|c|c|c|}
\cline{2-4}
\multicolumn{1}{c|}{} & \multicolumn{3}{c|}{Initial value parameter combinations ($t_0=1932$)} \\
\hline
Scenarios from 2020 & $\phi_{B}=\phi_{C}=0.05$ and 1932 electoral results & $\phi_{B}=0.05, \phi_{C}=0.055$ and 1932 electoral results & $\phi_{B}=\phi_{C}=0.05$ and electoral tie \\
\hline
$\phi_{D}=\phi_{E}=0.01$, $\gamma_{B}=\gamma_{C}=\gamma_{D}=\gamma_{E}=0.01$ & S0000 & S0100 & S1000 \\
\hline
\rowcolor{blue!20}
$\phi_{D}=0.015,\phi_{E}=0.01$, $\gamma_{B}=\gamma_{C}=\gamma_{D}=\gamma_{E}=0.01$ & S0001 & S0101 & S1001 \\
\hline
\rowcolor{red!20}
$\phi_{D}=0.01,\phi_{E}=0.015$, $\gamma_{B}=\gamma_{C}=\gamma_{D}=\gamma_{E}=0.01$ & S0010 & S0110 & S1010 \\
\hline
\rowcolor{yellow!20}
$\phi_{D}=0.01,\phi_{E}=0.01$, $\gamma_{B}=\gamma_{C}=\gamma_{D}=\gamma_{E}=0.015$ & S0011 & S0111 & S1011 \\
\hline
\end{tabular}
\end{table}
\end{document}

The font size of tables is way too small in Latex

I am generating tables in latex. But the text's font is way too small compared to the main text size, which is 12 pt.
Here is the Latex code
\begin{table}[htp]
\renewcommand{\arraystretch}{2}
\large
\resizebox{1\textwidth}{!}{%
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\textbf{Air pollutant} & \textbf{Detection limit} & \textbf{Concentration range to expect
by EPA} & \textbf{Concentration range in Bristol, UK} & \textbf{Range in Bristol, UK} \\[3ex]
\hline
\textbf{Ozone (O$_{3}$) } & \textbf{10 ppb} & \textbf{0--150 ppb }
& \textbf{0--100 ppb} & \\[3ex] \hline
\textbf{Nitrogen dioxide} & \textbf{10 ppb} & \textbf{0--50 ppb}
& \textbf{20--55 ppb} & \\[3ex] \hline
\textbf{PM$_{2.5}$} & \textbf{5 } & \textbf{0--40 \SI{}
{\micro\gram/m^3}} & \textbf{0--40 \SI{}{\micro\gram/m^3} }
& \\[3ex] \hline
\textbf{PM$_{10}$} & \textbf{10} & \textbf{0--100 \SI{}
{\micro\gram/m^3} } & \textbf{0--100 \SI{}{\micro\gram/m^3}}
& \\[3ex] \hline
\textbf{Temperature range} & ----- & ------ & ----
-- & \textbf{3--$ 21 ^\circ C $} \\[3ex]
\hline
\textbf{Humidity } & ----- & ----- & -----
-- & \textbf{50\%--75\% } \\[3ex] \hline
\end{tabular}%
}
\end{table}
and here is a screenshot of part of PDF to compare the main text and table font
I have this issue for several tables, so any help would be greatly appreciated.
Can I suggest a few things?
You should avoid long headings with narrow content like numbers, unless cells contain long paragraphs, as well. Find the way to shorten the headings, e.g. by adding line breaks.
Repeated content can be grouped and move to separate cells, which can also help with excessive widths.
As you load siunitx, I would recommend to use \qtyrange{}{}{}. Typing them takes the same space and time but in case you need to make changes e.g. you have to change a range marker from -- to to you will appreciate to only have to do it in one place via siunitx. If you repeat long units, it is also possible to define your own units, for the same reason to make changes in one place. I think \SI{}{} is deprecated and should be changed to qty{}{}, although I am not entirely sure about it.
This is my personal taste but IMO tables can look much better without vertical bars. I also added booktabs for improved horizontal rules.
Here's a different version of your table
and the code
\documentclass{article}
\usepackage{array}
\usepackage{siunitx}
\usepackage{multirow}
\usepackage{makecell}
\usepackage{rotating}
\usepackage{booktabs}
\sisetup{
range-units=single,
range-phrase={\,--\,},
}
\DeclareSIUnit\ppb{ppb}
\newcommand\nullval{---}
\renewcommand\theadfont{\normalfont\bfseries}
\renewcommand\theadgape{\Gape[0pt][0pt]}
\begin{document}
\begin{sidewaystable}
\renewcommand\arraystretch{1.2}
\caption{Caption of the table}
\label{tab:table}
\centering
\begin{tabular}{
wc{4cm}
wc{2cm} #{\hspace{1em}}
*3{wc{3cm}}
wc{2cm}
}
\toprule
\multirow{3}*{\thead*{Air\\pollutant}}
& \multirow{3}*{\thead{Detection\\limit}}
& \multicolumn{2}{c}{\thead{Concentration range:}}
& \multirow{3}*{\thead{Range\\in Bristol, UK}} \\
\cmidrule(lr){3-4}
& & \thead{to expect\\by EPA} & \thead{in Bristol\\UK} & \\
\midrule
\thead{Ozone (O\textsubscript{3})}
& \qty{10}{\ppb} & \qtyrange{0}{150}{\ppb} & \qtyrange{0}{100}{\ppb} & \nullval \\
\thead{Nitrogen dioxide}
& \qty{10}{\ppb} & \qtyrange{0}{50}{\ppb} & \qtyrange{20}{55}{\ppb} & \nullval \\
\thead{PM\textsubscript{2.5}}
& 5 & \qtyrange{0}{40}{\mg/m^3} & \qtyrange{0}{40}{\ug/m^3} & \nullval \\
\thead{PM\textsubscript{10}}
& 10 & \qtyrange{0}{100}{\ug/m^3} & \qtyrange{0}{100}{\ug/m^3} & \nullval \\
\thead{Temperature range}
& \nullval & \nullval & \nullval & \qtyrange{3}{21}{\degreeCelsius} \\
\thead{Humidity}
& \nullval & \nullval & \nullval & \qtyrange{50}{75}{\%} \\
\bottomrule
\end{tabular}
\end{sidewaystable}
\end{document}
You should never use \resizebox for elements which contain text.
Instead you could save some space by using multiple lines for your header cells and restructure your table a bit:
\documentclass[12pt]{article}
\usepackage[text-series-to-math=true]{siunitx}
\usepackage{tabularray}
\usepackage{geometry}
\begin{document}
\begin{table}[htp]
\caption{... The temperature range in Bristol, UK was 3--\SI{21}{\degree C} and the humidity 50\%--75\% during the measurement.}
\begin{tblr}{
colspec={XXXXX},
columns={halign=c,valign=m},
row{1}={font=\bfseries},
column{1}={font=\bfseries},
stretch=0,
rows={ht=2\baselineskip},
hlines,
vlines
}
Air pollutant & Detection limit & Concentration range to expect
by EPA & Concentration range in Bristol, UK \\
Ozone (O\textsubscript{3}) & 10 ppb & 0--150 ppb & 0--100 ppb \\
Nitrogen dioxide & 10 ppb & 0--50 ppb & 20--55 ppb \\
PM\textsubscript{2.5} & 5 & 0--40 \SI{}{\micro\gram/m^3} & 0--40 \SI{}{\micro\gram/m^3} \\
PM\textsubscript{10} & 10 & 0--100 \SI{}{\micro\gram/m^3} & 0--100 \SI{}{\micro\gram/m^3} \\
\end{tblr}%
\end{table}
\end{document}

Stata - Esttab to Latex Decimal Alignment

I am trying to output a LaTex file using Stata's esttab command. I cannot get the decimals to align, nor can I get the nice formatting from the "booktabs" option to work. I also would like to increase the width of the columns. I have been tinkering with this for hours and have had no luck. Below is my Stata code and the LaTex code that I am running through Overleaf. Any help would be greatly appreciated!
Here is my Stata code:
#delimit ;
esttab r1 r2 r3 r4 using "C:\Users\user\Dropbox\Private
Code\Code\STATA\latex\table1.tex", replace
b(3) nomtitle label star(* 0.10 ** 0.05 *** 0.01)
booktabs alignment(D{.}{.}{-1})
title(Placeholder)
s(N DAY FFE FIRM_QUARTER r2_a,
fmt(%9.0fc 0 0 0 3)
label("Observations" "Day FE" "Firm FE" "Firm-Quarter FE" "Adj. R-Sq{\super 2}"))
compress nocons;
Here is the LaTex code it spits out:
\begin{table}[htbp]\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Placeholder}
\begin{tabular}{l*{4}{D{.}{.}{-1}}}
\toprule
&\multicolumn{1}{c}{(1)} &\multicolumn{1}{c}{(2)} &\multicolumn{1}
{c}{(3)} &\multicolumn{1}{c}{(4)} \\
\midrule
VAR1 & 0.007\sym{***}& 0.007\sym{***}& 0.006\sym{***}& 0.007\sym{***}\\
& (8.55) & (7.82) & (7.67) & (8.54) \\
\addlinespace
VAR2 & 0.132\sym{***}& 0.131\sym{***}& 0.131\sym{***}& 0.132\sym{***}\\
& (20.35) & (20.15) & (20.15) & (20.35) \\
\midrule
Observations &1,315,077 &1,315,077 &1,315,077 &1,315,077
\\
Day FE & No & Yes & Yes & No \\
Firm FE & Yes & No & Yes & No \\
Firm-Quarter FE & No & No & No & Yes \\
Adj. R-Sq{\super 2}& 0.045 & 0.027 & 0.046 & 0.044
\\
\bottomrule
\multicolumn{5}{l}{\footnotesize \textit{t} statistics in parentheses}\\
\multicolumn{5}{l}{\footnotesize \sym{*} \(p<0.10\), \sym{**} \(p<0.05\), \sym{***} \(
p<0.01\)}\\
\end{tabular}
\end{table}
Since you haven't provided the full code, I can't see what would your output be. When I add \documentclass{article} with missing packages in a preamble, I get very wide table which does not fit a page. Also, I don't know whether the code is automatically generated or created/altered by you.
Assuming the latter, I would do the following. Since you add footnotes in the table, I would enclose tabular within threeparttable, which splits the area for table into three parts: top for captions, middle for a table definition e.g. tabular, and bottom part for footnotes. It also adds a convenient macro \tnote{}.
Secondly, dcolumn causes big numbers to be pushed way too much to the left. You should let dcolumn suppress their alignment. I personally don't know how, although I assume there is a way.
I prefer siunitx for formatting numbers in tables. However siunitx needs a bit more work. It automatically parses numbers in cells and any non-number content generates errors. Therefore, non-numbers need to be enclosed within {...} which instructs siunitx to leave the content intact. It also forces numbers not to be formatted, aligned etc., which is what I did for the big numbers you have in the table. There's also option to format thousands and millions with any separator of your choice. For instance you could use one of the macros: \,, :, or \; for thin, mid or thick space, respectively instead of ,.
Below is my suggestion for your table based on siunitx and threeparttable, so you can compare it with your approach.
\documentclass{article}
\usepackage{array}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{threeparttable}
\newcommand\super[1]{\textsuperscript{#1}}
\sisetup{
group-separator={,},
table-format=1.3,
table-align-text-after = false,
}
\begin{document}
\begin{table}[htbp]
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\centering
\begin{threeparttable}
\caption{Placeholder}
\begin{tabular}{l *{4}{S}}
\toprule
& \multicolumn{1}{c}{(1)}
& \multicolumn{1}{c}{(2)}
& \multicolumn{1}{c}{(3)}
& \multicolumn{1}{c}{(4)} \\
\midrule
{VAR1} & 0.007\tnote{***} & 0.007\tnote{***} & 0.006\tnote{***} & 0.007\tnote{***} \\
& {(8.55)} & {(7.82)} & {(7.67)} & {(8.54)} \\
\addlinespace
VAR2 & 0.132\tnote{***} & 0.131\tnote{***} & 0.131\tnote{***} & 0.132\tnote{***} \\
& {(20.35)} & {(20.15)} & {(20.15)} & {(20.35)} \\
\midrule
Observations
& \multicolumn{1}{c}{\num{1315077}}
& \multicolumn{1}{c}{\num{1315077}}
& \multicolumn{1}{c}{\num{1315077}}
& \multicolumn{1}{c}{\num{1315077}} \\
Day FE & {No} & {Yes} & {Yes} & {No} \\
Firm FE & {Yes} & {No} & {Yes} & {No} \\
Firm-Quarter FE & {No} & {No} & {No} & {Yes} \\
Adj. R-Sq{\super2} & 0.045 & 0.027 & 0.046 & 0.044 \\
\bottomrule
\end{tabular}
\par\(t\) statistics in parentheses
\par\tnote{*} \(p < 0.10\),\quad\tnote{**} \(p < 0.05\),\quad\tnote{***} \(p < 0.01\)
\end{threeparttable}
\end{table}
\end{document}
EDIT. I also enclosed statistics in{...} because siunitx does not recognised brackets as part of a number.

How to fix an extra alignment and illegal character error when making a table in LaTex, Overleaf

I have created a table in Latex and it has stopped displaying it but I need it to work on the document I am currently working on. When I input into a new document, it works again. I am getting the following errors:
LaTex error: Illegal character in array arg. Overfull \Hbox (56.47151pt too wide) in paragraph at lines at lines 70--98
Error alignment tab has been changed to \cr.
It does not work either when I include the array package. I am using the following packages:
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{url}
\usepackage[round]{natbib}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{float}
\usepackage{amsmath}
\usepackage[toc,page]{appendix}
\begin{table}[h!]
\begin{center}
\caption{A comparison between Rwanda and The Gambia}
\begin{tabular}{l|s|r|m}
\textbf{Variable} &
\textbf{Specific Variable} &
\textbf{Rwanda} &
\textbf{Gambia} &
\hline \hline
\textit{Size} & Surface area (sq. km) & 26,340 & 11,300 \\
& Population (total) & 12,208,407 & 2,100,568 \\
\hline
\textit{Economy} & GDP growth (annual \%) & 6.1 & 4.6 \\
& GDP per capita & 720 & 680 \\
\hline
\textit{Education} & Literacy rate (gender parity index) & 1.029 & 0.851 \\
& School enrolment (primary \% gross) & 133.425 & 97.115 \\
& School enrolment (secondary \% gross) & 32.988 & 57.096 \\
& School enrolment (tertiary \% gross) & 6.695 & 3.094 \\
\hline
\textit{Health and Survival} & Life expectancy at birth (total years) & 67.129 & 61.193 \\
\hline
\textit{Politics} & Political Elections & 4 & 8 \\
& Freedom Rights Score & Not Free & Not Free \\
\hline
\textit{Gender Equality} & Gender equality rating & 4.5 & 3.5 \\
& The Global Gender Gap Report& 121 & 6 \\
\hline
\textit{Aid Rates} & Net ODA received per capita & 100.373 & 128.356 \\
& Net official development assistance & 37.3 & 46.8 \\
\end{tabular}
\end{center}
\end{table}
Concerning the first problem, "Illegal character in array arg", it is indeed cause by by an unrecognised argument to tabular.
Legal arguments are supposed to describe column types and are c (centered), l (left aligned), r (right aligned), p{width} (top aligned paragraph) and | to describe an intercolumn rule for the most common ones. There are packages that add extra column types, but in your code \begin{tabular}{l|s|r|m} 's' is unknown and do not correspond to a valid column type. 'm' exists to specify a middle aligned paragraph in the 'array' package; it would require the insertion of the package and an extra argument with the desired width of the paragraph. Just change 's' and 'm' wih legal parameters and all is OK. There are many documentation available that describe valid column types.
The second message says that you specify an array with four columns but the fist line contains 5 entries:
\textbf{Variable} &
\textbf{Specific Variable} &
\textbf{Rwanda} &
\textbf{Gambia} &
the fifth one is an empty entry following the ampersand after 'Gambia'. Replace it with an end-of-line to suppress the problem.
Here is a corrected version.
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{url}
\usepackage[round]{natbib}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{float}
\usepackage{amsmath}
\usepackage[toc,page]{appendix}
\begin{document}
\begin{table}[h!]
\begin{center}
\caption{A comparison between Rwanda and The Gambia}
\begin{tabular}{l|c|r|c}
\textbf{Variable} &
\textbf{Specific Variable} &
\textbf{Rwanda} &
\textbf{Gambia} \\
\hline \hline
\textit{Size} & Surface area (sq. km) & 26,340 & 11,300 \\
& Population (total) & 12,208,407 & 2,100,568 \\
\hline
\textit{Economy} & GDP growth (annual \%) & 6.1 & 4.6 \\
& GDP per capita & 720 & 680 \\
\hline
\textit{Education} & Literacy rate (gender parity index) & 1.029 & 0.851 \\
& School enrolment (primary \% gross) & 133.425 & 97.115 \\
& School enrolment (secondary \% gross) & 32.988 & 57.096 \\
& School enrolment (tertiary \% gross) & 6.695 & 3.094 \\
\hline
\textit{Health and Survival} & Life expectancy at birth (total years) & 67.129 & 61.193 \\
\hline
\textit{Politics} & Political Elections & 4 & 8 \\
& Freedom Rights Score & Not Free & Not Free \\
\hline
\textit{Gender Equality} & Gender equality rating & 4.5 & 3.5 \\
& The Global Gender Gap Report& 121 & 6 \\
\hline
\textit{Aid Rates} & Net ODA received per capita & 100.373 & 128.356 \\
& Net official development assistance & 37.3 & 46.8 \\
\end{tabular}
\end{center}
\end{table}
\end{document}

Equation error in Latex table

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...
\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}
In TeX, $ signs enclose inline math code (see here). Your example already uses it around ^2. However, you also use other macros that are only valid inside a math environment, such as e.g. \sigma. Hence, you should surround all macros that require math mode with $ signs:
\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}
If you prefer not to mix TeX and LaTeX commands, consider using \(...\) instead of $...$.

Resources