From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/18028 Path: news.gmane.org!.POSTED!not-for-mail From: David Nebauer Newsgroups: gmane.text.pandoc Subject: Re: Latex command in header inclusion munged with \textbackslash{} Date: Tue, 8 Aug 2017 07:02:22 -0700 (PDT) Message-ID: References: <85d3801f-6a20-4873-bf2e-e8cd7f13445e@googlegroups.com> <20170807182546.GB91733@airbears2-10-142-0-86.airbears2.1918.berkeley.edu> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2722_769996274.1502200943015" X-Trace: blaine.gmane.org 1502200958 29712 195.159.176.226 (8 Aug 2017 14:02:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 8 Aug 2017 14:02:38 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBD7YRUMRLYIO7CFHZQCRUBEYNIFYY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Aug 08 16:02:19 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-vk0-f61.google.com ([209.85.213.61]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1df55O-0006qg-AF for gtp-pandoc-discuss@m.gmane.org; Tue, 08 Aug 2017 16:02:18 +0200 Original-Received: by mail-vk0-f61.google.com with SMTP id g189sf2132142vke.2 for ; Tue, 08 Aug 2017 07:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=RIxEvO3XHMYE05mycNzNb0IR7rQyY0YBjhrt2plffxM=; b=idiKOLmD0w5i76KzZr7jq7m2TAheKnnUvqTqVtPYiaCOwTb3Y5EEcYspEzZmHIsYLA C03HKPTN0CLqEE80nDP/2PYiheZNntdYG1Vyc6KYHBBh8BtaFdw1ZzYjuNm3qXgX3b4B DkTFgYdPE0qUfXTSLovghbDhyMZ5IwWvVDXXSELHciwR6fHnR20VyjAxIWDX6A0sc7c7 HRyEd2+xhFNDgiAsv5Ncq+CIIog5izN5U3u35hF0G0Jox79wYXSJBN+b3bq2pc3u3EZc +BCL4WfBujONlqnJkdQos2c2PPtZFjVrqoWxkYY0oJqvXe6+cdxjxcV6ISJZpu+zMJon 2bSA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=RIxEvO3XHMYE05mycNzNb0IR7rQyY0YBjhrt2plffxM=; b=BSkah8AN8x/OI3V2TdWEwSe44mblZKi+OSkiOSxuAGGd00baIQkN4LMwV9uq99FfjS Ov7Qn3aQJ9FJMKkvDwf6vW8Qp/zDImDo28szUDuZZ3C/XReT5N42qPEiKfy09gk+b7v/ Gh2uq/kGeW9ePMGIpUJ5w3Rl/W/3u51J5dfQ986537YKTp05OucwJPoTcmFAk7KdLGQC 0xOqncmUTN5lOf/X8SwsnmhcZXy/8ZsqEyMam/Dzwm3c+GADFY8Wsl66yoUt/te+Y9LY 6PBiV9wylbCP3nu6P3n4rM05tbDBqs16KcFH3LKusPDXGhHv6G9MwS9LmmvNiqd9AiFk 0mxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=RIxEvO3XHMYE05mycNzNb0IR7rQyY0YBjhrt2plffxM=; b=BT9gunV3wBHfZIlF6ALeltnoHVTAsXVYUQU/U7EGdc+bkY3Ffh2JxvGf0Kak+AArqu Vq6Ch9jfBGE+B+bXveVD3Y483YD3B3mv/ZQ4+58BaTiS2lRb9iqGr/05RhWR1uD0PI4q wP1t/YKtstfNVM4rdrz/xWHWTszTuR+R1kV/93uCAmwO9TiPINMJJ8SSGSlKKhDhwETN A1kNpVzl5BSnMw+nspYXZBS00onNolZ9UaU7rU4sTxMp3bvtIEDGZcIaTlpppQDQIAQV fySH6RLuMIE7LpxQmWWvgko4SG8fYUz5f0XH57PMrQQNGhy7nJeLuUyEDEjyVECeVkJZ mEKw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AHYfb5gEtK61cjC6EIaFIwa3uFs9eKj1MMXYFe4ZbA2oj0QzOyqfFhjC EZcUMjqIqsRF3A== X-Received: by 10.36.53.73 with SMTP id k70mr188122ita.0.1502200944500; Tue, 08 Aug 2017 07:02:24 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.107.23.70 with SMTP id 67ls2275002iox.18.gmail; Tue, 08 Aug 2017 07:02:23 -0700 (PDT) X-Received: by 10.36.1.198 with SMTP id 189mr187441itk.9.1502200943527; Tue, 08 Aug 2017 07:02:23 -0700 (PDT) In-Reply-To: <20170807182546.GB91733-qqGlgsTyhTiCiGiXOSDXzGEIDr1rnHf9vtmmnBSr4lwnUAKC5xwfQhvRwXAb8BAkh13vi7wywA4@public.gmane.org> X-Original-Sender: davidnebauer-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:18028 Archived-At: ------=_Part_2722_769996274.1502200943015 Content-Type: multipart/alternative; boundary="----=_Part_2723_1310333810.1502200943015" ------=_Part_2723_1310333810.1502200943015 Content-Type: text/plain; charset="UTF-8" Not sure of the relevance of issue 2956, which is about pandoc not recognising options in parentheses. There are no parentheses in the problematic header inclusion. On Tuesday, 8 August 2017 03:56:00 UTC+9:30, John MacFarlane wrote: > > See https://github.com/jgm/pandoc/issues/2956 > > Alternatively, in the dev version of pandoc you can tell > it you've got raw latex, not Markdown: > > header-includes: > - `\let\oldsection\section`{=latex} > > Final remark: I don't understand why it's not parsing > the `\section` as raw tex. I'll need to look into this; > it may be a bug in the LaTeX reader. > > +++ David Nebauer [Aug 07 17 00:39 ]: > > If I process this markdown file ('mwe-latex.md'): > > --- > > title: "Minimal Working Example" > > header-includes: > > - \let\oldsection\section > > - \renewcommand{\section}[1]{\clearpage\oldsection{#1}} > > --- > > Text. > > with the pandoc command: > > pandoc -t latex --latex-engine=xelatex --output=mwe-latex.pdf > > mwe-latex.md > > I get the the error: > > ! LaTeX Error: Missing \begin{document}. > > See the LaTeX manual or LaTeX Companion for explanation. > > Type H for immediate help. > > ... > > l.49 \let\oldsection\textbackslash{}s > > pandoc: Error producing PDF > > On generating latex output with the command: > > pandoc -t latex --latex-engine=xelatex --standalone > > --output=mwe-latex.tex mwe-latex.md > > and examining line 49 of the output file it becomes apparent that this > > line from the header inclusion: > > \let\oldsection\section > > has been munged by pandoc to: > > \let\oldsection\textbackslash{}section > > and this is causing the processing problem. (Note: changing latex > > engines makes no difference.) > > Once line 49 is edited to resemble the original command from the > header > > inclusion the error disappears. > > How can I prevent this latex command in the header inclusion from > being > > munged by pandoc? > > > > -- > > 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 [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > > To post to this group, send email to > > [2]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > > To view this discussion on the web visit > > [3] > https://groups.google.com/d/msgid/pandoc-discuss/85d3801f-6a20-4873- > > bf2e-e8cd7f13445e%40googlegroups.com. > > For more options, visit [4]https://groups.google.com/d/optout. > > > >References > > > > 1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > 2. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > 3. > https://groups.google.com/d/msgid/pandoc-discuss/85d3801f-6a20-4873-bf2e-e8cd7f13445e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer > > 4. 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/c39d6355-1b71-4355-813f-5e85a1beb988%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_2723_1310333810.1502200943015 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Not sure of the relevance of issue 2956, which is about pa= ndoc not recognising options in parentheses. There are no parentheses in th= e problematic header inclusion.

On Tuesday, 8 August 2017 03:56:00 U= TC+9:30, John MacFarlane wrote:
https://github.com= /jgm/pandoc/issues/2956

Alternatively, in the dev version of pandoc you can tell
it you've got raw latex, not Markdown:

header-includes:
- `\let\oldsection\section`{=3Dlatex}

Final remark: =C2=A0I don't understand why it's not parsing
the `\section` as raw tex. =C2=A0I'll need to look into this;
it may be a bug in the LaTeX reader.

+++ David Nebauer [Aug 07 17 00:39 ]:
> =C2=A0 If I process this markdown file ('mwe-latex.md'):
> =C2=A0 ---
> =C2=A0 title: "Minimal Working Example"
> =C2=A0 header-includes:
> =C2=A0 - \let\oldsection\section
> =C2=A0 - \renewcommand{\section}[1]{\clearpage\oldsection{#1}= }
> =C2=A0 ---
> =C2=A0 Text.
> =C2=A0 with the pandoc command:
> =C2=A0 pandoc -t latex --latex-engine=3Dxelatex --output=3Dmwe-lat= ex.pdf
> =C2=A0 mwe-latex.md
> =C2=A0 I get the the error:
> =C2=A0 ! LaTeX Error: Missing \begin{document}.
> =C2=A0 See the LaTeX manual or LaTeX Companion for explanation.
> =C2=A0 Type H <return> for immediate help.
> =C2=A0 ...
> =C2=A0 l.49 \let\oldsection\textbackslash{}s
> =C2=A0 pandoc: Error producing PDF
> =C2=A0 On generating latex output with the command:
> =C2=A0 pandoc -t latex --latex-engine=3Dxelatex --standalone
> =C2=A0 --output=3Dmwe-latex.tex mwe-latex.md
> =C2=A0 and examining line 49 of the output file it becomes apparen= t that this
> =C2=A0 line from the header inclusion:
> =C2=A0 \let\oldsection\section
> =C2=A0 has been munged by pandoc to:
> =C2=A0 \let\oldsection\textbackslash{}section
> =C2=A0 and this is causing the processing problem. (Note: changing= latex
> =C2=A0 engines makes no difference.)
> =C2=A0 Once line 49 is edited to resemble the original command fro= m the header
> =C2=A0 inclusion the error disappears.
> =C2=A0 How can I prevent this latex command in the header inclusio= n from being
> =C2=A0 munged by pandoc?
>
> =C2=A0 --
> =C2=A0 You received this message because you are subscribed to the= Google
> =C2=A0 Groups "pandoc-discuss" group.
> =C2=A0 To unsubscribe from this group and stop receiving emails fr= om it, send
> =C2=A0 an email to [1]pandoc-discus...@googlegroups.com.
> =C2=A0 To post to this group, send email to
> =C2=A0 [2]pandoc-...@googlegroups.com.
> =C2=A0 To view this discussion on the web visit
> =C2=A0 [3]http= s://groups.google.com/d/msgid/pandoc-discuss/85d3801f-6a20-4873-<= /a>
> =C2=A0 bf2e-e8cd7f13445e%
40googlegroups.com.
> =C2=A0 For more options, visit [4]https:= //groups.google.com/d/optout.
>
>References
>
> =C2=A0 1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> =C2=A0 2. mailto:pandoc-...@googlegroups.com
> =C2=A0 3. https://groups.google.com/d/msgid/pandoc-discuss/85d3801f-6= a20-4873-bf2e-e8cd7f13445e@googlegroups.com?utm_medium=3Demail&am= p;utm_source=3Dfooter
> =C2=A0 4. https://groups.google.com/d/optout

--
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/c39d6355-1b71-4355-813f-5e85a1beb988%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_2723_1310333810.1502200943015-- ------=_Part_2722_769996274.1502200943015--