[Tex/LaTex] Illegal unit of measure (pt inserted) in the table that might be too wide for the page

errorstablesunit-of-measure

I want to create following table:

\documentclass{article}
\usepackage{units}

\begin{document} 

    \begin{table*}[t]
        \small
        \begin{tabular}{ |l|c|c|c|c|c|c|c|c|c|c| }
        \hline
        \multicolumn{1}{|p{0.9in}}{ }&
        \multicolumn{10}{|c|}{Factor level}\\
        \hline
        \multicolumn{1}{|p{0.9in}}{Output} &
        \multicolumn{1}{|p{0.35in}}{ABS-UTS} &
        \multicolumn{1}{|p{0.35in}}{ABS-THETA MIN} &
        \multicolumn{1}{|p{0.35in}}{ABS-THETA MAX} &
        \multicolumn{1}{|p{0.35in}}{ABS-Sa MIN} &
        \multicolumn{1}{|p{0.35in}}{ABS-Sa max} &
        \multicolumn{1}{|p{0.35in}}{PLA-UTS} &
        \multicolumn{1}{|p{0.35in}}{PLA-THETA MIN} &
        \multicolumn{1}{|p{0.35in}}{PLA-THETA MAX} &
        \multicolumn{1}{|p{0.35in}}{PLA-Sa MIN}&
        \multicolumn{1}{|p{0.35in}|}{PLA-Sa max}\\
        \hline
        Nozzle temperature ($ ^{\circ} $ C) & 3 & 1 & 2 & 2 & 1 & 2 & 3 & 1 & 1 & 3 \\
        \hline
        Deposition speed  (\( \frac{\textrm{mm}}{\textrm{s}} \)) & 
        3 & 1 & 3 & 2 & 3 & 1 & 1 & 2 & 2 & 1 \\
        \hline
        Layer heigh (mm) & 
        3 & 1 & 3 & 3 & 3 & 3 & 2 & 1 & 1 & 2 \\
        \hline
        \end{tabular}
            \caption{Configurations for single lap experimental investigation}
            \label{tab:results}
            \paperwidth
    \end{table*}

\end{document}

Why am I getting these errors while the .tex file still compiles:

./paper.tex:317: Missing number, treated as zero.
<to be read again> 
                   \par 
l.317 \end{table*}

./paper.tex:317: Illegal unit of measure (pt inserted).
<to be read again> 
                   \par 
l.317 \end{table*}

Also, is it possible to increase the fourth line height?

enter image description here

Thank You.

Best Answer

To me is simpler to rewrite your table code fragment than search for errors. They can be hidden in superfluous use of \multicolumn{1}{p{<length>}}{...} (why you not define columns type on this way?), or in spurious \paperwidth at end of table environment etc.

For your table I would:

  • use tabularx table environment
  • remove all vertical lines
  • for horizontal lines use rules defined in booktabs package
  • for columns with min, max values make comon column hears
\documentclass{article}
\usepackage{geometry}
\usepackage{siunitx}
\usepackage{booktabs, makecell, multirow, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{xparse}
\NewExpandableDocumentCommand\mcc{O{1}m}
    {\multicolumn{#1}{c}{#2}}

\begin{document}
    \begin{table}[ht]
    \small
    \setcellgapes{1pt}
    \makegapedcells
    \renewcommand\multirowsetup{\centering}
\begin{tabularx}{\linewidth}{ @{} l *{10}{C} @{} }
    \toprule
        & \mcc[10]{Factor level}        \\
    \cmidrule{2-11}
Output  &   \multirow{2.8}{=}{ABS-UTS}
            &   \mcc[2]{ABS-THETA}  
                &   \mcc[2]{ABS-Sa}
                    &   \multirow{2.8}{=}{PLA-UTS}
                        &   \mcc[2]{PLA-THETA}
                            &   \mcc[2]{PLA-Sa}                 \\
    \cmidrule(l){3-4}\cmidrule(l){5-6}\cmidrule(l){8-9}\cmidrule(l){10-11}
        &   & min & max & min & max &   & min & max & min & max \\
    \midrule
Nozzle temperature (\si{celsius})
        & 3 & 1 & 2 & 2 & 1 & 2 & 3 & 1 & 1 & 3 \\
Deposition speed  (\si{mm\per\second})
        &   3 & 1 & 3 & 2 & 3 & 1 & 1 & 2 & 2 & 1 \\
Layer heigh (\si{\milli\metre}) 
        & 3 & 1 & 3 & 3 & 3 & 3 & 2 & 1 & 1 & 2 \\
    \bottomrule
    \end{tabularx}
        \caption{Configurations for single lap experimental investigation}
        \label{tab:results}
\end{table}
\end{document}

enter image description here

Related Question