From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/11722 Path: news.gmane.org!not-for-mail From: Mike Hynes <91mbbh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Newsgroups: gmane.text.pandoc Subject: Re: LaTeX Headers/Macros in pandoc conversion Date: Sat, 10 Jan 2015 09:00:33 -0800 (PST) Message-ID: <18984b29-d0e1-4f6c-85a3-3de241601d2c@googlegroups.com> References: <90cb9924-0ed1-441a-8ef2-f2e3928a165c@googlegroups.com> <20150109193307.GA90254@localhost.hsd1.ca.comcast.net> <039f5de8-68e3-42a7-9f9c-cdc6bde24bc4@googlegroups.com> <40a476ba-e1a8-413e-ab7e-584f21f70101@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_118_627090926.1420909233368" X-Trace: ger.gmane.org 1420909243 12879 80.91.229.3 (10 Jan 2015 17:00:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Jan 2015 17:00:43 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZY7Z4KS4EBBMNVYWSQKGQEBQYAVWA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jan 10 18:00:40 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ie0-f192.google.com ([209.85.223.192]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y9zOt-0002Cv-Br for gtp-pandoc-discuss@m.gmane.org; Sat, 10 Jan 2015 18:00:35 +0100 Original-Received: by mail-ie0-f192.google.com with SMTP id rp18sf2883390iec.9 for ; Sat, 10 Jan 2015 09:00:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=oH3lAeNgJbpei3KHg/VdRqTzp3pfn/J4zdp8WTeYJCc=; b=RDfLWTXaXeD0r3m7UZJLJxyFrElmOczaRqJbB2yFb8FAkCX1NuwIMr8lW6GoQFru33 btAHWftazyvj8MExLhbrbRc1a8Mxm+Kq5D0OVtu2jtvI/v0OTKWd/1FWoCPwI2U61EO0 yF008Zuc+kpa8zh4KrfVh3NMiCqdUFaLBt94se63ows9LWXxh22k8Q11spHTdYddkwVW gz0Bagtt3sH8R8du3dwSSdB9mC2PSEzIwM680egVeRiDf15QHEs/6RHmkcyhjq5cOqmg IQ1JfRyb11TjcRxXxPFEffgVKH0qjDB1ElgRnaUPJScI5WiJ3uZUfRLJLX60hjHJSSz8 zevg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=oH3lAeNgJbpei3KHg/VdRqTzp3pfn/J4zdp8WTeYJCc=; b=DVwha9wdcs6RKhX1cHUB5xrTgK9D0NnswOxlpFw0Z+JzAjZ1+gqiQ8Y90fN5vcbY7e V1Hy30q559SqO6VCRzniemjmcgTFlDtxtNSQJmZIE3OX0xr6kxIPSXwyJY0b3ANgY3S0 g4zG/raU2vPdK8IhQacH1bezPpnzePlyFAem9NDMMC5CEbZomhhGUdVFFera3kpS8y7N 7jHpxoL7xr/F37G54fphsGKR51BTv2SnjD866Cst8ADJJTO4LRZsr35RVj5XvlkUkqH6 yPJa3QBGaHoCe0h8VOC2sRjwjkeCfxAxw5jXZZHYWuuCTnVGY+7/rRbvmIy/E7MIGn9N psPQ== X-Received: by 10.182.234.103 with SMTP id ud7mr140230obc.12.1420909234601; Sat, 10 Jan 2015 09:00:34 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.182.51.165 with SMTP id l5ls796309obo.99.gmail; Sat, 10 Jan 2015 09:00:33 -0800 (PST) X-Received: by 10.182.254.41 with SMTP id af9mr8288obd.22.1420909233798; Sat, 10 Jan 2015 09:00:33 -0800 (PST) In-Reply-To: X-Original-Sender: 91mbbh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 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.org gmane.text.pandoc:11722 Archived-At: ------=_Part_118_627090926.1420909233368 Content-Type: multipart/alternative; boundary="----=_Part_119_1814937453.1420909233368" ------=_Part_119_1814937453.1420909233368 Content-Type: text/plain; charset=UTF-8 Thanks Matthew for looking into this so deeply! I will follow the issue on github. On Friday, January 9, 2015 at 7:02:16 PM UTC-5, Matthew Pickering wrote: > > I've done some more investigating... > > When building from HEAD your example file actually fails to compile. > (This is because of the parseFromString changes John). > > So this is what happens.. the macro parsing is all ok. The problem > comes when \FIG is parsed. \FIG is replaced with the following.. > > ``` > { > \begin{figure}[h!] > \centering > \includegraphics[width=0.5\columnwidth,angle=0]{test.jpg} > \caption{Test caption} > \label{fig:test.jpg} > \end{figure} > } > ``` > > The next line now fails > > ``` > parseFromString inlines transformed > ``` > > The next step is into `grouped inline` which matches the first `{`. > Little does this function know, what is inside this block is actually > a block level element. > > Next `inline` tries to match `\begin{figure}` but all paths fail so > the parse fails. Pre pandoc 1.13.3 (ie any released version of pandoc) > the `parseFromString` function succeeded even if it didn't consume all > the input (it just silently threw it away). Now in HEAD, it fails if > not all the input is consumed. > > I have copied this message over onto the issue tracker[1]. > > I think the whole LaTeX reader is in need of a bit of an overhaul, the > macro inclusion code is quite difficult to follow and the error > messages uninformative (as well as the result being wrong!) > > [1]: https://github.com/jgm/pandoc/issues/1866 > -- 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/18984b29-d0e1-4f6c-85a3-3de241601d2c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_119_1814937453.1420909233368 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks Matthew for looking into this so deeply! I will fol= low the issue on github.


On Friday, January 9, 2015 at 7:02:16 P= M UTC-5, Matthew Pickering wrote:
I've done some more investigating...

When building from HEAD your example file actually fails to compile.
(This is because of the parseFromString changes John).

So this is what happens.. the macro parsing is all ok. The problem
comes when \FIG is parsed. \FIG is replaced with the following..

```
{
  \begin{figure}[h!]
    \centering
    \includegraphics[width=3D0.5\columnwidth,angle=3D0]{= test.jpg}
    \caption{Test caption}
    \label{fig:test.jpg}
  \end{figure}
}
```

The next line now fails

```
parseFromString inlines transformed
```

The next step is into `grouped inline` which matches the first `{`.
Little does this function know, what is inside this block is actually
a block level element.

Next `inline` tries to match `\begin{figure}` but all paths fail so
the parse fails. Pre pandoc 1.13.3 (ie any released version of pandoc)
the `parseFromString` function succeeded even if it didn't consume all
the input (it just silently threw it away). Now in HEAD, it fails if
not all the input is consumed.

I have copied this message over onto the issue tracker[1].

I think the whole LaTeX reader is in need of a bit of an overhaul, the
macro inclusion code is quite difficult to follow and the error
messages uninformative (as well as the result being wrong!)

[1]: https://github.com/jgm/pandoc/issues/1866

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/18984b29-d0e1-4f6c-85a3-3de241601d2c%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_119_1814937453.1420909233368-- ------=_Part_118_627090926.1420909233368--