From mboxrd@z Thu Jan 1 00:00:00 1970 From: presnell@member.fsf.org Subject: Long table with NAME but no CAPTION Date: Wed, 12 Nov 2014 19:27:53 -0500 Message-ID: <87wq6zkqj4.fsf@ufl.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoxMW-00006y-0b for emacs-orgmode@gnu.org; Thu, 13 Nov 2014 11:35:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoxMK-0000tx-OS for emacs-orgmode@gnu.org; Thu, 13 Nov 2014 11:35:11 -0500 Received: from smtp-prod02.osg.ufl.edu ([128.227.74.218]:48837 helo=smtp.ufl.edu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoxMK-0000tE-Im for emacs-orgmode@gnu.org; Thu, 13 Nov 2014 11:35:00 -0500 Received: from ls-presnell (ls-presnell.stat.ufl.edu [128.227.141.78]) (authenticated bits=0) by smtp.ufl.edu (8.13.8/8.13.8/3.0.0) with ESMTP id sADGYuWS023631 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Thu, 13 Nov 2014 11:34:57 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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.