3

I have read this question, but i just can not explain why exactly overfull happens in my case, so i ask for help.

First of all, two boxes in spanned cells (that ones with rotated text) produces 4 bad boxes. How can i fix it or is there workaround to suppress warnings caused by this boxes.

Rendering enter image description here

Minimum example

\documentclass[14pt,twoside]{extreport}
\usepackage[a4paper,
            lmargin=2.5cm,rmargin=2cm,
            tmargin=2.5cm,
            bmargin=2cm,
            marginpar=1cm,
            marginparsep=0.5cm,
            headheight=17pt]{geometry}
\usepackage{type1ec}
\usepackage[warn]{mathtext}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{array}
\usepackage{tabu}
\usepackage{xparse}
\usepackage{pdflscape}


\NewDocumentCommand{\rot}{O{90} O{1em} m}{\makebox[#2][l]{\rotatebox{#1}{#3}}}%
\newcolumntype{Y}[1]{>{\strut\hspace{0pt}}X[#1]<{\hspace{0pt}\strut}}
\tabucolumn Y


\begin{document}

\begin{landscape}
\begin{table}[ht]
 \caption{Demo table with multirow\strut}
 \small
 \tabcolsep=4pt
 \setlength{\arrayrulewidth}{1pt}
 \extrarowsep=^2pt_0pt
 \begin{tabu} to \linewidth {|Y{10,C}|Y{10,C}|Y{10,C}|Y{16,C}|Y{10,C}|Y{10,C}|Y{10,C}|Y{12,C}|Y{12,C}|}\hline
  \multirow{6}*[9.5ex]{%
   \rot[90][7ex]{\parbox{24ex}%
                {\centering First column's heading; three lines of text, six rows spanned}}}
        & \multirow{6}*[9.5ex]{%
           \rot[90][4.7ex]{\parbox{24ex}%
                          {\centering Second column's heading; two lines}}}
               & \multicolumn{5}{c|}{%
                  \rule[-3.4ex]{0ex}{8ex}%
                  \parbox{0.4\linewidth}{\centering Heading of columns third to seven; single line}}
                                                  & \multicolumn{2}{c|}{%
                                                     \multirow{4}*[4.7ex]{%
                                                      \parbox{0.22\linewidth}%
                                                             {\centering Eighth and ninth column headings; %
                                                                         five lines of text, two colums spanned, %
                                                                         four rows spanned; and some math %
                                                                         $(20\pm 5)\,^{\circ}{\rm C}$ to fill}}}\\\cline{3-7}
        &      & \multicolumn{5}{c|}{%
                  \parbox{0.4\linewidth}%
                         {\centering\strut At the top of the first line you can not see %
                                           enough padding between border line and text\strut}}
                                                  & \multicolumn{2}{c|}{}\\\cline{3-7}
        &      & C    & D    & E    & F    & G
                                                  & \multicolumn{2}{c|}{}\\\cline{3-7}
        &      & \multicolumn{5}{c|}{%
                  \parbox{0.4\linewidth}%
                         {\centering\strut At the top of the first line you can not see %
                                           enough padding between border line and text\strut}}
                                                  & \multicolumn{2}{c|}{}\\\cline{3-9}
        &      & C0   & D0   & E0   & F0   & G0
                                                  & \multirow{2}*{%
                                                     \parbox{\linewidth}%
                                                            {\centering multirow and multiline}}
                                                         & \multirow{2}*{%
                                                            \parbox{\linewidth}%
                                                                   {\centering multirow only}}\\\cline{3-7}
        &      & \multicolumn{3}{c|}{Alpha}
                                    & \multicolumn{2}{c|}{Beta}
                                                  &      &\\\hline

  A1    & B1   & C1   & D1   & E1   & F1   & G1   & H1   & I1\\\hline
  A2    & B2   & C2   & D2   & E2   & F2   & G2   & H2   & I2\\\hline
  A3    & B3   & C3   & D3   & E3   & F3   & G3   & H3   & I3\\\hline
 \end{tabu}
\end{table}
\end{landscape}

\end{document}
  • Your table is too complicated with many manual adjustments, which makes it difficult to know from where the problem comes. But surely it is related with the very first row. – cacamailg Apr 27 '16 at 17:43
  • I could not find the type1ec package. Without it, it runs just fine (no errors or warnings). – John Kormylo Apr 27 '16 at 19:56
1

So, it seems that TeX/LaTeX detects overfull by calculating height of table rows assuming each row to contain of single line of text.

I added two more rows (each after «At the top of the first line...»), see

&      & \multicolumn{5}{c|}{}            & \multicolumn{2}{c|}{}\\\cline{3-7}

Also i spanned cells containing «At the top of the first line...» by two rows, see

&      & \multicolumn{5}{c|}{%
          \multirow{2}*{%
           \parbox{0.4\linewidth}%
                  {\centering At the top of the first line you can not see %
                              enough padding between border line and text}}}
                                          & \multicolumn{2}{c|}{}\\

And finally i placed struts at the beginning of each row, that i found with wrong padding, see

\rule[\singlelnfixrule]{0pt}{\baselineskip}

The whole example (compiles with no warnings):

\documentclass[14pt,twoside]{extreport}
\usepackage[a4paper,
            lmargin=2.5cm,rmargin=2cm,
            tmargin=2.5cm,
            bmargin=2cm,
            marginpar=1cm,
            marginparsep=0.5cm,
            headheight=17pt]{geometry}
\usepackage{type1ec}
\usepackage[warn]{mathtext}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{array}
\usepackage{tabu}
\usepackage{xparse}
\usepackage{pdflscape}


\NewDocumentCommand{\rot}{O{90} O{1em} m}{\makebox[#2][l]{\rotatebox{#1}{#3}}}%
\newcolumntype{Y}[1]{>{\strut\hspace{0pt}}X[#1]<{\hspace{0pt}\strut}}
\tabucolumn Y


\begin{document}

\begin{landscape}
\newlength{\singlelnfixrule}\setlength{\singlelnfixrule}{4pt}\addtolength{\singlelnfixrule}{-.3\baselineskip}
\begin{table}[ht]
 \caption{Demo table with multirow\strut}
 \small
 \tabcolsep=4pt
 \setlength{\arrayrulewidth}{1pt}
 \extrarowsep=^2pt_0pt
 \begin{tabu} to \linewidth {|Y{10,C}|Y{10,C}|Y{10,C}|Y{16,C}|Y{10,C}|Y{10,C}|Y{10,C}|Y{12,C}|Y{12,C}|}\hline
  \multirow{8}*[16.2ex]{%
   \rot[90][7ex]{\parbox{24ex}%
                {\centering First column's heading; three lines of text, six rows spanned}}}
        & \multirow{8}*[16.2ex]{%
           \rot[90][4.7ex]{\parbox{24ex}%
                          {\centering Second column's heading; two lines}}}
               & \multicolumn{5}{c|}{%
                  \rule[-3.3ex]{0ex}{8ex}%
                  \parbox{0.4\linewidth}{\centering Heading of columns third to seven; single line}}
                                                  & \multicolumn{2}{c|}{%
                                                     \multirow{6}*[11.7ex]{%
                                                      \parbox{0.22\linewidth}%
                                                             {\centering Eighth and ninth column headings; %
                                                                         five lines of text, two colums spanned, %
                                                                         four rows spanned; and some math %
                                                                         $(20\pm 5)\,^{\circ}{\rm C}$ to fill}}}\\\cline{3-7}
  \rule[\singlelnfixrule]{0pt}{\baselineskip}
        &      & \multicolumn{5}{c|}{%
                  \multirow{2}*{%
                   \parbox{0.4\linewidth}%
                          {\centering At the top of the first line you can not see %
                                      enough padding between border line and text}}}
                                                  & \multicolumn{2}{c|}{}\\
        &      & \multicolumn{5}{c|}{}            & \multicolumn{2}{c|}{}\\\cline{3-7}
  \rule[\singlelnfixrule]{0pt}{\baselineskip}
        &      & C    & D    & E    & F    & G
                                                  & \multicolumn{2}{c|}{}\\\cline{3-7}
  \rule[\singlelnfixrule]{0pt}{\baselineskip}
        &      & \multicolumn{5}{c|}{%
                  \multirow{2}*{%
                   \parbox{0.4\linewidth}%
                          {\centering At the top of the first line you can not see %
                                      enough padding between border line and text}}}
                                                  & \multicolumn{2}{c|}{}\\
        &      & \multicolumn{5}{c|}{}            & \multicolumn{2}{c|}{}\\\cline{3-9}
  \rule[\singlelnfixrule]{0pt}{\baselineskip}
        &      & C0   & D0   & E0   & F0   & G0
                                                  & \multirow{2}*{%
                                                     \parbox{\linewidth}%
                                                            {\centering multirow and multiline}}
                                                         & \multirow{2}*{%
                                                            \parbox{\linewidth}%
                                                                   {\centering multirow only}}\\\cline{3-7}
  \rule[\singlelnfixrule]{0pt}{\baselineskip}
        &      & \multicolumn{3}{c|}{Alpha}
                                    & \multicolumn{2}{c|}{Beta}
                                                  &      &\\\hline

  A1    & B1   & C1   & D1   & E1   & F1   & G1   & H1   & I1\\\hline
  A2    & B2   & C2   & D2   & E2   & F2   & G2   & H2   & I2\\\hline
  A3    & B3   & C3   & D3   & E3   & F3   & G3   & H3   & I3\\\hline
 \end{tabu}
\end{table}
\end{landscape}

\end{document}

Rendering 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.