2

This is my first post here. I am struggling with overcoming problem of overfull \vbox warning. It is caused by three-lined cell of a table while it \multirow's only two one-lined. In fact in my main document using \\[0.5cm] works pretty well, but still produces the warning.

In MWE it also has nasty in-table margins.

I would appreciate any help from you. Thank you!

\documentclass[a4paper,12pt]{report}
\usepackage{tabularx}
\usepackage{multirow}
\begin{document}
\begin{table}[ht]
    \footnotesize
        \begin{tabularx}{\textwidth}{c | m{1.9cm} | X X | X X | X X | m{1.7cm} }
        blabla & blabla & \multicolumn{2}{c|}{blabla} & \multicolumn{2}{c|}{blabla} & \multicolumn{2}{c|}{blabla} & blabla \\ \hline
        & & \multicolumn{6}{ c| }{Name} & \multirow{2}{1.7cm}{Some pretty long text} \\ \cline{3-8}
        & & 1 & 2 & 3 & 4 & 5 & 6  & \\ \hline
        \end{tabularx}
\end{table}
\end{document}

enter image description here

3
  • Well, you want three lines of text in a two rows \multirow. This is for sure an overfull vertical box. Just increase the width of your cell to \multirow{2}{1.9cm}{Some pretty long text} and you ready to go. (same thing for the m{1.9cm} above, of course).
    – LaRiFaRi
    Aug 13, 2015 at 14:44
  • If you don't want to change the column width, in the second and third rows you could add some invisible rules, such as \rule[1.5ex]{0pt}{2.5ex}, to increase the vertical space. Aug 13, 2015 at 15:01
  • Thanks, adding a rule did the work. Just thought there is some pretty way to increase row height. LaRiFaRi, I do not have room to increase column width.
    – ssn
    Aug 13, 2015 at 18:26

1 Answer 1

1

Expanding on @GonzaloMedina's comment, since the column width is fixed and three lines of text are available (conceptually), a way to make the text fit into the three rows is to insert vertical rules which expand the second and third row. This won't get rid of the overfull boxes, but they will make the table look ok.

I propose two solutions. One without all of the vertical lines stuff and with fancy rules via booktabs

\documentclass[a4paper,12pt]{report}
\usepackage{tabularx, booktabs}
\usepackage{multirow}
\begin{document}
\begin{table}
    \footnotesize
        \begin{tabularx}{\textwidth}{@{}c m{1.9cm} *{6}{X}   m{1.7cm}@{} }
        \toprule
        blabla & blabla & \multicolumn{2}{c}{blabla} & \multicolumn{2}{c}{blabla} & \multicolumn{2}{c}{blabla} & blabla \\ \midrule
      \rule[1.5ex]{0pt}{2.5ex}  &\rule[1.5ex]{0pt}{2.5ex} & \multicolumn{6}{ c}{Name} & \multirow{2}{1.7cm}{Some pretty long text} \\ 
        & \rule[1.5ex]{0pt}{2.5ex}& 1 & 2 & 3 & 4 & 5 & 6  & \\ \bottomrule
        \end{tabularx}
\end{table}
\end{document}

enter image description here

The second adds the rules to the original table, but looks uglier to me (since vertical separator do not help readability and too many horizontal rules make the table bulkier)

\documentclass[a4paper,12pt]{report}
\usepackage{tabularx}
\usepackage{multirow}
\begin{document}
\begin{table}[ht]
    \footnotesize
        \begin{tabularx}{\textwidth}{c | m{1.9cm} | X X | X X | X X | m{1.7cm} }
        blabla & blabla & \multicolumn{2}{c|}{blabla} & \multicolumn{2}{c|}{blabla} & \multicolumn{2}{c|}{blabla} & blabla \\ \hline
        &\rule[1.5ex]{0pt}{2.5ex} & \multicolumn{6}{ c| }{Name} & \multirow{2}{1.7cm}{Some pretty long text} \\ \cline{3-8}
        &\rule[1.5ex]{0pt}{2.5ex} & 1 & 2 & 3 & 4 & 5 & 6  & \\ \hline
        \end{tabularx}
\end{table}
\end{document}

enter image description here

You must log in to answer this question.

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