1

EDIT: example fixes, answer selected.

I've got a table-within-table setup. The tables are looking fine, but I get two overfull hbox warnings (15.4pt and 25.6pt overfull) per table. I'd like to get rid of these warnings to clean the log, but none of the solutions I found on similar posts are doing the trick for me.

Could someone please help me tweak this table structure to eliminate \hbox warnings?:

\documentclass{article}
\usepackage{multirow}
\newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}}

\begin{document}

\begin{tabular}{ p{5em} p{29.8em} p{1em} p{5em} } 
Q1a1 & Alternative 1: Smartphone & \multirow{7}*{\minitab[l]{1 \\ 0 \\ -66}} & \multirow{7}*{\minitab[l]{Marked \\ Not marked \\ Not applicable}} \\ 
Q1a2 & Alternative 2: Tablet & \\ 
Q1a3 & Alternative 3: Laptop & \\ 
Q1a4 & Alternative 4: Desktop computer & \\ 
Q1a5 & Alternative 5: Other & \\ 
Q1dk & Alternative 6: Don't know & \\ 
Q1ref & Alternative 7: Prefer not to answer & \\ 
\end{tabular} 

\end{document}
2
  • The warning are from the \minitabs being wider than the p{1em} and p{5em} allow. I must confess that your whole approach here confuses me. Aug 14, 2017 at 12:28
  • 1
    welcome to tex.sx. your example doesn't produce the result you describe. or rather, it produces not only that result but many more (such as the first column not being in math mode and a much more overfull box of 126pt at the end of the tabular). please "fix" it. Aug 14, 2017 at 12:28

1 Answer 1

1

Is this what you are trying to achieve?

\documentclass{article}
\begin{document}

\noindent\begin{tabular}{ll} 
Q1\_a1 & Alternative 1: Smartphone \\
Q1\_a2 & Alternative 2: Tablet \\ 
Q1\_a3 & Alternative 3: Laptop \\ 
Q1\_a4 & Alternative 4: Desktop computer \\ 
Q1\_a5 & Alternative 5: Other \\ 
Q1\_dk & Alternative 6: Don't know \\ 
Q1\_ref & Alternative 7: Prefer not to answer
\end{tabular}\hfill
\begin{tabular}{rl}
1 & Marked \\
0 & Not marked \\
$-66$ & Not applicable
\end{tabular}

\end{document}

demo

2
  • wild guess -- the hyphen before "66" is supposed to be a minus. Aug 14, 2017 at 18:35
  • @barbarabeeton - I keep forgetting that hyphen and minus aren't the same symbol. Aug 14, 2017 at 21:27

You must log in to answer this question.

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