From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wBeSNraxZGOIFgEAbAwnHQ (envelope-from ) for ; Fri, 04 Nov 2022 07:31:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yJilNbaxZGOAAgAAG6o9tA (envelope-from ) for ; Fri, 04 Nov 2022 07:31:18 +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 6211F3C189 for ; Fri, 4 Nov 2022 07:31:18 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqqDV-0005Yd-G9; Fri, 04 Nov 2022 02:30:13 -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 1oqqDL-0005Sn-5G for emacs-orgmode@gnu.org; Fri, 04 Nov 2022 02:30:06 -0400 Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqqDI-0003qT-Ee for emacs-orgmode@gnu.org; Fri, 04 Nov 2022 02:30:02 -0400 Received: from localhost ([::ffff:197.239.4.182]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000081FEF.000000006364B164.000031CA; Thu, 03 Nov 2022 23:29:56 -0700 Date: Fri, 4 Nov 2022 08:49:11 +0300 From: Jean Louis To: Ihor Radchenko Cc: Org Mode Subject: Re: How to align all tables at once? Message-ID: Mail-Followup-To: Ihor Radchenko , Org Mode References: <87v8nv492f.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87v8nv492f.fsf@localhost> User-Agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02) Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL=0.141, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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=1667543478; 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; bh=ElKM1SXALdIGAS12fCBDYlFMGFXJS6h6VIj8hjgYsWM=; b=BwJQVdDmoLqKy85Pc5exGh7BaHR4Jba2CRe6BKVJ7WYPQQu3/WgOOr6cjXJ/3KBd2aqMzg qvIfTA6CK4q5GHGLAxPFKqRn6/R1grjfGEJuOgegxI80NzxvdRbIWiiC6nJpvjl8zLmFBk rvZxjfXjbJlndhQyD2X61d4esdy/lojUZdTswIObK4MWaEU9369ttcOom5T+M5hgCHoQ+R kCKa3UeAGlNM2WZc6qYv7xfnboKidXCDU+2w6xzhK79BD0iEpMRrkS8A3sDwLp+9OvCOMh F4HZUIuzfzOs25Y/bImMmmxDfyQE99+OKuOqFBD/LkSL6cdz0eLKHg1XsjddGA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667543478; a=rsa-sha256; cv=none; b=bxOsTxzb0H0cZ6yU+ZFfXoKDyQIYCKhtXS8GWiYOQZgeNk+I9LiGfP9hkKSu9FN1Bz30mM 8P/UOH31nKKinlYXJWtzy+t3AYGTBHuNCIjCVm0CNLe3pCXTQm6GE0KnNvBYbRSGDCFXxa nOnSdegVN6I+pTtFKEoWAX8TAeJk8MHzVq07etBD5AZs0Bvf1K7ttpr1bIOKwdZ3EhJF8F sTlO2lwEb/DW2u/sjrhmdAiyfq3QzzaS+ofTZiyMMe6WgCIEG4oDvEt+jfzcoqpxZiuomX a0tTz3quCFx/GId7AAuifc+C2HVSO5ias2yZjJZvUj23ZA5Kl7PTdpWhFgM0+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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: 2.00 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: 6211F3C189 X-Spam-Score: 2.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: rdSSrRU6NykV * Ihor Radchenko [2022-11-04 07:50]: > Jean Louis writes: > > > I am using Org mode for presentation and would like to use it's tables > > for presentation only. > > > > In particular I need the function org-table-align to align the table > > in presentation mode. > > I am not sure if I understand your use-case, but you may consider > looking at 3.2 Column Width and Alignment section of the manual. Yes, I look inside. My use case is that Org buffer is used for presentation purpose, it is not a file, it is generated buffer. This means tables cannot be aligned before, but after, as the Org buffer does not exist before, it exists only after rendering. Then I look in the code by searching for variable `org-startup-align-all-tables', and I find this within `define-derived-mode': (unless org-inhibit-startup (org-unmodified (when org-startup-with-beamer-mode (org-beamer-mode)) (when (or org-startup-align-all-tables org-startup-shrink-all-tables) (org-table-map-tables (cond ((and org-startup-align-all-tables org-startup-shrink-all-tables) (lambda () (org-table-align) (org-table-shrink))) (org-startup-align-all-tables #'org-table-align) (t #'org-table-shrink)) t)) And I think such larger definitions shall rather be split into smaller useful functions. For myself I have made this, which I need to additonally invoke via M-x then it works: (defun rcd-org-table-align-all () (interactive) (read-only-mode 0) (org-table-map-tables (lambda () (org-table-align) (org-table-shrink)) t) (read-only-mode 1)) > #+STARTUP: align > will align all the tables when opening an Org file. And in this case I would like it on the end initialization, not before. But problem is temporarily solved for Org mode by using M-x rcd-org-table-align-all as my presentation buffer is in read only mode. Org has nicer table in its source. Asciidoctor does not have, but then Asciidoctor renders better PDF tables. So I am now using both versions, Org and Asciidoctor. ⟦ (ignore (setq my-total 0)) ⟧ ⟦ (ignore (defun my-add (n) (setq my-total (+ my-total n)) (format "UGX %s" n))) ⟧ == Monthly Expenses [cols="4,>1"] |=== | Description | Value | Communications and Reporting Officer I/C | ⟦ (my-add 600000) ⟧ | Prospecting Staff member | ⟦ (my-add 450000) ⟧ | Prospecting Staff member | ⟦ (my-add 450000) ⟧ | Food for workers on project | ⟦ (my-add 900000) ⟧ | Transport Expenses | ⟦ (my-add 1000000) ⟧ | Rental | ⟦ (my-add 300000) ⟧ | 500 Prospecting Checks with mapping | ⟦ (my-add (pct-plus 5000000 .30)) ⟧ >| *TOTAL*: | *⟦ (format "UGX %s" my-total) ⟧* |=== > Babel also auto-aligns tables in results. Would it be possible to put Org as Babel source, so that I have Org table inside of Babel and cause Babel to render automatically on the end of buffer rendering and invocation of org derived mode? -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/