0

I am a beginner with LaTeX. I am using TeX studio with MikTeX, on windows 7 x64.

I am trying to build some tables on my paper. I used existing papers from another paper as a sort of "template". However, when I try to compile the projet, after I edit the template table, I am getting the same set of errors for all the tables in my paper. The 4 errors, as well as my code, are shown in the attachment. Sorry, but I still can't format my posts correctly here.

Do you know the cause of these errors and how to fix them?

I attach a .txt file with a minimal sample of the code, with "something goes here" instead of the original text.

Sorry for uncompliance with the rules. I am very new in the TeX forum of Stackexchange.

Best regards, KingBaboon

Minimal working code:

\documentclass[review]{elsarticle}

\usepackage{lineno.hyperref}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{inputenc}
\modulolinenumbers[5]

\journal{Something goes here}

%%%%%%%%%%%%%%%%%%%%%%%
%% Elsevier bibliography styles
%%%%%%%%%%%%%%%%%%%%%%%
%% To change the style. put a % in front of the second line of the current style and
%% remove the % from the second line of the style you would like to use.
%%%%%%%%%%%%%%%%%%%%%%%

%% Numbered
%\bibliographystyle{model1-num-names}

%% Numbered without titles
%\bibliographystyle{model1a-num-names}

%% Harvard
%\bibliographystyle{model2-names.bst}\biboptions{authoryear}

%% Vancouver numbered
%\usepackage{numcompress}\bibliographystyle{model3-num-names}

%% Vancouver name/year
%\usepackage{numcompress}\bibliographystyle{model4-names}\biboptions{authoryear}
%% APA style
%\bibliographystyle{model5-names}\biboptions{authoryear}

%% AMA style
%\usepackage{numcompress}\bibliographystyle{model6-num-names}

%% `Elsevier LaTeX' style
\bibliographystyle{elsarticle-num}
%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\begin{frontmatter}

\title{Something goes here}%%\tnoteref{mytitlenote}}
%\tnotetext[mytitlenote]{Fully documented templates are available in the elsarticle package on \href{http://www.ctan.org/tex-archive/macros/latex/contrib/elsarticle}{CTAN}.}

%% Group authors per affiliation:
\author{Something goes here\fnref{myfootnote}}
\ead{[email protected]}
\address{Something goes here}


\section{Results}

Something goes here

\begin{figure}[h!]
    \centering 
    \includegraphics[width=6cm]{fig3.png}
    \caption{Something goes here}\label{fig3}
\end{figure}

Something goes here

\begin{table}[h!]
    \centering
    \caption{Something goes here}\label{t16}
    \scriptsize
    \begin{center}
        \begin{tabular}{|c|c|c|c|c|c|c|c}
            \hline 
            abc & a & b & c & aaa & bbb & ccc & ddd ($%$) \\ 
            \hline 
            0.09 & 55 & 0.0433 & -5.7E-03 & 6.79E-03 & 2.564 & 198.345 &  \\ \hline 
            0.09 & 57 & 0.0433 & -5.7-03 & 6.79E-03  & 2.564 & 198.345 & \\ \hline
            0.09 & 59 & 0.0433 & -5.7E-03 & 6.79E-03  & 2.564 & 198.345 & \\ \hline 
            0.09 & 51 & 0.0433 & -5.7E-03 & 6.79E-03  & 3.564 & 198.345 & \\ \hline 
            0.09 & 53 & 0.0433 & -5.7E-03 & 6.79E-03  & 3.564 & 198.345 & \\ \hline
            0.09 & 55 & 0.0433 & -5.7E-03 & 6.79E-03  & 3.564 & 198.345 & \\ \hline 
            0.09 & 57 & 0.0433 & -5.7E-03 & 6.79E-03  & 4.564 & 198.345 & \\ \hline 
            0.09 & 59 & 0.0433 & -5.7E-03 & 6.79E-03  & 4.564 & 198.345 & \\ \hline
            0.09 & 51 & 0.0433 & -5.7E-03 & 6.79E-03  & 4.564 & 198.345 & \\ \hline 

        \end{tabular} 
    \end{center}
\end{table} 

Something goes here.



\section{Results}


Something goes here.

\bibliography{mybibfile}

\end{document}
2
  • 3
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Don't post an image of your erors / code as this is hard to reproduce (people don't like to retype)/ • Note this is a Q&A site, not a please do this for me service. What do you have so far.
    – albert
    Dec 11, 2018 at 19:02
  • 4
    % has special meaning (for comment) in latex source code. Use \% instead.
    – nidhin
    Dec 11, 2018 at 19:11

1 Answer 1

1

your mwe has many issue:

  • the graphicx package is already load by elsarticle
  • the hyperref had to be loaded last in preamble (with rare exception, which is not present)
  • \begin{frontmatter} is not closed with end{frontmatter}
  • last column type is not properly typed (instead ddd ($%$) had to be ddd ($\%$) or simply ddd (\%))
  • in table environment is sufficient to use cantering, so also use\begin{center} ... \end{center}` is superfluous

correcting this, the result is as expected:

enter image description here

\documentclass[review,demo]{elsarticle}
\usepackage[utf8]{inputenc}
%\usepackage[demo]{graphicx} % loaded by elsarticle
\usepackage{amsmath}
\usepackage{longtable}
\usepackage{lineno,hyperref}
\modulolinenumbers[5]
\journal{Something goes here}

\bibliographystyle{elsarticle-num}

\begin{document}
%\begin{frontmatter}    % it is not used in mwe

\title{Something goes here}

%% Group authors per affiliation:
\author{Something goes here\fnref{myfootnote}}
\ead{[email protected]}
\address{Something goes here}

\section{Results}
Something goes here
    \begin{figure}[h!]
    \centering
\includegraphics[width=6cm]{fig3.png}
    \caption{Something goes here}
\label{fig3}
    \end{figure}

Something goes here

\begin{table}[h!]
    \centering
    \caption{Something goes here}\label{t16}
    \scriptsize
%    \begin{center}  % surplus
        \begin{tabular}{|c|c|c|c|c|c|c|c|}
            \hline
            abc & a & b & c & aaa & bbb & ccc & ddd (\%) \\
            \hline
            0.09 & 55 & 0.0433 & -5.7E-03 & 6.79E-03 & 2.564 & 198.345  &  \\ \hline
            0.09 & 57 & 0.0433 & -5.7-03 & 6.79E-03  & 2.564 & 198.345  & \\ \hline
            0.09 & 59 & 0.0433 & -5.7E-03 & 6.79E-03  & 2.564 & 198.345 & \\ \hline
            0.09 & 51 & 0.0433 & -5.7E-03 & 6.79E-03  & 3.564 & 198.345 & \\ \hline
            0.09 & 53 & 0.0433 & -5.7E-03 & 6.79E-03  & 3.564 & 198.345 & \\ \hline
            0.09 & 55 & 0.0433 & -5.7E-03 & 6.79E-03  & 3.564 & 198.345 & \\ \hline
            0.09 & 57 & 0.0433 & -5.7E-03 & 6.79E-03  & 4.564 & 198.345 & \\ \hline
            0.09 & 59 & 0.0433 & -5.7E-03 & 6.79E-03  & 4.564 & 198.345 & \\ \hline
            0.09 & 51 & 0.0433 & -5.7E-03 & 6.79E-03  & 4.564 & 198.345 & \\ \hline
        \end{tabular}
%    \end{center} % surplus
\end{table}
Something goes here.

\section{Results}
Something goes here.

%\bibliography{mybibfile}  % not available

\end{document}
1
  • Hi!! Many thanks for your help. I have other problems, but I will post them on other threads. You are welcome to colaborate, if you wish. :)
    – KingBaboon
    Dec 13, 2018 at 13:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .