public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Pandoc inserts line breaks between raw latex tables when generating TeX from markdown?
@ 2017-02-22 16:25 David Sanson
       [not found] ` <e762d5dd-bbd8-47e1-88bd-9f28801bf8c1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: David Sanson @ 2017-02-22 16:25 UTC (permalink / raw)
  To: pandoc-discuss


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

As of last fall, I'm pretty sure the following snippet of raw latex in one 
of my markdown logic handouts produced two tables side-by-side, with a bit 
of horizontal spacing in between:

~~~
\begin{tabular}[t]{cc|c}
\(P\) & \(Q\) & \(P\wedge Q\)\\
\hline
T & T &\\
T & F &\\
F & T &\\
F & F &\\
\end{tabular}
\hspace{1em}
\begin{tabular}[t]{cc|c}
\(P\) & \(Q\) & \(P\vee Q\)\\
\hline
T & T &\\
T & F &\\
F & T &\\
F & F &\\
\end{tabular}
~~~

As of this morning, this doesn't work. The tables are instead stacked 
vertically. That's because pandoc adds linebreaks between the two tables 
when it generates the TeX:

~~~
\begin{tabular}[t]{cc|c}
\(P\) & \(Q\) & \(P\wedge Q\)\\
\hline
T & T &\\
T & F &\\
F & T &\\
F & F &\\
\end{tabular}

\hspace{1em}

\begin{tabular}[t]{cc|c}
\(P\) & \(Q\) & \(P\vee Q\)\\
\hline
T & T &\\
T & F &\\
F & T &\\
F & F &\\
\end{tabular}
~~~

Is this new behavior intentional? Is there an easy way to disable it?

Thanks,
David

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e762d5dd-bbd8-47e1-88bd-9f28801bf8c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pandoc inserts line breaks between raw latex tables when generating TeX from markdown?
       [not found] ` <e762d5dd-bbd8-47e1-88bd-9f28801bf8c1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-02-23 11:06   ` John MacFarlane
       [not found]     ` <20170223110650.GF76523-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: John MacFarlane @ 2017-02-23 11:06 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

The problem is that \hspace{1em} is parsed as an inline
element rather than a block; so, it creates a new element
in between the two raw blocks.  Blocks are printed with
blanks between them, so...

Obviously in this particular case it would make sense to
include the \hspace as part of the block, but in general
\hspace can be an inline element.  Maybe some better
heuristics could be developed for interpreting this kind
of amphibious element.

For the motivation for the change see

commit 2873cd82886d1fa557bf3abde37b5ceb3cadf40c
Author: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
Date:   Sat Nov 26 21:27:56 2016 +0100

    LaTeX reader: don't treat `\vspace` and `\hspace` as block commands.

    Fixed an error which came up, for example, with `\vspace`
    inside a caption.  (Captions expect inlines.)

    Closes #3256.


It's possible that this change causes more problems than it
solves.  What do people think, and is there a good workaround?

+++ David Sanson [Feb 22 17 08:25 ]:
>As of last fall, I'm pretty sure the following snippet of raw latex in one
>of my markdown logic handouts produced two tables side-by-side, with a bit
>of horizontal spacing in between:
>
>~~~
>\begin{tabular}[t]{cc|c}
>\(P\) & \(Q\) & \(P\wedge Q\)\\
>\hline
>T & T &\\
>T & F &\\
>F & T &\\
>F & F &\\
>\end{tabular}
>\hspace{1em}
>\begin{tabular}[t]{cc|c}
>\(P\) & \(Q\) & \(P\vee Q\)\\
>\hline
>T & T &\\
>T & F &\\
>F & T &\\
>F & F &\\
>\end{tabular}
>~~~
>
>As of this morning, this doesn't work. The tables are instead stacked
>vertically. That's because pandoc adds linebreaks between the two tables
>when it generates the TeX:
>
>~~~
>\begin{tabular}[t]{cc|c}
>\(P\) & \(Q\) & \(P\wedge Q\)\\
>\hline
>T & T &\\
>T & F &\\
>F & T &\\
>F & F &\\
>\end{tabular}
>
>\hspace{1em}
>
>\begin{tabular}[t]{cc|c}
>\(P\) & \(Q\) & \(P\vee Q\)\\
>\hline
>T & T &\\
>T & F &\\
>F & T &\\
>F & F &\\
>\end{tabular}
>~~~
>
>Is this new behavior intentional? Is there an easy way to disable it?
>
>Thanks,
>David
>
>-- 
>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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e762d5dd-bbd8-47e1-88bd-9f28801bf8c1%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pandoc inserts line breaks between raw latex tables when generating TeX from markdown?
       [not found]     ` <20170223110650.GF76523-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
@ 2017-02-24 16:18       ` BP Jonsson
       [not found]         ` <CAFC_yuSvfr-onySRjXaWkJfDFcrwL=AHmnJSabks2bo5psXn5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: BP Jonsson @ 2017-02-24 16:18 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 4207 bytes --]

You can probably fix this by defining a dummy LaTeX environment which does
nothing and wrap it around your raw LaTeX to 'hide' the latter from pandoc.

/bpj


Den 23 feb 2017 12:07 skrev "John MacFarlane" <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:

> The problem is that \hspace{1em} is parsed as an inline
> element rather than a block; so, it creates a new element
> in between the two raw blocks.  Blocks are printed with
> blanks between them, so...
>
> Obviously in this particular case it would make sense to
> include the \hspace as part of the block, but in general
> \hspace can be an inline element.  Maybe some better
> heuristics could be developed for interpreting this kind
> of amphibious element.
>
> For the motivation for the change see
>
> commit 2873cd82886d1fa557bf3abde37b5ceb3cadf40c
> Author: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
> Date:   Sat Nov 26 21:27:56 2016 +0100
>
>    LaTeX reader: don't treat `\vspace` and `\hspace` as block commands.
>
>    Fixed an error which came up, for example, with `\vspace`
>    inside a caption.  (Captions expect inlines.)
>
>    Closes #3256.
>
>
> It's possible that this change causes more problems than it
> solves.  What do people think, and is there a good workaround?
>
> +++ David Sanson [Feb 22 17 08:25 ]:
>
>> As of last fall, I'm pretty sure the following snippet of raw latex in one
>> of my markdown logic handouts produced two tables side-by-side, with a bit
>> of horizontal spacing in between:
>>
>> ~~~
>> \begin{tabular}[t]{cc|c}
>> \(P\) & \(Q\) & \(P\wedge Q\)\\
>> \hline
>> T & T &\\
>> T & F &\\
>> F & T &\\
>> F & F &\\
>> \end{tabular}
>> \hspace{1em}
>> \begin{tabular}[t]{cc|c}
>> \(P\) & \(Q\) & \(P\vee Q\)\\
>> \hline
>> T & T &\\
>> T & F &\\
>> F & T &\\
>> F & F &\\
>> \end{tabular}
>> ~~~
>>
>> As of this morning, this doesn't work. The tables are instead stacked
>> vertically. That's because pandoc adds linebreaks between the two tables
>> when it generates the TeX:
>>
>> ~~~
>> \begin{tabular}[t]{cc|c}
>> \(P\) & \(Q\) & \(P\wedge Q\)\\
>> \hline
>> T & T &\\
>> T & F &\\
>> F & T &\\
>> F & F &\\
>> \end{tabular}
>>
>> \hspace{1em}
>>
>> \begin{tabular}[t]{cc|c}
>> \(P\) & \(Q\) & \(P\vee Q\)\\
>> \hline
>> T & T &\\
>> T & F &\\
>> F & T &\\
>> F & F &\\
>> \end{tabular}
>> ~~~
>>
>> Is this new behavior intentional? Is there an easy way to disable it?
>>
>> Thanks,
>> David
>>
>> --
>> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/pandoc-discuss/e762d5dd-bbd8-47e1-88bd-9f28801bf8c1%40go
>> oglegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/pandoc-discuss/20170223110650.GF76523%40Administrateurs-iMac-3.local.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAFC_yuSvfr-onySRjXaWkJfDFcrwL%3DAHmnJSabks2bo5psXn5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 6439 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pandoc inserts line breaks between raw latex tables when generating TeX from markdown?
       [not found]         ` <CAFC_yuSvfr-onySRjXaWkJfDFcrwL=AHmnJSabks2bo5psXn5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-02-24 21:22           ` David Sanson
  2017-02-25 11:51           ` John MacFarlane
  1 sibling, 0 replies; 5+ messages in thread
From: David Sanson @ 2017-02-24 21:22 UTC (permalink / raw)
  To: pandoc-discuss


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

On Friday, February 24, 2017 at 10:18:56 AM UTC-6, BP Jonsson wrote:
>
> You can probably fix this by defining a dummy LaTeX environment which does 
> nothing and wrap it around your raw LaTeX to 'hide' the latter from pandoc.
>

Thanks for the tip! Wrapping the raw LaTeX in 
`\begin{center}...\end{center}` did the trick for me in this case, so I 
didn't even need to define a dummy environment.

And thanks for the explanation, John. I'm afraid I don't have any 
constructive suggestions on how to handle these cases, 

>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/99dd288f-cb0b-4c94-8294-8880b1bfe583%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Pandoc inserts line breaks between raw latex tables when generating TeX from markdown?
       [not found]         ` <CAFC_yuSvfr-onySRjXaWkJfDFcrwL=AHmnJSabks2bo5psXn5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2017-02-24 21:22           ` David Sanson
@ 2017-02-25 11:51           ` John MacFarlane
  1 sibling, 0 replies; 5+ messages in thread
From: John MacFarlane @ 2017-02-25 11:51 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

I've made some changes to pandoc so that (I hope) \hspace
and \vspace will be interpreted as block elements in cases
like this.  David's original table code should work fine
with the latest version.

+++ BP Jonsson [Feb 24 17 17:18 ]:
>   You can probably fix this by defining a dummy LaTeX environment which
>   does nothing and wrap it around your raw LaTeX to 'hide' the latter
>   from pandoc.
>   /bpj
>
>   Den 23 feb 2017 12:07 skrev "John MacFarlane" <[1]jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:
>
>     The problem is that \hspace{1em} is parsed as an inline
>     element rather than a block; so, it creates a new element
>     in between the two raw blocks.  Blocks are printed with
>     blanks between them, so...
>     Obviously in this particular case it would make sense to
>     include the \hspace as part of the block, but in general
>     \hspace can be an inline element.  Maybe some better
>     heuristics could be developed for interpreting this kind
>     of amphibious element.
>     For the motivation for the change see
>     commit 2873cd82886d1fa557bf3abde37b5ceb3cadf40c
>     Author: John MacFarlane <[2]jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
>     Date:   Sat Nov 26 21:27:56 2016 +0100
>        LaTeX reader: don't treat `\vspace` and `\hspace` as block
>     commands.
>        Fixed an error which came up, for example, with `\vspace`
>        inside a caption.  (Captions expect inlines.)
>        Closes #3256.
>     It's possible that this change causes more problems than it
>     solves.  What do people think, and is there a good workaround?
>     +++ David Sanson [Feb 22 17 08:25 ]:
>
>     As of last fall, I'm pretty sure the following snippet of raw latex
>     in one
>     of my markdown logic handouts produced two tables side-by-side, with
>     a bit
>     of horizontal spacing in between:
>     ~~~
>     \begin{tabular}[t]{cc|c}
>     \(P\) & \(Q\) & \(P\wedge Q\)\\
>     \hline
>     T & T &\\
>     T & F &\\
>     F & T &\\
>     F & F &\\
>     \end{tabular}
>     \hspace{1em}
>     \begin{tabular}[t]{cc|c}
>     \(P\) & \(Q\) & \(P\vee Q\)\\
>     \hline
>     T & T &\\
>     T & F &\\
>     F & T &\\
>     F & F &\\
>     \end{tabular}
>     ~~~
>     As of this morning, this doesn't work. The tables are instead
>     stacked
>     vertically. That's because pandoc adds linebreaks between the two
>     tables
>     when it generates the TeX:
>     ~~~
>     \begin{tabular}[t]{cc|c}
>     \(P\) & \(Q\) & \(P\wedge Q\)\\
>     \hline
>     T & T &\\
>     T & F &\\
>     F & T &\\
>     F & F &\\
>     \end{tabular}
>     \hspace{1em}
>     \begin{tabular}[t]{cc|c}
>     \(P\) & \(Q\) & \(P\vee Q\)\\
>     \hline
>     T & T &\\
>     T & F &\\
>     F & T &\\
>     F & F &\\
>     \end{tabular}
>     ~~~
>     Is this new behavior intentional? Is there an easy way to disable
>     it?
>     Thanks,
>     David
>     --
>     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 [3]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>     To post to this group, send email to
>     [4]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>     To view this discussion on the web visit
>     [5]https://groups.google.com/d/msgid/pandoc-discuss/e762d5dd-bb
>     d8-47e1-88bd-9f28801bf8c1%40googlegroups.com.
>     For more options, visit [6]https://groups.google.com/d/optout.
>
>     --
>     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 [7]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>     To post to this group, send email to
>     [8]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>     To view this discussion on the web visit
>     [9]https://groups.google.com/d/msgid/pandoc-discuss/20170223110
>     650.GF76523%40Administrateurs-iMac-3.local.
>     For more options, visit [10]https://groups.google.com/d/optout.
>
>   --
>   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 [11]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [12]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [13]https://groups.google.com/d/msgid/pandoc-discuss/CAFC_yuSvfr-onySRj
>   XaWkJfDFcrwL%3DAHmnJSabks2bo5psXn5A%40mail.gmail.com.
>   For more options, visit [14]https://groups.google.com/d/optout.
>
>References
>
>   1. mailto:jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org
>   2. mailto:jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org
>   3. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   4. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   5. https://groups.google.com/d/msgid/pandoc-discuss/e762d5dd-bbd8-47e1-88bd-9f28801bf8c1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   6. https://groups.google.com/d/optout
>   7. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   8. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   9. https://groups.google.com/d/msgid/pandoc-discuss/20170223110650.GF76523-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org
>  10. https://groups.google.com/d/optout
>  11. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>  12. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>  13. https://groups.google.com/d/msgid/pandoc-discuss/CAFC_yuSvfr-onySRjXaWkJfDFcrwL=AHmnJSabks2bo5psXn5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org?utm_medium=email&utm_source=footer
>  14. https://groups.google.com/d/optout


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-25 11:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-22 16:25 Pandoc inserts line breaks between raw latex tables when generating TeX from markdown? David Sanson
     [not found] ` <e762d5dd-bbd8-47e1-88bd-9f28801bf8c1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-02-23 11:06   ` John MacFarlane
     [not found]     ` <20170223110650.GF76523-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
2017-02-24 16:18       ` BP Jonsson
     [not found]         ` <CAFC_yuSvfr-onySRjXaWkJfDFcrwL=AHmnJSabks2bo5psXn5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-24 21:22           ` David Sanson
2017-02-25 11:51           ` 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).