1

enter image description here

I have made this table but I have a warning:

"Overfull \hbox (5.0pt too wide) detected at line 336".

Can someone help me, please?

        \documentclass[final,3p,times]{elsarticle}
        \usepackage{amssymb} 
        \usepackage{amsmath}
        \usepackage{graphicx}
        \usepackage[export]{adjustbox}
        \usepackage{tabularx}
        \usepackage{multirow}
        \usepackage{booktabs}
        \usepackage{siunitx}
        \usepackage{natbib}


        \begin{document}
        \begin{table}[!ht]
                  \caption{Numerical Analysis of the decrypted images}
           \label{Metric}
           \centering
             \begin{tabular}{ll
                S[table-format=1.4]
           *{5}{S[table-format=-1.4]}
                            }
         \toprule
          \multirow{2}{*}[-1ex]{Images}
          & \multirow{2}{*}[-1ex]{Metric}
                         & \multicolumn{4}{c}{Proposed Results}     &{References}           \\
            \cmidrule{3-6}
     &            & {200}    & {400}     &  {600}     & {800}     &       \\
           \midrule 
         \multirow{3}{*}{Goldhill}
            & PSNR & 57.0074  & 59.2239 & 61.0477 & 63.3011  &    \\
            &SSIM & 0.9943  &  0.9976 & 0.9987  & 0.9993&  \\
            & ESR &  0.7470   & 0.5461&  0.3487 &  0.3487 &  \\     
      \bottomrule
        \end{tabular}
    \end{table}
   \end{document}
  • Can you add, please, your complete or full code? – Sebastiano Aug 21 '18 at 20:13
  • The error have solved from edit your code by excellent user David – Sebastiano Aug 21 '18 at 20:28
2

Two problems and one suggestion:

  • You specify more columns (8) than your table has (7)

  • Also your numbers are longer than what you tell siunitx, this causes the overfull box warning. If your numbers have 2 digits before the decimal separator and 4 digits afterwards, you need to specify a format of 2.4 and not 1.4

  • And just my personal opinion: Your table looks even better if the rules are trimmed a little bit


\documentclass[final,3p,times]{elsarticle}
\usepackage{amssymb} 
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{natbib}
\usepackage{caption}

\begin{document}

\begin{table}[!ht]
    \caption{Numerical Analysis of the decrypted images}
    \label{Metric}
    \centering
    \begin{tabular}{@{}ll *{4}{S[table-format=2.4]} l@{}}
        \toprule
        \multirow{2}{*}[-0.5ex]{Images} 
            & \multirow{2}{*}[-0.5ex]{Metric}
            & \multicolumn{4}{c}{Proposed Results}
            &\multirow{2}{*}[-0.5ex]{References}  \\
        \cmidrule(rl){3-6}
        & & {200} & {400} & {600} & {800} & \\
        \midrule 
        \multirow{3}{*}{Goldhill}
        & PSNR & 57.0074  & 59.2239 & 61.0477 & 63.3011 &  \\
        & SSIM & 0.9943   & 0.9976  & 0.9987  & 0.9993  &  \\
        & ESR  & 0.7470   & 0.5461  & 0.3487  & 0.3487  &  \\     
        \bottomrule
    \end{tabular}
\end{table}

\end{document}

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.