From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.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 YLuLOk+if2e9aQEAqHPOHw:P1 (envelope-from ) for ; Thu, 09 Jan 2025 10:17:52 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id YLuLOk+if2e9aQEAqHPOHw (envelope-from ) for ; Thu, 09 Jan 2025 11:17:52 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rensoliemans.nl header.s=soverin header.b=Dgj4jZhj; 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=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736417871; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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:dkim-signature; bh=TatUvphLzi+ma0u7nMxUe5fvISgBhAZgvX4H+co66A8=; b=tufeWEywiZB3rKc5TPWDvKnEf2XSpTcVi4CrFcNU9HM7v8W8EWCo30fi/Aj2kBHrUV+UP9 6fFea0HZYh9eT7pAMfVTPYvQqBDVPXeM9ko4TqnUs6tmbipBapjpky+Ob4PyiaTdbQmecI rDDnWrE2X+Joyo7+vagmkXzCGX2dMtdl7eHcmFyTsy403Phk3q6EVbnAFvv6kIO87Tvupm k7Y96VRx6cgEB+v52KyAD6FRnTpHf1YeWMuNcQLuTvaVDuMTpWAdz1RW2xNCjfAEAMqts7 Ix6JQI5VokvDJJiv1Q7IFH+xq3PaAuGRfOplTObPURpMhX2e9yEFhWeKpfLqww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rensoliemans.nl header.s=soverin header.b=Dgj4jZhj; 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=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736417871; a=rsa-sha256; cv=none; b=BcW/x8b9OPAGkMVAdBqK9Qrggl6bT5CEoJUxjMbVLE80R4Ro4PC17nXB/5fC9BqmjeGoQM ocjP/qFPU/x2+XZl46t8OF8rgy4wTpYbt/yZvaDpyzktK+BjFr2sY3KWTS3ckyMVrKTlTo FhSSnRun870SvULr47DGi3++FIRak4BKqxJNq+3EeDN31mWfJmqnMgPBlZiyNKU8ZNBMuw xwJNYjOZTUJ71Ua/rCDs3cJKKbdGpPGVMjabnLZd6nhv6J+A0LygXVObmq65ZoUGVEz17e P5fnRpPqPs/jfE6wgSNOXx24Hf6q/KS9QIg1voSJGEtJfEGozjzPJoZxRQKwLw== 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 488EC5922D for ; Thu, 09 Jan 2025 11:17:51 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVpaw-0006be-Dz; Thu, 09 Jan 2025 05:16:54 -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 1tVpau-0006bR-8F for emacs-orgmode@gnu.org; Thu, 09 Jan 2025 05:16:52 -0500 Received: from outbound.soverin.net ([2a10:de80:1:4091:b9e9:2212:0:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVpar-0000P1-L2 for emacs-orgmode@gnu.org; Thu, 09 Jan 2025 05:16:51 -0500 Received: from smtp.soverin.net (c04cst-smtp-sov02.int.sover.in [10.10.4.100]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 4YTLKt5FFBz4y; Thu, 9 Jan 2025 10:16:34 +0000 (UTC) Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.100]) by soverin.net (Postfix) with ESMTPSA id 4YTLKs6RQdzV0; Thu, 9 Jan 2025 10:16:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rensoliemans.nl; s=soverin; t=1736417794; bh=UZCDuo67HzTLiL5+AoQXrBzXWgDnsYAa/h+a1xcUr/Q=; h=From:To:Subject:In-Reply-To:References:Date:From; b=Dgj4jZhjtrHfuFJOkv+GP6uiMPr1ejm1d84mdywBArYEkBViZjyYkeOADi6ew50iL cFau8a+hybxqwTmz+KaqL4zyQl9AQj2qrLqvULb46g0BWewsOrqX36PF5lkNYmIiPB QzAIiGifjGfMmynKFhbhfFNfbGWxfPurY0Ts6mdGjS9eLV/iDSdEd0lQNCsFqw3bcs UsdadzE7IWSHnAcRJCuAjWeVP4Pz/UxhVS/tqwyxI6474hz74w8bg3++ITO6vOz6HF Q3zoITOi1yZJUeGF1ZZAUgAUxNhIhRkrzVCfYSepQyG4fVfud9xFlsMcgNcP5xEKAg ay5EFTsBwza6w== X-CMAE-Score: 0 X-CM-Envelope: MS4xfJZA3B0hrDc7WuPLxeiCoJWzoo7W68EX15aL2f3d1tu63VNQM8NVGUcwDgEsOtax6mChTmLIByPjKuf2xQiDXjEIcAGcqb6MnRq/A13a2jaIX6OEm261 13796MnO84E01k9QzEO95uoHQFZ5hjc0HqqL23ZJhyzOsmwXmOgZpU5pytfuPSyRoRuDNbz9WxuLxxI0ct1UqW61qIUcy8gvOpbzu2yHP9Ice71hUBKahhA+ LmglvflFHeXZK61jL5Qqez/a9SXYyi8ujHNR8gadKfdJQzlWTxJaT1rx2pK7Hxgs X-CM-Analysis: v=2.4 cv=UsCZN/wB c=1 sm=1 tr=0 ts=677fa202 a=4bom3OyIvp8zk49k3DLuvQ==:617 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=JPJs1pkuyIjK3aOEPOcA:9 a=QEXdDO2ut3YA:10 From: Rens Oliemans To: Richard H Stanton , emacs-orgmode@gnu.org Subject: Re: How to specify column alignment in LaTeX table output? In-Reply-To: References: Date: Thu, 09 Jan 2025 11:17:25 +0100 Message-ID: <87wmf4qoju.fsf@rensoliemans.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spampanel-Class: ham Received-SPF: pass client-ip=2a10:de80:1:4091:b9e9:2212:0:1; envelope-from=hallo@rensoliemans.nl; helo=outbound.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_PASS=-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: 488EC5922D X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -0.97 X-Spam-Score: -0.97 X-TUID: y/mKK/1xyQ5X Richard H Stanton writes: > Here=E2=80=99s a table in my org document: > > #+ATTR_LATEX: :align rrrr :options [htbp] > #+begin_table > |-------+--------+-----------+------------| > | Tier | Number | Total | % of Total | > |-------+--------+-----------+------------| > | 1 | 4 | 8,700.00 | 57.39 | > | 2 | 19 | 5,398.00 | 35.61 | > | 3 | 24 | 1,061.40 | 7.00 | > |-------+--------+-----------+------------| > | Total | 47 | 15,159.40 | 100.00 | > |-------+--------+-----------+------------| > #+end_table > > I want all the columns to be right-aligned (as they are in the org docume= nt), but when exported to LaTeX/PDF, the =E2=80=9CTotal=E2=80=9D column in = the output table is left aligned instead. Here=E2=80=99s the relevant secti= on of the .tex document generated during PDF export: Remove the #+begin_table and #+end_table parts: table isn't a valid block t= ype. 'C-C C-,' (org-insert-structure-template) shows you what blocks are valid. A table is simply defined via lines starting with '|'. This should work: #+ATTR_LATEX: :align rrrr |-------+--------+-----------+------------| | Tier | Number | Total | % of Total | |-------+--------+-----------+------------| | 1 | 4 | 8,700.00 | 57.39 | | 2 | 19 | 5,398.00 | 35.61 | | 3 | 24 | 1,061.40 | 7.00 | |-------+--------+-----------+------------| | Total | 47 | 15,159.40 | 100.00 | |-------+--------+-----------+------------| Also, I think your :options is a bit weird. Your exported LaTeX code seems = fine, but that's a side effect of you having the #+begin_table blocks, I _think_ = Org creates a special 'table' environment based on your block name ('table'), w= hich makes your :options work. See "(org) Special blocks in LaTeX export" in the manual. To make your desired placement work with a "correct" table, see "(org) Tabl= es in LaTeX export" and the documentation of ':placement': =E2=80=98:float=E2=80=99 =E2=80=98:placement=E2=80=99 The table environments by default are not floats in LaTeX. To make them floating objects use =E2=80=98:float=E2=80=99 with one of the= following options: =E2=80=98t=E2=80=99 (for a default =E2=80=98table=E2=80= =99 environment), =E2=80=98sideways=E2=80=99 (for a =E2=80=98sidewaystable=E2=80=99 environment), =E2=80=98multicolumn= =E2=80=99 (to span the table across multiple columns of a page in a =E2=80=98table*=E2=80=99 en= vironment) and =E2=80=98nil=E2=80=99. In addition to these three values, =E2=80= =98:float=E2=80=99 can pass through any arbitrary value, for example a user-defined float type with the =E2=80=98float=E2=80=99 LaTeX package. LaTeX floats can also have additional layout =E2=80=98:placement= =E2=80=99 attributes. These are the usual =E2=80=98[h t b p ! H]=E2=80=99 p= ermissions specified in square brackets. Note that for =E2=80=98:float sidew= ays=E2=80=99 tables, the LaTeX export backend ignores =E2=80=98:placement=E2=80= =99 attributes. I think that this org snippet is what you are looking for: #+ATTR_LATEX: :align rrrr :float t :placement [htbp] |-------+--------+-----------+------------| | Tier | Number | Total | % of Total | |-------+--------+-----------+------------| | 1 | 4 | 8,700.00 | 57.39 | | 2 | 19 | 5,398.00 | 35.61 | | 3 | 24 | 1,061.40 | 7.00 | |-------+--------+-----------+------------| | Total | 47 | 15,159.40 | 100.00 | |-------+--------+-----------+------------| --=20 Best, Rens