From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WOaqIFiNMGEHAgEAgWs5BA (envelope-from ) for ; Thu, 02 Sep 2021 10:37:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 4LQSHFiNMGF/FwAAbx9fmQ (envelope-from ) for ; Thu, 02 Sep 2021 08:37:44 +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 CF23D23688 for ; Thu, 2 Sep 2021 10:37:43 +0200 (CEST) Received: from localhost ([::1]:35056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLiEA-0003Pe-3m for larch@yhetil.org; Thu, 02 Sep 2021 04:37:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLiDb-0003PR-2K for emacs-orgmode@gnu.org; Thu, 02 Sep 2021 04:37:07 -0400 Received: from mout01.posteo.de ([185.67.36.65]:58499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLiDW-0004XB-0t for emacs-orgmode@gnu.org; Thu, 02 Sep 2021 04:37:06 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 267B4240028 for ; Thu, 2 Sep 2021 10:36:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1630571817; bh=f2UUEKMHYcUIqa5zp9y2h1Ep5XNk3sT9vaViDE2gBb8=; h=From:To:Cc:Subject:Date:From; b=eZNd2CHJ9UR1B2zeRBVhyzWL5lOcWjLHnrhGIMEfiJYB0TRevv2eOODlCFH6182F9 zFPvTmF+gM+y4L25lYVSDs8ohXlklRdiYyokfDXiMwm1Irh9ae3NFyyfID+1dNOhN6 n7q3OKGmbq6fkTidXbVGDI4+0l1nfeImNiIFXjhaf6w8R6xXkL7xf9cLSZ+x1e2bu2 MA/K3a0ARksSWSBKmEtOg0zTJ7Q4zmLNe32Vx5teWNLNXB5OV175r6yMTIyJ9dkzJ8 AqDPoOHwFC+rnxrKpWibudYbCE0beEJZA2aSyIih145/HyfQ+pz60valxmRONqGbmm jAS0gok7OMspw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4H0Z6J2vxKz9rxV; Thu, 2 Sep 2021 10:36:56 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Vikas Rawal Subject: Re: Support for tabularray in LaTeX export References: Date: Thu, 02 Sep 2021 08:36:55 +0000 In-Reply-To: (Vikas Rawal's message of "Thu, 2 Sep 2021 06:12:43 +0530") Message-ID: <87ilzjgyqg.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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: orgmode 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=1630571863; 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=Gr+CDa+7BeyXvyY3xeY7Z70XX/guizSboOga7rVb5kA=; b=fmxN1MaAOzfAWE1yjgFiVFkddfCoTKS8LGRsO5EkXe8c5XOSVdFbVoIlErPFwhna7IBryy aQIu3dQ2wZ7LnVSv+abF2WBAl+GC/16pc7bVujwhRHCN9QYuBmLbzv5i+lBPZyF0297SgG fJhO0MpbaL1P6d3JxzJ9Sjr2/xvw03XbAuJSjJCtNz18glXa/pLZZnE7CNmptaFr85QpHC /0DAb3APubp9WpkJ6qG1yjIFEoEYt8RLALyg1Cbq+SpQDc9TDNPjGHAL4na8idhT3cgRxa FwVMPEuOO3jmrOsSVb50Jk1jn5nLW3oe6nFZUv/8z7Qc4kdR7WW63W42nqZ2kw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630571863; a=rsa-sha256; cv=none; b=hH5weBBwA4VCg4KpWvVu9/Y4W49npnsUwUpQishsdOoUDsTJniCWdT6EzHDA7S1Epx0gim XqHnuMOcpVAIgSJZIwDVno96iSAh5tRAO3wUQsI+1byCAP7dWRFF2wUbnpPRVnyZLbg4w1 kQ0lxyyTo6BDj3zW1XJrdYpzCFhcMXusW8S8JWz/NEap447vbwhubmRG9QZIRsJECO7Yj2 43MhwvalZvcIEwLZw6MElRbHh4vZrp+GMZyjmdVxqyvtlJt40jE2oTuET/EdBrkwPdq4A9 0G3iKNU0o8RBRlL9mFYy1pgiJWLbfxSW7ts/LtssoWgr5kpbjbIffpcEEkr6rw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=eZNd2CHJ; 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: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=eZNd2CHJ; dmarc=pass (policy=none) header.from=posteo.net; 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: CF23D23688 X-Spam-Score: -3.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: QkdcuPMZVEil Hi Vikas, You can define a modified version of `org-latex--org-table', adding a new LaTeX attribute `:options'. Something like this: #+begin_src emacs-lisp (defun my/org-latex--org-table (table contents info) "Return appropriate LaTeX code for an Org table. TABLE is the table type element to transcode. CONTENTS is its contents, as a string. INFO is a plist used as a communication channel. This function assumes TABLE has `org' as its `:type' property and `table' as its `:mode' attribute." (let* ((attr (org-export-read-attribute :attr_latex table)) (alignment (org-latex--align-string table info)) (opt (org-export-read-attribute :attr_latex table :options)) (table-env (or (plist-get attr :environment) (plist-get info :latex-default-table-environment))) (width (let ((w (plist-get attr :width))) (cond ((not w) "") ((member table-env '("tabular" "longtable")) "") ((member table-env '("tabu" "longtabu")) (format (if (plist-get attr :spread) " spread %s " " to %s ") w)) (t (format "{%s}" w))))) (caption (org-latex--caption/label-string table info)) (above? (org-latex--caption-above-p table info))) (cond ((member table-env '("longtable" "longtabu")) (let ((fontsize (let ((font (plist-get attr :font))) (and font (concat font "\n"))))) (concat (and fontsize (concat "{" fontsize)) (format "\\begin{%s}%s{%s}\n" table-env width alignment) (and above? (org-string-nw-p caption) (concat caption "\\\\\n")) contents (and (not above?) (org-string-nw-p caption) (concat caption "\\\\\n")) (format "\\end{%s}" table-env) (and fontsize "}")))) (t (let ((output (format "\\begin{%s}%s%s{%s}\n%s\\end{%s}" table-env (if opt opt "") width alignment contents table-env))) (org-latex--decorate-table output attr caption above? info)))))) (advice-add 'org-latex--org-table :override #'my/org-latex--org-table) #+end_src and then: #+ATTR_LATEX: :environment longtblr #+ATTR_LATEX: :align #+ATTR_LATEX: :booktabs t #+ATTR_LaTeX: :options [] Best regards, Juan Manuel Vikas Rawal writes: > tabularray (CTAN: Package tabularray) provides longtblr environment > that is called as > > --- > \begin{longtblr}[various-table-options]{column and row specifications} > > \end{longtblr} > --- > > Adding something like the following to orgmode tables makes them > export nicely as longtblr > > --- > #+ATTR_LATEX: :environment longtblr > #+ATTR_LATEX: :align width=0.8\textwidth,colspec={lX[2,r]X[3,r]X > [r,bg=gray9]} > #+ATTR_LATEX: :booktabs t > --- > > Everything seems to work very well with orgmode except that I cannot > figure out how to pass [various table options] from orgmode. These > table options include, most importantly, table notes. > > I normally use threeparttable for table notes, but longtblr does not > seem to work with threeparttable and has its own syntax for table > notes. > > Any advice on how to pass [table-options] to longtblr environment? > > Vikas >