Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am getting overfull warning (Overfull \hbox (17.10379pt too wide) in alignment) when using longtable enviroment (See MWE below) The warnings are on \begin{longtable} and \end* lines. The pdf filellooks fine, but I would like to get rid of the warning message. Any suggestions on how to get rid of those warning by formatting the table?

\documentclass{article}

\usepackage{longtable}
\usepackage{lipsum}

\begin{document}
\begin{longtable}{*2{p{0.49\textwidth}}}
        Title & Column 2 \\
        \hline
    \endfirsthead
        Title & Column 2 \\
        \hline
    \endhead
        \multicolumn{2}{r}{Continued}\\
    \endfoot
        \hline
    \endlastfoot

    \lipsum[1] & \lipsum[2]\\
\end{longtable}
\end{document}
share|improve this question
3  
Welcome. Load the package showframe and you will see the problem. The width of a column is .49\textwidth but you forgot the tabcolsep on the left and right of every column. –  Marco Daniel Jan 28 '12 at 18:12
    
thank you. I did not konw about showframe. I fixed the column width and now it works fine. –  mythealias Jan 28 '12 at 18:17
add comment

1 Answer

up vote 7 down vote accepted

You're not taking correctly into account the \tabcolsep, a space that is added in front and after all columns:

\begin{longtable}{*2{p{\dimexpr0.5\textwidth-2\tabcolsep\relax}}}

Or, with the calc package,

\begin{longtable}{*2{p{0.5\textwidth-2\tabcolsep}}}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.