From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 SLRPLPRdhWLrwAAAbAwnHQ (envelope-from ) for ; Wed, 18 May 2022 22:58:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AA1YLPRdhWIh7AAA9RJhRA (envelope-from ) for ; Wed, 18 May 2022 22:58:28 +0200 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 04887DD7E for ; Wed, 18 May 2022 22:58:28 +0200 (CEST) Received: from localhost ([::1]:39494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrQkU-00042J-F2 for larch@yhetil.org; Wed, 18 May 2022 16:58:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrQjA-000423-QN for emacs-orgmode@gnu.org; Wed, 18 May 2022 16:57:05 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:47088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nrQj8-0003xi-25 for emacs-orgmode@gnu.org; Wed, 18 May 2022 16:57:04 -0400 Received: by mail-pl1-x634.google.com with SMTP id i8so2891073plr.13 for ; Wed, 18 May 2022 13:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=berkeley-edu.20210112.gappssmtp.com; s=20210112; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=4+jonrerE8qyj9kIPyVCBE0b4kF15W7a75vmtW9pUFI=; b=vpc2lwsmzUrznTzUTb4ktXPpUuOjDon97UgeB/WRpHAFEyyhMNTAGpBIVQnzgKTgPM gjc48de9GBKfL2I0u79HhGqe4kVsEfdMhVWsTbypq6FSnGm4AhQXgc1myDOyqN5fMLrt KE6t7rYHmzwloB1kZ6IgPGqxqneGMserqtcf63PCf8/t1KKQRRLUe4Z0I6ehQasYTuuH t3c3LNYTUQIJXo3rzk1uEdz6jLr6GlcY8nBnqDzJ2KDriNxfcBzRnzGF4gcCdhwzPJKy smRJaSHxBEogoNxGfYQk1UO9KVdTMtXHHfbAHQTxmM0lzuLI0k1hvZKwtqyeyfhioWks D5bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=4+jonrerE8qyj9kIPyVCBE0b4kF15W7a75vmtW9pUFI=; b=dP5cL38iO5ht3WqgLqm9XWHIdNQG3emaG0MynW64Aj9Zp15jOVe9L8vwu43oYMEDy7 0BI5S/53/Emj+/q52QxUQ+IufNGvRqN2U82RNd3KBGEdGdmmL1PFzqh05zm9t3D9Tm4B qQ1YTdRzcD3SxhkdipBqZMiX4RUDxmMAFQc8yBk1jhVfTf2bHssY41hqmcWXnvoqMD7l VoGOIskpH6Ist64YvFTsMndOQ3ZVu4RlOxirDr+n9DHgdrJA1IC/nHrsNQKjmweKuMGs AZPdW/OGyXbgZG8YasLPwhlPxnT513DY7mLlkdkOl4zdzk5Z9HvdnrGFoaVzanqjxrCV ZoxA== X-Gm-Message-State: AOAM532x79mWxpsXj/Ro6XXFkB8GdGP1I0wWeeVNQaJMd8i+pkT0qBh9 Ope/JdJwPpd8/f8tDwK9ejGRgw== X-Google-Smtp-Source: ABdhPJxgHKDTUlmrhbYaHRp5HsekfgPzpLVqvmBq+VOS5CbCwaeBPw1U24ww5oDDr4y2n6yslFTITA== X-Received: by 2002:a17:90a:f3c2:b0:1df:8d56:d8ce with SMTP id ha2-20020a17090af3c200b001df8d56d8cemr1339331pjb.86.1652907419804; Wed, 18 May 2022 13:56:59 -0700 (PDT) Received: from smtpclient.apple (157-131-222-176.fiber.dynamic.sonic.net. [157.131.222.176]) by smtp.gmail.com with ESMTPSA id v8-20020a17090331c800b0015e8d4eb24fsm2072010ple.153.2022.05.18.13.56.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 May 2022 13:56:58 -0700 (PDT) From: Richard Stanton Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_F477D147-5E00-44B1-A970-214F21C50E68" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: Trouble producing nicely aligned org tables from emacs-jupyter code blocks using latest org version Date: Wed, 18 May 2022 13:56:57 -0700 In-Reply-To: Cc: orgmode To: John Kitchin References: X-Mailer: Apple Mail (2.3696.100.31) Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=rhstanton@berkeley.edu; helo=mail-pl1-x634.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652907508; 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=4+jonrerE8qyj9kIPyVCBE0b4kF15W7a75vmtW9pUFI=; b=lW1Py5bEM3OWrZ8KyvXSs3kEEVH1Voj/PgVtrOIWR3f0n2FzLisFYaJ8TIGWc9vpZl9gO5 3hNgzyVeUxfHbKNU22JjfcZOusvjuaU4LeDXKWKIA6wBf+SCSN335+FLqpkCOJBDlmIi/X ZN+5BjE9XQpA4E+AEuPAxPjzAxKroyixTVTn1+0nz+9osa5SIbRhjO9ZXzR9zGbsH/WzxD kg7SCyM02MfiDy1AarE8xJrL4NDm4AWX9HafVc3LwHjcta1YWm7Ed4MxJRnGSz2taDedei ncQ9RwiMpN87mdwPTa9FR2C/PEuX5DYJRE+Jwkqp5eOXRzc0ZCw9HOIgmVy0qg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652907508; a=rsa-sha256; cv=none; b=tu0nYdnRKuJn763+aX7FH3t82UHZF6thnsAQSPx4YAiXzX4YBf3CflBb/iEnqL5CCvDvkT 5T0auR7Q1Ms8nkohDiUpW3B8LALFP0bpFcbviUCOrZWLhSTlQTzyo7oDKclZf35YIuEN9W JLxp7BPnWhrwUbzuRkByA5o+R4tf28NMs4LtvHXaDuujlIaESJMOgkUImiKb5cUX56BWOg R9umnCvsUiXmp3UEacXFd0uEFZBYU/N/3Q5htEzFxTb6nMHajo48mhIbOFhsci1+oSgvNl tSJijs7xiCvHgboFp4cdZZcFgjZxsmnt8MwcV8qNlWhvsbm6/26e51G0qq2eLA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=berkeley-edu.20210112.gappssmtp.com header.s=20210112 header.b=vpc2lwsm; 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: -3.04 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=berkeley-edu.20210112.gappssmtp.com header.s=20210112 header.b=vpc2lwsm; 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: 04887DD7E X-Spam-Score: -3.04 X-Migadu-Scanner: scn1.migadu.com X-TUID: 4+3zz/aFhxct --Apple-Mail=_F477D147-5E00-44B1-A970-214F21C50E68 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Thanks for the suggestion, John. I=E2=80=99ve tried playing around with = this, and am I right that it seems to have trouble when execution is = asynchronous? > On May 18, 2022, at 1:16 PM, John Kitchin = wrote: >=20 > I use a function in an after execute hook for this: = https://github.com/jkitchin/scimax/blob/master/scimax-org.el#L205 = >=20 > This works on a subtree, which has been fine for me. You could adapt = it to only work in the results section. >=20 > John >=20 > ----------------------------------- > Professor John Kitchin (he/him/his) > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu >=20 >=20 >=20 > On Wed, May 18, 2022 at 4:07 PM Richard Stanton = > wrote: > I=E2=80=99m running Emacs 28.1 under macOS 12.4 and want to create = tables from Python code blocks that can be exported to either LaTeX or = HTML. The simplest way to do this seems to be to generate the output as = an org table, and using the built-in version of org (9.4.6 = (9.4.6-798-g738759.dirty-elpaplus @ = /Users/stanton/.emacs.d/elpa/org-plus-contrib-20210929/)), this works = fine using either a python or emacs-jupyter code block: >=20 > #+begin_src jupyter-python > [ > ["Wide a", "b", "c"], > None, > [1, 2, 3], > [4, 5, 6], > None, > [7, 8, 9] > ] > #+end_src >=20 > #+RESULTS: > | Wide a | b | c | > |--------+---+---| > | 1 | 2 | 3 | > | 4 | 5 | 6 | > |--------+---+---| > | 7 | 8 | 9 | >=20 > #+begin_src python=20 > return [ > ["Wide a", "b", "c"], > None, > [1, 2, 3], > [4, 5, 6], > None, > [7, 8, 9] > ] > #+end_src >=20 > #+RESULTS: > | Wide a | b | c | > |--------+---+---| > | 1 | 2 | 3 | > | 4 | 5 | 6 | > |--------+---+---| > | 7 | 8 | 9 | >=20 >=20 > To use the latest version of org, I change just two lines in my = init.el from >=20 > (straight-use-package '(org :type built-in)) > (straight-use-package '(org-contrib :type built-in)) >=20 > to >=20 > (straight-use-package '(org :type git :repo = "https://code.orgmode.org/bzg/org-mode.git = ")) > (straight-use-package '(org-contrib :type git :repo = "https://git.sr.ht/~bzg/org-contrib = =E2=80=9D)) >=20 > Having done this, the python block still works fine, but the = horizontal lines in the jupyter-python block are no longer properly = aligned with the text: >=20 > #+begin_src jupyter-python > [ > ["Wide a", "b", "c"], > None, > [1, 2, 3], > [4, 5, 6], > None, > [7, 8, 9] > ] > #+end_src >=20 > #+RESULTS: > | Wide a | b | c | > |---+---+---| > | 1 | 2 | 3 | > | 4 | 5 | 6 | > |---+---+---| > | 7 | 8 | 9 | >=20 > #+begin_src python=20 > return [ > ["Wide a", "b", "c"], > None, > [1, 2, 3], > [4, 5, 6], > None, > [7, 8, 9] > ] > #+end_src >=20 > #+RESULTS: > | Wide a | b | c | > |--------+---+---| > | 1 | 2 | 3 | > | 4 | 5 | 6 | > |--------+---+---| > | 7 | 8 | 9 | >=20 > By the way, the org version loaded this time is 9.5.3 (9.5.3-g277897 @ = /Users/stanton/.emacs.d/straight/build/org/). >=20 > The table exports OK, but isn=E2=80=99t much fun to look at in the org = file itself. >=20 > Since I like to use emacs-jupyter, any suggestions would be = appreciated. I know this worked fine just a few weeks ago. >=20 > Thanks! >=20 > Richard Stanton >=20 >=20 >=20 >=20 >=20 --Apple-Mail=_F477D147-5E00-44B1-A970-214F21C50E68 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Thanks for the suggestion, John. I=E2=80=99ve tried playing = around with this, and am I right that it seems to have trouble when = execution is asynchronous?

On May 18, 2022, at 1:16 PM, = John Kitchin <jkitchin@andrew.cmu.edu> wrote:

I use a function in an after execute hook for this: https://github.com/jkitchin/scimax/blob/master/scimax-org.el#L2= 05

This = works on a subtree, which has been fine for me. You could adapt it = to only work in the results section.

John
-----------------------------------
Professor John Kitchin (he/him/his)
Doherty = Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA = 15213
412-268-7803


On Wed, May 18, 2022 at 4:07 PM Richard Stanton = <rhstanton@berkeley.edu> wrote:
I=E2=80=99m running Emacs 28.1 under = macOS 12.4 and want to create tables from Python code blocks that can be = exported to either LaTeX or HTML. The simplest way to do this seems to = be to generate the output as an org table, and using the built-in = version of org (9.4.6 (9.4.6-798-g738759.dirty-elpaplus @ = /Users/stanton/.emacs.d/elpa/org-plus-contrib-20210929/)), this works = fine using either a python or emacs-jupyter code block:

#+begin_src jupyter-python
[
    ["Wide a", "b", "c"],
    None,
    [1, 2, 3],
    [4, 5, 6],
    None,
    [7, 8, 9]
]
#+end_src

#+RESULTS:
| Wide a | b | c |
|--------+---+---|
|      1 | 2 | 3 |
|      4 | 5 | 6 |
|--------+---+---|
|      7 | 8 | 9 |

#+begin_src python
return [
    ["Wide a", "b", "c"],
    None,
    [1, 2, 3],
    [4, 5, 6],
    None,
    [7, 8, 9]
]
#+end_src

#+RESULTS:
| Wide a | b | c |
|--------+---+---|
|      1 | 2 | 3 |
|      4 | 5 | 6 |
|--------+---+---|
|      7 | 8 | 9 |


To use the latest version of org, I change just two lines in my init.el = from

(straight-use-package '(org :type built-in))
(straight-use-package '(org-contrib :type built-in))

to

(straight-use-package '(org :type git :repo "https://code.orgmode.org/bzg/org-mode.git"))
= (straight-use-package '(org-contrib :type git :repo "https://git.sr.ht/~bzg/org-contrib=E2=80=9D))

Having done this, the python block still works fine, but the horizontal = lines in the jupyter-python block are no longer properly aligned with = the text:

#+begin_src jupyter-python
[
    ["Wide a", "b", "c"],
    None,
    [1, 2, 3],
    [4, 5, 6],
    None,
    [7, 8, 9]
]
#+end_src

#+RESULTS:
| Wide a | b | c |
|---+---+---|
| 1 | 2 | 3 |
| 4 | 5 | 6 |
|---+---+---|
| 7 | 8 | 9 |

#+begin_src python
return [
    ["Wide a", "b", "c"],
    None,
    [1, 2, 3],
    [4, 5, 6],
    None,
    [7, 8, 9]
]
#+end_src

#+RESULTS:
| Wide a | b | c |
|--------+---+---|
|      1 | 2 | 3 |
|      4 | 5 | 6 |
|--------+---+---|
|      7 | 8 | 9 |

By the way, the org version loaded this time is 9.5.3 (9.5.3-g277897 @ = /Users/stanton/.emacs.d/straight/build/org/).

The table exports OK, but isn=E2=80=99t much fun to look at in the org = file itself.

Since I like to use emacs-jupyter, any suggestions would be appreciated. = I know this worked fine just a few weeks ago.

Thanks!

Richard Stanton






= --Apple-Mail=_F477D147-5E00-44B1-A970-214F21C50E68--