From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/11721 Path: news.gmane.org!not-for-mail From: Matthew Pickering Newsgroups: gmane.text.pandoc Subject: Re: LaTeX Headers/Macros in pandoc conversion Date: Sat, 10 Jan 2015 00:02:12 +0000 Message-ID: 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: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1420848142 16924 80.91.229.3 (10 Jan 2015 00:02:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Jan 2015 00:02:22 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCO2LGEC4AIBBBOYYGSQKGQEL4PQWXA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jan 10 01:02:15 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-we0-f185.google.com ([74.125.82.185]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y9jVO-0001Pk-UI for gtp-pandoc-discuss@m.gmane.org; Sat, 10 Jan 2015 01:02:14 +0100 Original-Received: by mail-we0-f185.google.com with SMTP id w61sf947125wes.2 for ; Fri, 09 Jan 2015 16:02:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe; bh=YzBlbYAXrbDpP08Gm/oagKltv0Zpib2GXIZBtJZ9Ck8=; b=OqkHJaoAGaA3n/kgQg+xWhU5gyhpLfXoAlpD6naXna41JDXYvTvreAuL8/63q0YaHd wEJwfLnUFzgUdVJb8my/jXdz43C4Skdm8ZGqxmDG2Oku1njfSBpg8jmHl6GrYCW8DdGL 4E+YWWi/CpGge35WsL3kZr35H1ypdiiQVRWZQCUEZ16ZwQLDIWWHPu2t3LpUAvCKHs8e DEPsDkRRewem8JqPkA4WrNsAoaxu6CK4Pxi3fb1q0paPDrQdOVL72Ci15LnGcu5coj32 A7ddXlJsLNimyBc59wyYTH1vizvZ/8gCjHNOzdUySaMw2qCH3W4tb7GBTmWFikHT4Sl7 gYSQ== X-Received: by 10.152.87.43 with SMTP id u11mr41004laz.14.1420848134526; Fri, 09 Jan 2015 16:02:14 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.152.9.195 with SMTP id c3ls500894lab.61.gmail; Fri, 09 Jan 2015 16:02:13 -0800 (PST) X-Received: by 10.112.137.136 with SMTP id qi8mr298lbb.13.1420848133125; Fri, 09 Jan 2015 16:02:13 -0800 (PST) Original-Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com. [2a00:1450:4010:c04::231]) by gmr-mx.google.com with ESMTPS id oi7si1009895lbb.1.2015.01.09.16.02.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Jan 2015 16:02:13 -0800 (PST) Received-SPF: pass (google.com: domain of matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c04::231 as permitted sender) client-ip=2a00:1450:4010:c04::231; Original-Received: by mail-lb0-x231.google.com with SMTP id b6so10545827lbj.8 for ; Fri, 09 Jan 2015 16:02:13 -0800 (PST) X-Received: by 10.112.169.34 with SMTP id ab2mr24252610lbc.77.1420848133048; Fri, 09 Jan 2015 16:02:13 -0800 (PST) Original-Received: by 10.114.91.136 with HTTP; Fri, 9 Jan 2015 16:02:12 -0800 (PST) In-Reply-To: X-Original-Sender: matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c04::231 as permitted sender) smtp.mail=matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com 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:11721 Archived-At: 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