From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32734 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Cleaner Table Formatting when converting from Markdown to Latex? Date: Wed, 31 May 2023 21:47:52 -0700 Message-ID: References: <532e15c3-6027-45bd-b0ba-7393632f2dc9n@googlegroups.com> <92BA4BD2-C13C-4B5E-80BB-A8C7D3782FAC@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31795"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDW7ZIEHTIIBB66F4CRQMGQETHTYIRY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 01 06:47:58 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f63.google.com ([209.85.160.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1q4aEA-00084c-9U for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 01 Jun 2023 06:47:58 +0200 Original-Received: by mail-oa1-f63.google.com with SMTP id 586e51a60fabf-19f9a0f9936sf589556fac.1 for ; Wed, 31 May 2023 21:47:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685594877; cv=pass; d=google.com; s=arc-20160816; b=BgpqgAhhGDaTTo6erzdVOVwu1eHXGJJmZ+0S7ZKAwFixjoWHxaoCCVmlfP/awvXE12 CAhjmTfwj1Naq5lFdXvcjgk5MR4NubKXCoOhTK7FVB2Uk80BaDRc5nzRqk3e3j1EbLhV ktnBKrGWaCjy3gmOQ0NLlFTLg8na3rvuWvJjkP+jg6bwBZFC4PLbQ5GLnrkJiqJhLT0Y qe3ERsP95rZPgFlqZi5OT8J655RHfWPPiL0qa+AkELLgAxg2mZoG/Vu9DtBsB7eJbqvp q262wwZqF0v6LAlvIbIBUrTqLrZQuQeYC2cf+YfDWZ2pKN4x0zt8JqDwHO6exjKNgX5z 0LSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:message-id:in-reply-to:to :references:date:subject:mime-version:from:sender:dkim-signature :dkim-signature; bh=IhMTiLR/fS6oGEEkPBlU73pAYyv2NggOioJUlLWqHQY=; b=vEUt9w74W4vOtcOg6vz87tWCs52cM9ojlSHunF1739Wq5yifHx14xP4okMKxEbMbIG Z9/cE2D948FpsbABZeXUSaKXyZupmzp6VP8cYRc19kM9/mdmYK+WoeyycBe3chRjp7N+ 4osYCowP979UWUNWlKb3yq7hp/O0yRUXzpmugL8n6ld3E4YGArwnBz1W6NCRcvNyE84s qGWft6GY2TBALKNASdHobLxc+n5MoNxM68RqkOtmq1wMrLLCOqLICCI1cwRBjqjiekDr B1ODJdEhWnbL0e2YUZ7RFur+Gk/m2hmojsnHx9/fQZGHd5Vs0X/2+P6EZ3G9Elefjmer sJWw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=M+5rucIU; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::336 as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1685594877; x=1688186877; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version:from:sender :from:to:cc:subject:date:message-id:reply-to; bh=IhMTiLR/fS6oGEEkPBlU73pAYyv2NggOioJUlLWqHQY=; b=ZqkoAZEIDAtRPxP0W3UdQaWb7+yWFoAOYfFBO2yiNM6762vMYM2Pbt9kq6N6ZOTkFc vcNhDWBdPaIs3DIQXmar5o11FU+dhBCgJiEYDBE1YA79D3966zdlgRislfv6ebACu9YX M2K0uHZupzv0cm1PpD8jbby3e6csT5UqsTA0xc9X3GN2HfWzQPj3yZERH6lER8CCmi42 VQP4wI4y6Z4O4M+xtHTKzejjAV5CeTojgLwCI6tthfLcrxa+74HRmmUkUp8A3RvWP5ma Imb4/3UHOnLLKjhrL3KZ6LD3QBnEIvD60JKAa/kHchIoqdCmaViywwtwYGYLvzKS+ZN7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685594877; x=1688186877; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version:from:from:to:cc :subject:date:message-id:reply-to; bh=IhMTiLR/fS6oGEEkPBlU73pAYyv2NggOioJUlLWqHQY=; b=GYI8pU9Cz/aANzH1U+BoTc4PklyMfQFJqy5eGDPuuKP3l89MFC7+1yovOhMKlBpkL3 +LVM1EQxEuivGGz4V8/uVEnz80w2zJ9JoAwylX8/ANEB1L0bG1mBvrXBWuWXueX9miba h65268O+1+/w4cqvUQ9zQJb0U25t0nZcvvXrp51nn0MM+CCLB9el0yAxJS1cJuE1PfxJ NCWed0AG806zlix9HhJ+TRQMUQsdEdMC+3vAA0S+wQrRT2T6JzPid5Pq8dkaF729pt6S N6xZlVUNIqqo00ts7Q9mc3yxFQb3vytfhqbpHINoOata09OtRF9F7zxcICrjtUYrqdTj 2MFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685594877; x=1688186877; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=IhMTiLR/fS6oGEEkPBlU73pAYyv2NggOioJUlLWqHQY=; b=GjaLaFy5FdrB6NEGdysWyP/8e7hO1vcQ15/ugw21T6Q42wHIA5eeSsiL3xhtC1GknL iBJUozkRdyaSfl2dKUE5Sc4hYZz5Ib5xC65sgL06+f4dA86LrgdQJFO+pQjq3xpbyjNR a4bw4A5qGFoT07OIwypOQZueNn3LJSO1HOi7zGI8LaNyEG7vz39GaJnsePiN6T+vlJId TcY0sxaYoON8XkhT4J437erno3VUEf4DYkyfAQlVlSjPikk4hterhCx9TmGZdA16rcZq X2ZbyX Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDzD/dIeHPu22PA8MTUFbEBstGRSycTUGaLoXMaXHjeihkSjaMOv DPJRZ95TdG5eMCaZUavkXn8= X-Google-Smtp-Source: ACHHUZ66Oz/OhxSbRwvD6rqxwZBr7ZeepY8KR/ylh2X8s1PdtHqq7V/Pl81VvC+hePjjSSTguuxo1A== X-Received: by 2002:a05:6871:40c:b0:19f:3818:346e with SMTP id d12-20020a056871040c00b0019f3818346emr2512051oag.8.1685594877157; Wed, 31 May 2023 21:47:57 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6871:6ab0:b0:187:a128:fe88 with SMTP id zf48-20020a0568716ab000b00187a128fe88ls764424oab.1.-pod-prod-07-us; Wed, 31 May 2023 21:47:54 -0700 (PDT) X-Received: by 2002:a05:6830:1d4f:b0:6b0:c8a0:c7e2 with SMTP id p15-20020a0568301d4f00b006b0c8a0c7e2mr4068986oth.20.1685594874776; Wed, 31 May 2023 21:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685594874; cv=none; d=google.com; s=arc-20160816; b=K6/in4sN50NFi7TylEb2MP/ijOn58TflqSrtxbgGWUiSd2/a3OT1W+MdHvdhb6+p4j RUrP76FST5p2Sb3FYumZhfmnRnPMKw0PZdSYKKkcSCSgJn9t8LSlHL9eOAM0OX0ejgX8 XrvuTX+IdVqZc0grCmlpSKU8Xorl10b6qRN7V+OfbAmhQHoSwPglGYLZdCugLQzWr+QS pXBhw7S2hz2QdDHu6kH6J6aMRj6tDZfPyz+f2B08zNdtCzgHINbyXbW/2R53nsovkxop kgWflWfX2v++t8YOVHr9y22JPBdcs14UlskArlzR9FgYKIFh02yNp4KgsaW+I2+TIGMU uS0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:dkim-signature; bh=21lAlyIdUuasHfQqnrtTphGK6fQFA4appgNFNF8fEvM=; b=zc2WXaITnvgfqNejN1883K2H6Eyju/pou/gNclh3fX4IjjJKYgObW8gIp3DXcO8s/i pZsk3PivJ6wcnpviQcuQzEdiwsJ+JHglatDBYF0/nE2rnKNPtMvZD+nLsGz26h6BUJ0U 9xRijl68bcHKVLwXoUygXJgV8X9U9fRn7jjBvVAIqXjl4oHYQTKiiKb75ogzHRgz4ipZ 8OUN481BkgE8PhH/p9Rx3J8/3lDSAAiVdulQomcoRnyyL78WbnfaEI9Qr1QpC5cML4FC cOelgvNtVO/XK3XEo7Z8mhHzK5xOhtMhJ6tSHsK2gVXmY5DWImh3fqb8zyNgLyPdMMSq ajFQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=M+5rucIU; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::336 as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com. [2607:f8b0:4864:20::336]) by gmr-mx.google.com with ESMTPS id j22-20020a056830271600b006afe159f693si366078otu.4.2023.05.31.21.47.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 May 2023 21:47:54 -0700 (PDT) Received-SPF: pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::336 as permitted sender) client-ip=2607:f8b0:4864:20::336; Original-Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6af81142b6dso462883a34.2 for ; Wed, 31 May 2023 21:47:54 -0700 (PDT) X-Received: by 2002:a9d:6196:0:b0:6af:a3f4:7897 with SMTP id g22-20020a9d6196000000b006afa3f47897mr4763797otk.1.1685594873977; Wed, 31 May 2023 21:47:53 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:644:4701:23f0:a03f:b9e3:e209:ea92]) by smtp.gmail.com with ESMTPSA id b19-20020aa78113000000b00640df8c536csm1673707pfi.12.2023.05.31.21.47.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2023 21:47:53 -0700 (PDT) In-Reply-To: <92BA4BD2-C13C-4B5E-80BB-A8C7D3782FAC-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> X-Mailer: Apple Mail (2.3696.120.41.1.3) X-Original-Sender: fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=M+5rucIU; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::336 as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:32734 Archived-At: PS. If you don't worry about the too-wide issue, then you can "fix" it with this lua filter: function Table(el) for _,spec in ipairs(el.colspecs) do spec[2] = nil -- set width to nil for a "simple" table end return el end > On May 31, 2023, at 9:43 PM, John MacFarlane wrote: > > You are getting relative widths specified because the table is wide. (Previously we didn't do this and people complained that their tables extended beyond the edge of the margin or even the page.) If the table is not wide, you get a simple table: > > \begin{longtable}[]{@{}lllll@{}} > \toprule\noalign{} > & Mon & Tue & Wed & Thu \\ > \midrule\noalign{} > \endhead > \bottomrule\noalign{} > \endlastfoot > Week 1 & Example & Example & Example & Example \\ > Week 2 & Example & Example & Example & Example \\ > Week 3 & Example & Example & Example & Example \\ > Week 4 & Example & Example & Example & Example \\ > \end{longtable} > > > >> On May 31, 2023, at 12:08 PM, 'RM' via pandoc-discuss wrote: >> >> Sometimes pandoc adds a load of undesired guff into the latex tables. >> >> Is there a way to signal to pandoc that I want it to "cleanly" convert the markdown tables to latex instead of adding all sorts of bizarre formatting? >> >> Example: >> >> Consider the following markdown table: >> >> | | Mon | Tue | Wed | Thu | Fri | Sat | Sun | Notes | >> |--------|---------|---------|---------|---------|---------|---------|---------|---------| >> | Week 1 | Example | Example | Example | Example | Example | Example | Example | Example | >> | Week 2 | Example | Example | Example | Example | Example | Example | Example | Example | >> | Week 3 | Example | Example | Example | Example | Example | Example | Example | Example | >> | Week 4 | Example | Example | Example | Example | Example | Example | Example | Example | >> >> >> Version 2.16 sensibly converts the markdown table to: >> >> \begin{longtable}[]{@{}lllllllll@{}} >> \toprule >> & Mon & Tue & Wed & Thu & Fri & Sat & Sun & Notes \\ >> \midrule >> \endhead >> Week 1 & Example & Example & Example & Example & Example & Example & >> Example & Example \\ >> Week 2 & Example & Example & Example & Example & Example & Example & >> Example & Example \\ >> Week 3 & Example & Example & Example & Example & Example & Example & >> Example & Example \\ >> Week 4 & Example & Example & Example & Example & Example & Example & >> Example & Example \\ >> \bottomrule >> \end{longtable} >> >> >> >> >> While the latest version (3.1.2) converts it to this mess: >> >> \begin{longtable}[]{@{} >>> {\raggedright\arraybackslash}p{(\columnwidth - 16\tabcolsep) * \real{0.1000}} >>> {\raggedright\arraybackslash}p{(\columnwidth - 16\tabcolsep) * \real{0.1125}} >>> {\raggedright\arraybackslash}p{(\columnwidth - 16\tabcolsep) * \real{0.1125}} >>> {\raggedright\arraybackslash}p{(\columnwidth - 16\tabcolsep) * \real{0.1125}} >>> {\raggedright\arraybackslash}p{(\columnwidth - 16\tabcolsep) * \real{0.1125}} >>> {\raggedright\arraybackslash}p{(\columnwidth - 16\tabcolsep) * \real{0.1125}} >>> {\raggedright\arraybackslash}p{(\columnwidth - 16\tabcolsep) * \real{0.1125}} >>> {\raggedright\arraybackslash}p{(\columnwidth - 16\tabcolsep) * \real{0.1125}} >>> {\raggedright\arraybackslash}p{(\columnwidth - 16\tabcolsep) * \real{0.1125}}@{}} >> \toprule\noalign{} >> \begin{minipage}[b]{\linewidth}\raggedright >> \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright >> Mon >> \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright >> Tue >> \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright >> Wed >> \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright >> Thu >> \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright >> Fri >> \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright >> Sat >> \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright >> Sun >> \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright >> Notes >> \end{minipage} \\ >> \midrule\noalign{} >> \endhead >> \bottomrule\noalign{} >> \endlastfoot >> Week 1 & Example & Example & Example & Example & Example & Example & >> Example & Example \\ >> Week 2 & Example & Example & Example & Example & Example & Example & >> Example & Example \\ >> Week 3 & Example & Example & Example & Example & Example & Example & >> Example & Example \\ >> Week 4 & Example & Example & Example & Example & Example & Example & >> Example & Example \\ >> \end{longtable} >> >> (And this isn't simply an issue with later versions. I've noticed 2.16 adds the guff to some tables, too. Though whatever algo it's using to make that choice differs between versions. ) >> >> >> I'd like all of my tables to be converted to the "clean" format. Is there an argument I can use to make that happen? >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/532e15c3-6027-45bd-b0ba-7393632f2dc9n%40googlegroups.com. >