From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: exporting cross-references to source block results CORRECTION Date: Thu, 11 Apr 2013 13:31:15 +0200 Message-ID: References: <20130411084634.GA10767@panahar> <20130411095747.GC18521@panahar> <20130411104605.GA28852@panahar> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQFgg-0007Aj-Hs for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 07:29:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQFgb-0006l1-Jw for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 07:29:06 -0400 Received: from mail2.b1.hitrost.net ([91.185.211.205]:23085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQFgb-0006jP-DR for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 07:29:01 -0400 In-reply-to: <20130411104605.GA28852@panahar> 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: Vikas Rawal Cc: emacs-orgmode Vikas Rawal writes: >> Oops, sorry, I take back my last message, there was an error in my test >> example. >> >> Adding a #+NAME above the generated table DOES result in a correct >> cross-reference. That seems like reasonable behavior to me. > > The intended behaviour, as documented by Nicolas, is that a named > source block will result in output with #+RESULTS, and that the > cross-reference will pick that up correctly. I confirm that I don't get a correct cross-reference to a table that is identified only by its #+RESULTS name. > If #+RESULT is not to work, it is better to change > org-babel-results-keyword to NAME, and then what you are suggesting > happens automatically. But in the earlier thread on the topic, Nicolas > said that was not the right way. I see. Sorry for not following the discussion. In that way, you get both code block and result identified by the same NAME line, and Babel appears to be smart enough to handle that without the code block overwriting itself... But this solution gives faulty exports if you're exporting both code and results (`:exports both'). In HTML, you get two different elements with the same id attribute, the code block and the table. That shouldn't happen. I find Firefox resolves the conflict by jumping to whichever of the two elements appears first. It seems to me that you would have the same problem even if the exporter did pick up the name from the RESULTS line and make a cross-reference to it, as you expect it to. The target would still be ambiguous. I submit that the best way to get a cross-reference to a generated table in all circumstances is to manually name that table with a #+NAME line and a *unique* name, i.e. *different* from that of the source block that generated it. This seems a reasonable requirement. Yours, Christian