From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qOB8DjvRfWDiAAAAgWs5BA (envelope-from ) for ; Mon, 19 Apr 2021 20:51:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8A8vCDvRfWDxJgAAbx9fmQ (envelope-from ) for ; Mon, 19 Apr 2021 18:51:39 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4E281D33C for ; Mon, 19 Apr 2021 20:51:38 +0200 (CEST) Received: from localhost ([::1]:48066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYYzf-0008Bg-Sy for larch@yhetil.org; Mon, 19 Apr 2021 14:51:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYYwZ-00089U-9y for emacs-orgmode@gnu.org; Mon, 19 Apr 2021 14:48:23 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:38626) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYYwS-0005Qe-S5 for emacs-orgmode@gnu.org; Mon, 19 Apr 2021 14:48:21 -0400 Received: by mail-pg1-x530.google.com with SMTP id w10so24902444pgh.5 for ; Mon, 19 Apr 2021 11:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pdx-edu.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=ZsCbd6OVq+kz762rfrb+0LDtw2AYvOwJ5i9+cJvw5nQ=; b=dMXzZWB4ZGs4vSH8LavSsPNP76+O+F2kh6ShruQmSQvZgWemxiQH3j0BRau8p4I+Al N+HsGjFiq7M71GnToqyOEMPFoRfSnhCyBoBaKfESb45BiNx6FBTeWKp8oYQDoh0XcJQS UZiSPXAIvQ3gffKEu6R0RZD4hvOhj4CedeO7ZB6q+IlcvKR6hg9CqHObTnVrFBCtW3JF bVVgFbOBJ8Fb0H0LZsjZfWX3V0IoPi1JwNhM55dom879aXoIwb+ntcJmX6rS9fHMUp+R bpeIAs1rBkO3kVzKTVwyi7n2BQ1Jhqj0pPm+nTk/bJkxeMwm9MYqXGWB/bKK6vfztrPt GNjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ZsCbd6OVq+kz762rfrb+0LDtw2AYvOwJ5i9+cJvw5nQ=; b=fup349C6D7FdYYz6gn89gSGwjeev8Lp9sy+UC7uEUR4Au49gDuYUonnnhWwt4kFuYz R7A41KFzPvOo8yvfwFU+DIlCjqTRBY0MnRcLSw9iKIRl8PngvCp5vJyxRmYiNRFF+7vg xmr83Wws8JMGMgvtpC70o319FqeDD+/+lfBi8qnym3y4GqK2Qvo9iRn3xvQ4fgNwL2Mj GuGuoit36/ryra4Zw6V3gKxtPuqGejnRsf1a3ntcKkRswmQueQzKQPGpNAsMJsxDAvwG tx05wrxq35ycJfjWNmLNBRFHqXZKK/HAfT3Rd/pZbUSS7Z6KYyMg08VyiiCPMstte0tg uR2A== X-Gm-Message-State: AOAM53294VwwxnDl6wYBuxK6IMP/ZyH+4IItqzbZUcbdUEWfHYeLA5eY ilnVkweAgWC8iHEMkpvCR+5Piu+kBy83tRajjoO4liTKDWOwE6ZY8Mu6qaNuiIhM+mOWEAZHPQn G9beqx5/QQ2uVfFJw7efhnCQvVrLN/uxiHAko6iuquRyL460xBB2Y4LNW/3Nrtw== X-Google-Smtp-Source: ABdhPJzWRhiLxuw6yleQs+Nm97a/8nrwMyy7RXN9a4f63FHMBcVC2iLRWjVHvYqg+LFqtCue0Umyhw== X-Received: by 2002:aa7:8d03:0:b029:259:f2ed:1849 with SMTP id j3-20020aa78d030000b0290259f2ed1849mr16729219pfe.30.1618858094586; Mon, 19 Apr 2021 11:48:14 -0700 (PDT) Received: from [192.168.1.128] ([159.191.253.251]) by smtp.gmail.com with ESMTPSA id r127sm13058086pfr.163.2021.04.19.11.48.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Apr 2021 11:48:14 -0700 (PDT) Subject: Re: Bug: redundant and undocumented #label is required to link to a table [9.4.4 (9.4.4-dist @ /home/powellj/elisp/org-9.4.4/lisp/)] To: Nicolas Goaziou References: <35a09991-d1c9-647e-4f14-fa3b3274c3a2@pdx.edu> <87lf9eb22e.fsf@nicolasgoaziou.fr> From: James Powell Message-ID: Date: Mon, 19 Apr 2021 11:48:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <87lf9eb22e.fsf@nicolasgoaziou.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=powellj@pdx.edu; helo=mail-pg1-x530.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618858298; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ZsCbd6OVq+kz762rfrb+0LDtw2AYvOwJ5i9+cJvw5nQ=; b=WivNciYu0195gwOsWTPUMiVrhICjLOAY8/Q2AF/VNJDST1NwSY+vaWnN19myFUotN1anVv EXToDivYAYqTq4wubfvkVfJOrM+sZm8yLKccLc+lbRiFm4UHzROfa5+cNxorlCxtVR1OWY RtY7aBNig622GJJJZ/BOueVow4d9s9O9gsqbqh5OEMFYf6/W3W8BOMO8VfoS4ab6QzReqI jg6h8q1ocCS/Wqu9Rk1yCqOmGlW+ryAfEVUPtG7LvWHn+MS78iWnRPZN8RS1KXdWVyoSda spymolxXpaA7FxpcGUwCOwiRo/olEBUJISojQPvW6VSsyyb9GKeFdQrl9YTtVQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618858298; a=rsa-sha256; cv=none; b=hOyc0A2eeJdV/2b1fWTx3a1OdCydht1/Xc7Q+IkC0fSmAJ5svtiPEyCl/8GsPeLSTtxsph zsvnPqreLGcDglq1JKPzGGitQksprpgqdO9CHTHtkdPgZ53o3A0VHjI6rSQ8LgsmbVQt32 z5wDIS1vWZGbNdFvwARt0W4hGHmxa+mqKBSwGvnTwrmNvyL60aPdDkGVYoLh+or3R8DLEd P5kQ/aVkOxl++X8S5agivW82EcHnOhPBd5jK3D4jTSKfFGgoEv9Tewn0jo0/2F10HqO0MU Cefrc7AnkHczBHoFlUrkO6X/Y6Eolnm58jhCkJCoRsYzypYN+dEnMGMHDNwZ2g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=pdx-edu.20150623.gappssmtp.com header.s=20150623 header.b=dMXzZWB4; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.64 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pdx-edu.20150623.gappssmtp.com header.s=20150623 header.b=dMXzZWB4; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 4E281D33C X-Spam-Score: -2.64 X-Migadu-Scanner: scn0.migadu.com X-TUID: PQzVxmVommRf If I put #+name before the table, the link does indeed work, but now the table is reproduced twice in the latex output and also C-c C-c in the code block writes a new table into the file instead of updating the current table. Before C-c C-c in the code block, this org snippet produces the table twice in the latex output: <> #+begin_src R :exports both   library(tidyverse)   x <- tribble(~a, ~b, 1, 3)   x #+end_src #+NAME: t1 #+CAPTION: Org Table #+RESULTS: t1 | 1 | 3 | I want to refer to Table [[t1]]. <> After C-c C-c in the code block, the table appears twice in the org mode file: <> #+begin_src R :exports both   library(tidyverse)   x <- tribble(~a, ~b, 1, 3)   x #+end_src #+RESULTS: | 1 | 3 | #+NAME: t1 #+CAPTION: Org Table #+RESULTS: t1 | 1 | 3 | I want to refer to Table [[t1]]. <> The literature and the Library of Babel do not seem to address the case, which is so common in peer-reviewed literature, of a captioned and referenced table that was produced by code.  It was only through a large investment in trial and error and searching that I was able to build the example above, in which the code does indeed generate a table that is captioned and referenced. - JP On 4/19/21 10:45 AM, Nicolas Goaziou wrote: > Hello, > > James Powell writes: > >> Using Org mode version 9.4.4 I build this document: >> >> <> >> >> #+NAME: t1 >> #+begin_src R :exports both >> >>   library(tidyverse)   x <- tribble(~a, ~b, 1, 3)   x #+end_src >> >> #+CAPTION: Org Table >> #+RESULTS: t1 >> >> | 1 | 3 | >> >> I want to refer to Table [[t1]]. >> <> >> >> What I expect: the latex export will include the table and link to it. >> >> What happens instead: the code and table appear, numbered and captioned. >> However, the link is broken ("I want to refer to Table ??"). Looking in >> the latex, this line reads >> >> > I want to refer to Table \ref{org993764c}. >> >> but that label org993764c appears nowhere else in the file. >> >> Org-lint doesn't complain about the file at all.  I posted this >> earlier to this list and learned about a workaround >> >> " It works if you put a #+label on the table ... which confuses me, >> because I looked through the manual for #+label and there's no mention >> of it at all, but a bunch of my Org files use it (for LaTeX export). " > #+label is an outdated equivalent for #+name. > > In this case, you are referencing the source code block whereas you want > to reference the table. So #+name should go before the table. > > Note that if you follow [[t1]] link, point will move to the source code > block, not the table. > > Regards, -- James E. Powell, MS Pronouns: he/him/his Applied Physics PhD Candidate Department of Physics Portland State University Home page: http://web.pdx.edu/~powellj Office: SRTC 409B Phone: +1-503-725-8515