Samar,
the problem is not a 1.4. problem but a general problem how lyx handles
the different table-types of latex. It based on the difference between
latex tables (i.e. < 1 page, normally embedded in a Float environment to
be shifted to a position where it looks nice) and latex- longtables (> 1
page ; page breaks) and the different handling of captions.
The problem is as follows:
tables have two containers, the caption is placed between the outer and
the inner hull:
\begin{table} % start of float
        \caption{xxx}
        \begin{tabular}
                A&B&C\tabularnewline
                1&2&3\tabularnewline
        \end{tabular}
        \end{table}

longtables however only have on container and the possiblility of
subdividing the contents with the \endhead, \endfirsthead, \endfoot
\endlastfoot command. Normally these blocks can also contain captions.
so its valid to write the following latex code
\begin longtable
\caption{xxx} 
        % goes into the list of tables and advances the tab-counter
A&B&C\tabularnewline % the header line for the first part of lt
\endfirsthead
\caption[]{xxx (cont.)} 
   %the opt. argument (i.e. nothing) is inserted into LOT no advance
        A&B&C&\tabularnewline % the header of the subsequent pages
\endhead
1&2&3\tabularnewline
        \end{longtable}
Lyx longtables however only allow to switch endhead and endfirsthead for
table lines.
A kludge to overcome this problem is ERT (I think first posted by Dekel
Tsur).  First define in the preamble a latex macro \supress with on
argument, which simply swallows the argument and does nothing with it.
        \newcommand{\suppress}[1]{\relax}
Then write your longtable as follows
1. an empty line
2. the header line(s)
both with the endfirsthead flag in the table dialog
3 another empty line
4. the header line(s) for the subsequent pages
both with the endhead flag in the table dialog
then insert the following ERT in the first cell of 1 and 3 accordingly.
\caption{your captiontext  goes here}\supress{
and the following ERT in the first cell of 2 and 4 accordingly
} , ie simply the closing brace.

With longer captions its ugly to edit, but anyhow.

this translates to the following latex code

\begin{longtable}
\caption{your captiontext  goes here}\supress{&&\tabularnewline} 
A&B&C\tabualarnewline ...

I  wrote a program to convert csv-Files to lyx-code (with a few more
bells and whistles) where the longtable code goes that way. I hope I can
post it soon.



-- 
Joachim Heidemeier <[EMAIL PROTECTED]>

Reply via email to