Graphics, Figures & TablesMissing $ inserted in Table but can't figure out where

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kletzi
Posts: 3
Joined: Sun Oct 16, 2022 2:06 am

Missing $ inserted in Table but can't figure out where

Post by kletzi »

Hi,

currently I'm having some strange issue. When compiling a i get the error missing $ inserted but i can't figure out where the $ is missing.

I posted an exampe code below. As far as I can see there is no $ missing but Latex tells me there are missing $ in Lines 7 and 8.

Code: Select all

\begin{table}[htpb]
    \centering
    \begin{tabular}{l l S S  S}
        \toprule
          %  &             &        \multicolumn{2}{c}{Datenblatt \cite{Datasheet_FlowmeterSMCGross}} & \multicolumn{2}{c}{Messung}\\
        BMK & Hersteller & $\frac{t_{63,V}}{\sekunde}$ & $\frac{t_{d,V}}{\sekunde}$ & $\frac{\dot{s}_{v}}{\prozent\,/\,\sekunde}$ \\ \midrule
        QNA 1 & Bürkert & $1,33$   & $0,16$ & $35,18$ \\
        QNA 2 & ASCO    &  $0,66$     &   $0,24$    & $\text{-}$
           \\    \addlinespace
           
          \bottomrule
    \end{tabular}%
    \caption{My Caption}
    \label{tab: ErgVoridentPropvalve}
\end{table}
Would be great if anyone could help me out.

edit:
Here is the Error Message. I'm usign Overleaf by the way.
<inserted text>
$
l.268 Q
NA 2 & ASCO & $0,66$ & $0,24$ & $\text{-}$
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Missing $ inserted.
<inserted text>
$
l.268 Q
NA 2 & ASCO & $0,66$ & $0,24$ & $\text{-}$
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
I can use the compile despite errors method but the error message occurs on each line in each table.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

kletzi
Posts: 3
Joined: Sun Oct 16, 2022 2:06 am

Missing $ inserted in Table but can't figure out where

Post by kletzi »

Found the solution.

Just had to remove the $$ in the S-columns around the numbers.

Like this:

Code: Select all

\begin{table}[htpb]
    \centering
    \begin{tabular}{l l S S  S}
        \toprule
          %  &             &        \multicolumn{2}{c}{Datenblatt \cite{Datasheet_FlowmeterSMCGross}} & \multicolumn{2}{c}{Messung}\\
        BMK & Hersteller & $\frac{t_{63,V}}{\sekunde}$ & $\frac{t_{d,V}}{\sekunde}$ & $\frac{\dot{s}_{v}}{\prozent\,/\,\sekunde}$ \\ \midrule
        QNA 1 & Bürkert & 1,33   & 0,16 & 35,18 \\
        QNA 2 & ASCO    &  0,66     &   0,24    & {-}
           \\    \addlinespace
           
          \bottomrule
    \end{tabular}%
    \caption{My Caption}
    \label{tab: ErgVoridentPropvalve}
\end{table}
Kind regards
Kletzi
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Missing $ inserted in Table but can't figure out where

Post by Stefan Kottwitz »

Hi Kletzi,

welcome to the forum!

Great that you found the issue. I tested your code but could not see the cause because S columns are not standard and either you defined them or use a package (siunitx?) but that could not be seen here. Usually, if one posts a small complete example, it can easily be tested and fixes. Perhaps next time. ;-)

See you,

Stefan
LaTeX.org admin
kletzi
Posts: 3
Joined: Sun Oct 16, 2022 2:06 am

Missing $ inserted in Table but can't figure out where

Post by kletzi »

Hello Stefan,

yes i used the siunitx package. Sorry for posting non compilable code.

I'll do better next time.

best regards
Kletzi
Post Reply