From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8JpJJvQAXmNaBwAAbAwnHQ (envelope-from ) for ; Sun, 30 Oct 2022 05:43:32 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +HEfJvQAXmPGbQAA9RJhRA (envelope-from ) for ; Sun, 30 Oct 2022 05:43:32 +0100 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 76BA49057 for ; Sun, 30 Oct 2022 05:43:32 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1op09s-0001V1-Tb; Sun, 30 Oct 2022 00:42:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1op09m-0001Us-Hm for emacs-orgmode@gnu.org; Sun, 30 Oct 2022 00:42:46 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1op09k-0001j6-75 for emacs-orgmode@gnu.org; Sun, 30 Oct 2022 00:42:46 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 1242A240026 for ; Sun, 30 Oct 2022 05:42:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667104962; bh=8pIK4PO7jEV/2ulrLg8iOYDcFrtPuhE+tYZBImt+T/I=; h=From:To:Cc:Subject:Date:From; b=V3g+NaGqYg0u3/IRg8rqXYPUt6BwL1CEaQ7/Q8Burq4JG79vzXLBqK7FaLUmxHzIS hJplQn3lAcG2RmvSARFf0EOelEmzVLUm7eN4a3jvcKLuoqoESQMkkmsVE1eMu5GJKA vzD6chel5+too7kqt8KuHWn411JxOtxeqPJhXFaWiZdb/kmzJoI1Yr36FytZjXnyOh dmcw1/kOOus0Szyh8J9XB922UJkPfIuTEgVxtz1MMcr4pZzpElnOxSjzI2TJN2O2mk MxgH+HO5fUKa04kPtn5bZXXOKa+SqcPZzvUHrCrmZfUWqzuxtbYfayW6JZqILtVy1V gxoumNQsifTvw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N0Ntm2XBwz9rxD; Sun, 30 Oct 2022 05:42:40 +0100 (CET) From: Ihor Radchenko To: Kierin Bell Cc: emacs-orgmode@gnu.org Subject: Re: Inserting arbitrary lines before tables with Babel In-Reply-To: <87wn8ibam4.fsf@gmail.com> References: <87wn8ibam4.fsf@gmail.com> Date: Sun, 30 Oct 2022 04:43:22 +0000 Message-ID: <87r0ypaplh.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667105012; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=CAUwQGMRjCWk+W2otlmfX4yl0PnTKVxgruJcR8CTujc=; b=MCvBqg+SJF+tWcwiJM+qd0ZyHYKM3rGtJnL0DgV2Kx3fLxgoHD3q5hskZ4Jk4NXL6VAIIg PwBWZ0iCaPbqvT+PwRNrAuPt4enAvm9lu2dkoioOEVlNws/FLwozm1AuYSPbGwUCR+2u/G y2rBzZMT2VN0tcYIj06QyWDQYIuycLdYLwW2/4ncQrxMWcCX0cJQFKKNIKYaDjEybkGSJF iUXC5CF471P+BsWYJ4EOtsVMoyaUCm9YpD/9F9lBWOxvWXC0pyS/m1bxT7EK10qJixSULB UZ5x14m5hWv8gqc6IdmsQBsMF7u5QkuR/jtNDq7ev0eb5xAWw1ZRE7k0GGuG9g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667105012; a=rsa-sha256; cv=none; b=XkJmpvLKrazdkDHnsuX6WNMpLf5kVn4ZPwoDPMChIGr6zMi6YBSCSDkY8QBH1UkM86ThmG /sxBn16/Rky1KqbM5VG40Zx5+Cr2ge8W2PQ7/0AI9IViTC1op6AuovzWCfnKRpUI3C5LH3 OfntJc3o0UwaB4fJu2o7Dp5jrPaPyvuzdpwksZibZh47U6kWaCLmNY0E6l8iNUM5uvHK6N ZwGLE8VZz4O5zNwPiYebRcDUM6QcyX1xdPJWyU4nvT/9mQrmSi5NmvocJmXUnb77BuxsUK zwcWtgOGkAnZPpXKciJsc+XNbUWOpxSA/UtCv3VMLpAvk372J5RlToTNk0J0SQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=V3g+NaGq; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.64 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=V3g+NaGq; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 76BA49057 X-Spam-Score: -3.64 X-Migadu-Scanner: scn1.migadu.com X-TUID: AAh4z7V1uA1W Kierin Bell writes: > When evaluating Babel code blocks with a ':results table' header > argument, what is the best way to automatically insert text _outside_ > of the table? > > For example, if I have a source block: > #+NAME: get-random-table > #+begin_src R :var length=12 :results table > runif(length) > #+end_src > > ... Then 'org-babel-execute-maybe' (C-c C-v e) will output a nicely > formatted Org table: > #+RESULTS: get-random-table > | 0.645291731692851 | > | 0.0425670417025685 | > | 0.220107783330604 | > | 0.413881630403921 | > | 0.817712268792093 | > | 0.972381719155237 | > > ... But if I want to insert a line, for example containing a 'NAME' > keyword, before and _outside of_ that table, there seems to be no easy > way to do this automatically. Just insert it right before #+results keyword. #+results is just another affiliated keyword and can be combined with others. #+NAME: random-table-1 #+RESULTS: get-random-table | 0.645291731692851 | | 0.0425670417025685 | | 0.220107783330604 | | 0.413881630403921 | | 0.817712268792093 | | 0.972381719155237 | Also, if you use :exports results, you can refer to the table as "get-random-table" - the same with the source block name. > Trying to insert lines using subsequent code blocks (arguments, noweb, > etc.) will either strip Org table formatting or add additional lines > within the table instead of outside of it (depending on the ':results' > arguments). There is the same problem with using a ':post' header > argument, and ':wrap' does not allow arbitrary insertion of individual > lines. What is wrong with the example in 16.6 Results of Evaluation? It shows how to prepend #+ATTR_LATEX :width 5cm. #+NAME: would be the same. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at