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 experiencing some issues when I use longtable and xwatermark.

If the table starts in page X and finishes two page later, I get an error : ! LaTeX Error: Something's wrong--perhaps a missing \item And it points right at the end of the table.

I think it is xwatermark that adds something whitin each page that annoys pdftex.

If I ignore the error, the file is generated anyway. But I would like to have no error to be able to debug future version easily (I am beggining with LaTeX).

\documentclass[12pt,a4paper]{book}

\usepackage[english]{babel}
\usepackage{pdfpages}
\usepackage[textheight=2cm]{geometry}
\usepackage{longtable}
\usepackage{xwatermark}

\newwatermark[oddpages,fontfamily=,color=gray!25,angle=-90,scale=0.5,xpos=0.45\paperwidth,ypos=0]{\textsc{Confidential}}
\newwatermark[evenpages,fontfamily=,color=gray!25,angle=90,scale=0.5,xpos=-0.45\paperwidth,ypos=0]{\textsc{Confidential}}

\raggedbottom %to prevent Underfull \vbox (badness 10000) with the graphics

\makeatother

\begin{document}
\begin{center}
    \begin{longtable}{|c|c|}
        \hline
        a & a \\
        \hline
        b & b \\
        \hline
        c & c \\
        \hline
        d & d \\
        \hline
        e & e \\
        \hline
        f & f \\
        \hline
    \end{longtable}
\end{center}
\end{document}
share|improve this question
2  
Please edit the question to contain a complete (small) document that shows the error. (You can make set \textheight to a small length in the preamble so you do not need many table rows and watermark with text not an image so the example is self contained) –  David Carlisle Aug 23 '12 at 10:32
    
I believe the question is about clash betwenn xwatermark and longtable, hence I removed the other tags. –  tohecz Aug 23 '12 at 10:58
    
@DavidCarlisle I added an example that does the same error –  MSIS Aug 23 '12 at 13:07
    
@tohecz Thanks. I was thinking that maybe it was texworks or texmaker responsible as the file was generated at the end. –  MSIS Aug 23 '12 at 13:08

1 Answer 1

up vote 3 down vote accepted

The longtable is already centered by default. Remove \begin{center} and \end{center} and you are bailed out.

share|improve this answer

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.