# Inserted pdfpages header consumes extra table numbers in TOC/LOT

I’d like a tabular header to appear on each page of the pdf I’m including. So I am using these commands in pdfpages.

\def\plotheader{
\setlength\LTleft{0.85in}
\begin{longtable}{p{2.7in}p{2.7in}p{2.7in}}
A & B & C
\end{longtable}}

\includepdf[pages={-},angle=90, offset=15mm 0mm, width=5in,height=8.3in, pagecommand={TEST \\ \plotheader}, addtolist={ 1, figure, title, tab:mytable}]{plot.pdf}


What ends up happening is that the tabular plot header consumes more than one table number, even though it is a figure. As a result, there is a discontinuity in the list of tables in the TOC. How can I avoid this?

-
The addtolist option has precisely this effect, that's what it was created for. If you delete it, it should be ok. –  Count Zero May 30 '12 at 10:32
Don't use longtable but a simple tabular instead. –  Ulrike Fischer May 30 '12 at 12:26
@Ariel: tabular does support p{<len>} columns. –  Werner May 31 '12 at 5:00
@Ariel: I don't see anything wrong. Your \includepdf produces a single LoF entry for the first page. If you want an evenly distributed column setup for you table across the entire \textwidth, use the tabularx package with its X column type. –  Werner May 31 '12 at 5:20
@Werner: The problem of Ariel was not the (number of) entries in the list of figures (or list of tables) and has nothing to do with the \includepdf options. The problem was the table counter itself: He uses a longtable in the header and each of this longtable increases the table counter and so there are suddenly gaps in the numbering of his normal tables. –  Ulrike Fischer May 31 '12 at 6:48

Don't use longtable in the header. It doesn't make sense there as you don't need a page break and it disturbs the numbering of your normal tables as it increase the table counter internally. Use a simple tabular instead.
Thanks for your answer. Combined with @Werner's helpful comment above, I replaced the longtable in the header with tabularx: \def\plotheader{\newcolumntype{Y}{>{\centering\arraybackslash}X} \begin{tabularx}{8.3in}{YYY} A & B & C \end{tabularx}}` The counter in the list of tables is now displaying correctly. –  Ariel May 31 '12 at 12:38