If I export a table with #+ATTR_LATEX: :environment longtable #+NAME: mytable
then the beginning of the longtable environment (in the exported latex file) has, e.g., \begin{longtable}{lrrl} \label{mytable} \\ \hline This is a problem, because of the extra space created by the \\. I tried to fix it by changing ox-latex.el, but the longtable environment (in latex) requires the \\ when there is a \label{} command, even in the absence of a caption. This looks like a bug in longtable to me, but it is also true that in a pure LaTeX context it would be very unusual for a table to have a \label{} without a \caption{}, because there would be no printed target for \ref{mylabel} to refer to. Note that there is no problem if the org table has no NAME, since then the lines \label{mytable} \\ are not produced. But I want the NAME in the org file because because I use data from the table to do calculations in other tables via "remote(mytable, ...)". So my sugggestion would be for org's latex export to produce no \label{} (and hence no \\) when the table has no caption, or at least I would prefer to have this as an option. Is there some way to achieve this? Perhaps I should also file a bug report with the author/maintainer of longtable, David Carlisle? One more minor comment: I notice that org-mode's latex export puts the \label{} inside the argument of the \caption{} command. This seems unusual to me.