From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id gN8dD9O6gGdiKwEAe85BDQ:P1 (envelope-from ) for ; Fri, 10 Jan 2025 06:14:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id gN8dD9O6gGdiKwEAe85BDQ (envelope-from ) for ; Fri, 10 Jan 2025 07:14:43 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=KMMYjqX3; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736489683; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=wqq5zLjDGuwx+WWLEOx8Qv7EwPFXlfFXsGx3xPHGOqI=; b=uoa9WXIfbq6CcXFaQWnjsL7YoXiqHA166rNXVhp1EOtXzrXNw4+KHaD67ofSdteb4X4E/E GEb9pv/+Azr+F02SYVvFt9E4xzPpACGpmwWV9SpYQjVawzJUQiAhDS3AkcaKOF1OBYIt1d TmUiBBpKBSG/Kg0OQ/n212jgb1HQnovUyPL9IDieBKQewIfWr92MUkz88FYm2qUFvDOQdT rFmjF9Ad176fye/swLcUTJXEamQC3/cOu/wa8RzceKI+O9e8N0Kmem5wVWyy7gpv87+ZN1 ZbnxbkhmfdwnMWxIeLa8NVNvunqP+kupVPfC0ORbYJF2a59Cs1takuOH+cQkoQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=KMMYjqX3; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736489683; a=rsa-sha256; cv=none; b=qFLh03nl6Eih+CezrDp/1FVDvuJBxVZ/IOheLutm7WbgVarukf1OZEfuMTtz772F4zke7S CIF0Vokap7VxcGjao9XOJ0Q/Ih+B0PIrkEv4vEvdEN2Rtkbm9dYKSco2psZHtvkoDuROeX 9MML4EHcqTi82v5qAOoGuB5X1FFunYcfMQssU+FiYu69WStwSicXUghrRmwfhW7zZZkLcY 8iYr/ynJ6tyavGFGBAFwHst8U2oqoIdY3aPSfrFaGuAJfTEO1p18zgsntGJzDxwLKEojr7 gEp2haZQbyOSoBbqmsRnwHWsXwcejWDiXSvmZgQWxk81HazQ+WoNG/rkzz2iVA== 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 E42057A008 for ; Fri, 10 Jan 2025 07:14:42 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tW8HF-0008K1-Av; Fri, 10 Jan 2025 01:13:49 -0500 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 1tW8HE-0008Js-B4 for emacs-orgmode@gnu.org; Fri, 10 Jan 2025 01:13:48 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tW8HC-0008Vv-H7 for emacs-orgmode@gnu.org; Fri, 10 Jan 2025 01:13:48 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5d0ac27b412so2049027a12.1 for ; Thu, 09 Jan 2025 22:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736489624; x=1737094424; darn=gnu.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=wqq5zLjDGuwx+WWLEOx8Qv7EwPFXlfFXsGx3xPHGOqI=; b=KMMYjqX3Kt8z68zt19MyV+2SICDWeeCE8jPa9H7a4+8bUxptwf5rwP1qoY2qaQTBB/ Irw7N4JcZkyoqaHzI887x8s9pggNF9B9o6E5r8k56ZQoyGHYnL78ZvwtPW1me04JVQx0 5gdqhusQbYV8KQxZ12ARLCdbwN3QQPAcTG/x3WJUdFZcuqPbBnVvFiNNF7bY1blMBZXB y1Vah1jZrwH8uCIFAG5DwnCn538mFMaYNnf5JkeOPesRpa4oui2qKrNTmBwGQUzx3LOB wq/69/Kp5gSG85Ta6y4yAwAcjr90/F8lfiBvvZLwe03IqYCZ6k4JHypUZ/MZHS+V5iTF OMUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736489624; x=1737094424; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=wqq5zLjDGuwx+WWLEOx8Qv7EwPFXlfFXsGx3xPHGOqI=; b=wCjJAASj5bVVwGz/3Bj+rMfNywN7/MJO0raGtmEgI5EinbzfX8i176+xW5Wn0otvfE UoL8OhuJnF0A1r2e0vArOiQya+Ddx9K1q88w9xkwOgLeBuaBATkzQUhfVv0X3BdctKpk /KzPKXNcxmA1elUxXg30I0Pj38ODYVx/Rgy9e1G91RN/rdDQoMt9ZpAzvoCN5hgjhCh5 aeQGu81FngAlDMoQQUlO9+m6OrRCZz/b163ynHsRT3pi1uyaq6hxAGi/Uy44X0LkdM7U 7eGvfkliFmywGYAIxWBGbia9ARNuaYm3hxhc7WhTd9WZmoxWA4ETw6+88aa8MiFJxHNY +5Qw== X-Gm-Message-State: AOJu0YzKF64LybdY/5XJ/SWbW66S6BHJxqjOgeV63RgNn8WKyrOPmp54 rJjw6DhVUgxv8elHZOPeFD5WuPkSdNCBsF/ilLa6I7gHgG4YB4H3pksB54kag+AlSE8cZOhYWeQ botx5ODx3gu6nIRfSynsKG7JnNf0= X-Gm-Gg: ASbGncuSNghBIOzuPwFKn1EaOPXkC94SKzoFiWWkkHP0TeGo+kpj44fnF3jb+IPtszK /TPiaqyEkZwCEMo413r54AbV8Vjfp005VmB4l+g== X-Google-Smtp-Source: AGHT+IG6Af0ua76uJBcRDfdUDqxkkBodB3np0Lwl6lFG1Rh7kXGcMud5lXXHLDPgmJUv+Iwd13zKskfRfApC1szp5GU= X-Received: by 2002:a05:6402:42d2:b0:5d0:d18f:cc64 with SMTP id 4fb4d7f45d1cf-5d972dfb3b8mr8319829a12.4.1736489624054; Thu, 09 Jan 2025 22:13:44 -0800 (PST) MIME-Version: 1.0 From: Pedro Andres Aranda Gutierrez Date: Fri, 10 Jan 2025 07:13:18 +0100 X-Gm-Features: AbW1kvbt70W8zw9VnArmUSDo-JeVANKHaNY86K85XTo-ydYAusfcAQxEJ4aKhts Message-ID: Subject: Re: Re: How to specify column alignment in LaTeX table output? To: hallo@rensoliemans.nl, rhstanton@berkeley.edu Cc: Org Mode List Content-Type: multipart/alternative; boundary="00000000000032b0bb062b53ffa2" Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paaguti@gmail.com; helo=mail-ed1-x532.google.com 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=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.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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: E42057A008 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: 1.54 X-Spam-Score: 1.54 X-TUID: ToTl1qnN6aZ/ --00000000000032b0bb062b53ffa2 Content-Type: text/plain; charset="UTF-8" Hi, For org tables generated in Python, I use python-tabulate. Actually, I forked the original library to include the possibility of generating the latex attributes from Python too. Something like: --- cut here --- #+BEGIN_SRC python :results value raw :exports results import math import pandas as pd import tabulate xvals = [math.pi * i / 5 for i in range(10)] df = pd.DataFrame({ 'x': xvals, 'sin(x)' : [math.sin(xvals[i]) for i in range (10)], 'cos(x)' : [math.cos(xvals[i]) for i in range (10)] }) attrs=':environment longtable :align p{2cm}p{2cm}p{2cm} :placement [h] :center t' return tabulate.tabulate( df, headers=df.columns, tablefmt='orgtbl', floatfmt=".3f", caption='Table exported from Python with extended tabulate', label='labextend', attr_latex=attrs, showindex=False) #+END_SRC #+RESULTS: --- cut here --- Take a look at https://github.com/paaguti/python-tabulate if it sounds interesting. CAVEAT: the author of python-tabulate wasn't very excited about this ;-) Best, /PA -- Fragen sind nicht da, um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler Headaches with a Juju log: unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run a leader-deposed hook here, but we can't yet --00000000000032b0bb062b53ffa2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

For org tables generated= in Python, I use python-tabulate. Actually, I forked the original library = to include the possibility of generating the latex attributes from Python t= oo.

Something like:

--- c= ut here ---
#+BEGIN_SRC python :results value raw :exports result= s
import math
import pandas as pd
import tabulate

xvals =3D= [math.pi * i / 5 for i in range(10)]
df =3D pd.DataFrame({
=C2=A0 = =C2=A0 'x': xvals,
=C2=A0 =C2=A0 'sin(x)' : [math.sin(xv= als[i]) for i in range (10)],
=C2=A0 =C2=A0 'cos(x)' : [math.cos= (xvals[i]) for i in range (10)]
})

attrs=3D':environment long= table :align p{2cm}p{2cm}p{2cm} :placement [h] :center t'
return tab= ulate.tabulate(
=C2=A0 =C2=A0 df,
=C2=A0 =C2=A0 headers=3Ddf.columns,= tablefmt=3D'orgtbl', floatfmt=3D".3f",
=C2=A0 =C2=A0 = caption=3D'Table exported from Python with extended tabulate',
= =C2=A0 =C2=A0 label=3D'labextend',
=C2=A0 =C2=A0 attr_latex=3Dat= trs,
=C2=A0 =C2=A0 showindex=3DFalse)
#+END_SRC
#+RESULTS:
--- cut here ---

Take a look at https://github.com/paaguti/pyth= on-tabulate if it sounds interesting.=C2=A0

CA= VEAT: the author of python-tabulate wasn't very excited about this ;-)<= /div>

Best, /PA
--
Frage= n sind nicht da, um beantwortet zu werden,
Fragen sind da um geste= llt zu werden
Georg Kreisler

Headaches wi= th a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter= .operation we should run a leader-deposed hook here, but we can't yet
--00000000000032b0bb062b53ffa2--