public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Matthew Pickering <matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: LaTeX Headers/Macros in pandoc conversion
Date: Sat, 10 Jan 2015 00:02:12 +0000	[thread overview]
Message-ID: <CALuQ0m9f8Zvtnv=eyBGu=3afxZvLb3uCW=-i8cVWLDgxLwhCQQ@mail.gmail.com> (raw)
In-Reply-To: <CALuQ0m8t5ejcyS6mZ05eZn+=JoGoJ8FK4i_mF0Wira7AHcPwjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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


  parent reply	other threads:[~2015-01-10  0:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 18:27 Mike Hynes
     [not found] ` <90cb9924-0ed1-441a-8ef2-f2e3928a165c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-01-09 18:44   ` Matthew Pickering
     [not found]     ` <CALuQ0m_pvBqPZvXnOjsT8+Ev5+xRKz8osw_zVuhW=sKMGESz9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-09 19:11       ` Mike Hynes
     [not found]         ` <ef300118-1ee9-4e4e-8cb8-1cc47dc4d192-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-01-09 19:13           ` Mike Hynes
2015-01-09 19:33   ` John MacFarlane
     [not found]     ` <20150109193307.GA90254-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-01-09 20:12       ` Mike Hynes
     [not found]         ` <039f5de8-68e3-42a7-9f9c-cdc6bde24bc4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-01-09 20:22           ` Mike Hynes
     [not found]             ` <40a476ba-e1a8-413e-ab7e-584f21f70101-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-01-09 22:31               ` Matthew Pickering
     [not found]                 ` <CALuQ0m9YSVo7qSaUZg2nf+3JnUL7aN-tscHMt1xONj2dCUe5fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-09 22:43                   ` Mike Hynes
     [not found]                     ` <a7b24022-c931-46ed-a2bf-ae80a3ca79f0-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-01-09 22:50                       ` Matthew Pickering
     [not found]                         ` <CALuQ0m8pi4zuxCiCCoa4uiS=8yAWAPeYoqRoODpJ32KquSgYCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-09 23:06                           ` Matthew Pickering
     [not found]                             ` <CALuQ0m8t5ejcyS6mZ05eZn+=JoGoJ8FK4i_mF0Wira7AHcPwjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-10  0:02                               ` Matthew Pickering [this message]
     [not found]                                 ` <CALuQ0m9f8Zvtnv=eyBGu=3afxZvLb3uCW=-i8cVWLDgxLwhCQQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-10 17:00                                   ` Mike Hynes
     [not found]                                     ` <18984b29-d0e1-4f6c-85a3-3de241601d2c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-01-10 17:48                                       ` Mike Hynes

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='CALuQ0m9f8Zvtnv=eyBGu=3afxZvLb3uCW=-i8cVWLDgxLwhCQQ@mail.gmail.com' \
    --to=matthewtpickering-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=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).