* Cleaner Table Formatting when converting from Markdown to Latex? @ 2023-05-31 19:08 'RM' via pandoc-discuss [not found] ` <532e15c3-6027-45bd-b0ba-7393632f2dc9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: 'RM' via pandoc-discuss @ 2023-05-31 19:08 UTC (permalink / raw) To: pandoc-discuss [-- 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 --] ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <532e15c3-6027-45bd-b0ba-7393632f2dc9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: Cleaner Table Formatting when converting from Markdown to Latex? [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 1 sibling, 0 replies; 4+ messages in thread From: 'RM' via pandoc-discuss @ 2023-05-31 21:16 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 5398 bytes --] I believe I've figured it out. The bizarre table formatting can be prevented using `--columns=999` (or any other sufficiently high number.) Quoth the User's Guide: "If any line of the markdown source is longer than the column width (see --columns), then the table will take up the full text width and the cell contents will wrap, with the relative cell widths determined by the number of dashes in the line separating the table header from the table body." By setting columns to a sufficiently high number, this functionality will never be called. Unfortunately this also effectively disables wrapping for the latex output. ("--wrap=preserve" and "--wrap=none" still result in the tables having the above extra formatting. the columns argument itself must be changed.) The wayback machine suggests that this same feature was present in 2.16, so I'm still uncertain why this behavior changed across versions, unless it was just a bug that 2.16 *wasn't* doing this. On Wednesday, May 31, 2023 at 2:08:53 PM UTC-5 RM 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/9ffca686-3ae1-40d3-8da6-974c2b1c456dn%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 16525 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Cleaner Table Formatting when converting from Markdown to Latex? [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> 1 sibling, 1 reply; 4+ messages in thread From: John MacFarlane @ 2023-06-01 4:43 UTC (permalink / raw) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw 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 <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 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. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <92BA4BD2-C13C-4B5E-80BB-A8C7D3782FAC-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: Cleaner Table Formatting when converting from Markdown to Latex? [not found] ` <92BA4BD2-C13C-4B5E-80BB-A8C7D3782FAC-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2023-06-01 4:47 ` John MacFarlane 0 siblings, 0 replies; 4+ messages in thread From: John MacFarlane @ 2023-06-01 4:47 UTC (permalink / raw) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw 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 <fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 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. > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-06-01 4:47 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-05-31 19:08 Cleaner Table Formatting when converting from Markdown to Latex? 'RM' via pandoc-discuss [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
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).