1

I can not remove this error:

Missing $ inserted. ...

I have already used:

\usepackage{subfig}
\usepackage{graphicx}
\graphicspath{ {D:/Users/test/} }

and my code is:

\begin{figure}[t]
    \centering
    \subfloat[\kappa_1=0.01mm]{\includegraphics[width=4cm]{6a}} 
    \hfill
    \subfloat[\kappa_2=0.02mm]{\includegraphics[width=3.9cm]{6b}} \\
    \caption{Test}\label{foo}
\end{figure}
  • 4
    Welcome to TeX.SE! Please as usual here show us a short compilable code we can test on our own computer. Have you tried to use \subfloat[$\kappa_1$=0.01mm]{\includegraphics[width=4cm]{6a}}? – Mensch Oct 22 '18 at 1:51
1

You need to use $\kappa_1$ and $\kappa_2$ to get rid of that error message.

See the following mwe:

\documentclass{article}

\usepackage{subfig}
\usepackage{graphicx}

\begin{document}
\begin{figure}[t]
    \centering
    \subfloat[$\kappa_1$=0.01mm]{\includegraphics[width=4cm]{example-image-a}} 
    \hfill
    \subfloat[$\kappa_2$=0.02mm]{\includegraphics[width=3.9cm]{example-image-b}} \\
    \caption{Test}\label{foo}
\end{figure}
\end{document}

and its result:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.