[Tex/LaTex] LaTeX error: missing $

math-mode

I have some math equations within my LaTeX file and I usually denote these with $ to enter math mode. For longer equations, I will use \begin{math} ... but for some reason this is giving me an error telling me I am missing a $.

\begin{center}
\begin{math}
\example{ \Delta G = \Delta H - T\Delta S }
\label{1st_ex}
\end{math}
\end{center}

gives me

Missing $ inserted <inserted text> $ l.302 \example {\Delta ....

Even if I insert $ it still gives me that error.

The example function is

%list of equations
\usepackage[titles]{tocloft}
\newcommand{\listexamplename}{List of Equations}
\newlistof{example}{exp}{\listexamplename}
\newcommand{\example}[1]{%
\refstepcounter{example}
\par\noindent\text{Equation \theexample. #1}
\addcontentsline{exp}{example}
{\protect\numberline{\thechapter.\theexample}#1}\par}

Best Answer

Based solely in the information available in your question, I'll say you have three possible ways to write the equation:

\documentclass{article}
\begin{document}

\begin{equation}
    \Delta G = \Delta H - T\Delta S 
\label{eq:1st_ex}
\end{equation}

$\Delta G = \Delta H - T\Delta S $

\[\Delta G = \Delta H - T\Delta S \]

\end{document}

Which will produce an output like this:

enter image description here

Related Question