public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "'RM' via pandoc-discuss" <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Cleaner Table Formatting when converting from Markdown to Latex?
Date: Wed, 31 May 2023 12:08:53 -0700 (PDT)	[thread overview]
Message-ID: <532e15c3-6027-45bd-b0ba-7393632f2dc9n@googlegroups.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 3995 bytes --]

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.

[-- Attachment #1.2: Type: text/html, Size: 15419 bytes --]

             reply	other threads:[~2023-05-31 19:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 19:08 'RM' via pandoc-discuss [this message]
     [not found] ` <532e15c3-6027-45bd-b0ba-7393632f2dc9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-05-31 21:16   ` 'RM' via pandoc-discuss
2023-06-01  4:43   ` John MacFarlane
     [not found]     ` <92BA4BD2-C13C-4B5E-80BB-A8C7D3782FAC-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-06-01  4:47       ` John MacFarlane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=532e15c3-6027-45bd-b0ba-7393632f2dc9n@googlegroups.com \
    --to=pandoc-discuss-/jypxa39uh5tlh3mbocffw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).