1

I have code for wherein I tried to insert the title for each column but I am getting an error. The error says:

Missing control sequence inserted

How to overcome this?

\documentclass[twocolumn,10pt]{article}%{asme2ej}
\usepackage{graphicx}
\usepackage{stfloats}
\usepackage{adjustbox}
\usepackage{scalerel}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{cuted}

\usepackage[Symbol]{upgreek}
\usepackage{epstopdf}
%\usepackage{float}
\usepackage{siunitx}
%\usepackage{caption}
\usepackage{enumitem}

\usepackage{caption}
\usepackage{subcaption}
\captionsetup{compatibility=false}
\usepackage{multirow, tabularx}
\usepackage{tikz}
\usepackage{pifont}
\usepackage{setspace}

\usepackage{multicol}

\usepackage{lipsum}


\begin{document}
\lipsum[1]
 \begin{figure}[htb]
 \centering
  \includegraphics[width=\columnwidth]{example-image}
  \caption{}
  \label{fig:Transition_curves_spring}
 \end{figure}

\lipsum[1]
 \begin{figure}[htb]
 \centering
  \includegraphics[width=\columnwidth]{example-image}
 \caption{}
    \label{fig: Transition_curves_spring}
 \end{figure}

\lipsum[12]
\begin{figure}[!htb]
\setkeys{Gin}{width=\linewidth, height=0.25\textheight}
  \begin{subfigure}{\columnwidth}
    \includegraphics{example-image}
    \caption{Cantilever}
    \label{fig:mode_1_max_beta}
  \end{subfigure}
   \begin{subfigure}{\columnwidth}
    \includegraphics{example-image}
    \caption{Simple Support}
    \label{fig:mode_2_max_beta}
  \end{subfigure}
  \begin{subfigure}{\columnwidth}
    \includegraphics{example-image}
    \caption{Clamped-Clamped }
    \label{fig:mode_3_max_beta}
  \end{subfigure}
  \caption{xxxxx}
  \label{fig:location of max beta}
  \end{figure}

\lipsum[2]
  \begin{table}[tb]
   \caption{}
   \label{table:three spring beam}
   \setlength\tabcolsep{0pt}
  \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
                                *{3}{S[table-format=4.0]}
                                     S[table-format=1.4]
                                     S[table-format=1.5]
                                     S[table-format=1.3]
                                     S[table-format=1.4]
                             }
 \hline
 \multicolumn{3}{c}{\begin{tabular}[c]{@{}c@{}}Non-dimensional\\ Stiffness\end{tabular}} & \multicolumn{2}{c}{\begin{tabular}[c]{@{}c@{}}Mode 1\\ $\beta_{1}$\end{tabular}}                                         & \multicolumn{2}{c}{\begin{tabular}[c]{@{}c@{}}Mode 2\\ $\beta_{2}$\end{tabular}}\\ \hline

 $K_{t}$                      & $M$                         & $K_{r}$                     & \begin{tabular}[c]{@{}c@{}}Present\\ Method\end{tabular}        & FEM            & \begin{tabular}[c]{@{}c@{}}Present\\ Method\end{tabular}         & FEM           \\ \hline
 0                            & 0                           & 0                           & 3.142                                                           & 3.140          & 6.281                                                            & 6.2739        \\
 50                           & 0                           & 0                           & 3.458                                                           & 3.461          & 6.382                                                            & 6.374         \\
 0                            & 100                         & 0                           & 0.829                                                           & 0.830          & 6.281                                                            & 6.273         \\
 0                            & 0                           & 200                         & 4.118                                                           & 4.136          & 6.281                                                            & 6.273         \\
 100                          & 200                         & 0                           & 0.812                                                           & 0.813          & 6.456                                                            & 6.449         \\
 300                          & 0                           & 400                         & 4.741                                                           & 4.757          & 6.883                                                            & 6.875         \\
 0                            & 500                         & 100                         & 0.733                                                           & 0.736          & 6.281                                                            & 6.273         \\
 $\infty$                        & 0                           & 1000                        & 5.231                                                           & 5.220          & 9.412                                                            & 9.372         \\
 $\infty$                        & 100                         & $\infty$                       & 1.471                                                           & 1.467          & 7.244                                                            & 7.220         \\
 300                          & 800                         & 1000                        & 0.761                                                           & 0.764          & 6.696                                                            & 6.685         \\
 1000                         & 500                         & 3000                        & 0.918                                                           & 0.922          & 7.007                                                            & 6.990         \\
 500                          & 4000                        & 800                         & 0.525                                                           & 0.527          & 6.837                                                            & 6.824         \\
 $\infty$                        & $\infty$                      & $\infty$                       & 0.0046                                                          & 0.00464        & 7.239                                                            & 7.214       \\
 \hline 
  \end{tabular*}

    \medskip
 \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
                                *{3}{S[table-format=4.0]}
                                *{4}{S[table-format=2.3]}
                             }
                             \hline
                              \multicolumn{3}{c}{\begin{tabular}[c]{@{}c@{}}Non-dimensional\\ Stiffness\end{tabular}} & \multicolumn{2}{c}{\begin{tabular}[c]{@{}c@{}}Mode 1\\ $\beta_{1}$\end{tabular}}                                         & \multicolumn{2}{c}{\begin{tabular}[c]{@{}c@{}}Mode 2\\ $\beta_{2}$\end{tabular}}\\ \hline

                              $K_{t}$                      & $M$                         & $K_{r}$                     & \begin{tabular}[c]{@{}c@{}}Present\\ Method\end{tabular}        & FEM            & \begin{tabular}[c]{@{}c@{}}Present\\ Method\end{tabular}         & FEM           \\ \hline

  0             & 0     & 0     & 9.403 & 9.393 & 12.298    & 12.492        \\
  50            & 0     & 0     & 9.418 & 9.408 & 12.298    & 12.492        \\
  0             & 100   & 0     & 7.857 & 7.830 & 12.273    & 12.492        \\
  0                           & 0                           & 200                         & 9.950                                                            & 9.909         & 13.524                                                           & 13.652        \\
  100                         & 200                         & 0                           & 7.968                                                            & 7.943         & 12.273                                                           & 12.492        \\
  300                         & 0                           & 400                         & 10.049                                                           & 10.009        & 13.617                                                           & 13.734        \\
  0                           & 500                         & 100                         & 7.950                                                            & 7.918         & 13.075                                                           & 13.064        \\
  {$\infty$}    & 0     & 1000          & 13.611    & 13.484    & 15.701    & 15.434    \\
  {$\infty$}    & 100   & {$\infty$}    & 13.122    & 13.071    & 15.720    & 15.490    \\
  300           & 800   & 1000          & 8.325     & 8.297     & 13.173    & 13.130    \\
  1000          & 500   & 3000          & 9.196     & 9.173     & 13.189    & 13.144    \\
  500           & 4000  & 800           & 8.583     & 8.557     & 13.172    & 13.130    \\
  {$\infty$}    & {$\infty$}    & {$\infty$}    & 13.123    & 13.024    & 15.799    & 15.490 \\
  \hline
  \end{tabular*}
  \end{table}

\lipsum[12]
    \begin{figure*}[b]
    \setkeys{Gin}{width=\linewidth, height=0.25\textheight}
\begin{tabularx}{\linewidth}{*{2}{X}}
    \includegraphics{example-image}
    \caption{xxxxx}
    \label{fig:mode shape with three springs}
&
    \includegraphics{example-image}
    \caption{xx}
\\
   \includegraphics{example-image}
   \caption{xxx}
   \label{fig:Transition_curves_mass}
&
  \includegraphics{example-image}
  \caption{xx}
  \label{fig:Linear-rotational spring}
\end{tabularx}
\end{figure*}
\lipsum[2-4]
\end{document}
  • Enclose everything that is in siunitx's S type columns and is text but not numbers in a set of {} (for example {$K_{t}$}instead of $K_{t}$). Apart from that, please note that your code is not a MWE as it contains a lot of code that is not needed to reproduce your problem. Also, where is the connection to longtable as you've used this tag in your question but your code does not use the longtable package? – leandriis Feb 12 at 14:39

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.