From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/18026 Path: news.gmane.org!.POSTED!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Latex command in header inclusion munged with \textbackslash{} Date: Mon, 7 Aug 2017 11:25:46 -0700 Message-ID: <20170807182546.GB91733@airbears2-10-142-0-86.airbears2.1918.berkeley.edu> References: <85d3801f-6a20-4873-bf2e-e8cd7f13445e@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed X-Trace: blaine.gmane.org 1502130367 5727 195.159.176.226 (7 Aug 2017 18:26:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 7 Aug 2017 18:26:07 +0000 (UTC) User-Agent: Mutt/1.6.2 (2016-07-01) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBNXBULGAKGQETXLCSLY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Aug 07 20:25:53 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-it0-f64.google.com ([209.85.214.64]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1demiv-0000m1-4I for gtp-pandoc-discuss@m.gmane.org; Mon, 07 Aug 2017 20:25:53 +0200 Original-Received: by mail-it0-f64.google.com with SMTP id 76sf619779ith.2 for ; Mon, 07 Aug 2017 11:25:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1502130359; cv=pass; d=google.com; s=arc-20160816; b=sMRUhIlL4tIbOUrbbUpTZMwfk94G2Q1085U6vh59Op/u0JD7pR6Fnif3VUi/YBveI0 gF+y68zGsAzhT0+rBcjcg7+QBoGgGJjGh1n2XkcTocgomIMNCzsiTkrqjT+BoLcg255u lVzehH/u1Ms2JtTEuKT3iUCvcI+KeCzkQ40EDb+jwmyKU+roRQqHyhwWxaGFj2l1U/ZH XyGJLZLNuGXXTaU0lrbp4C089dzPpZS9PRVIaXrqd+PZmbur6fEmy9/rt/cFQj+sbOP+ U7M7bsEQ+BPjJoC14XD6EmwlmtByxYfRONkVODnHK/bSVAANiWLU/6Ll1Yje4MczvQme 6p3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :date:from:arc-authentication-results:arc-message-signature:sender :dkim-signature:arc-authentication-results; bh=n0CcD0fXFqO9Z8/96yTIE6ocUsjcZN5jCkS6NLftJeg=; b=os3Wh7GxR/lRVMNL5fjTkcKBQDLsQ8AZCBhURqTRjAhDHWnrjzFF/NOutVA985xYE2 MeQ9ZpwwoiaZqXhAV0STkMBE1j11pirTD0CbMbi5OTWn67HqaxMdLKA2t8cEmsVNaNd1 33xD6acIhC3jnDv8mRDQnmnzFj+qwB7ZHpT9EmbLsdGXH2UdnCaG/VwMXKtlG69Zsvhy fOMEF/nDfZZvBh7nkKDRRAArl7FxYSzy4PTR7qxKPjIz4F3tYiQ9YUH00JVQxCLL5ilq 7TH1G5sBZ8RT2ObME4gL6+1uOOWOINInL/RSoLYibsUAI1HAYHS2FM0Gx1WqgyQxS2Zb ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.b=IQL3HxNf; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c05::230 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:date:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=n0CcD0fXFqO9Z8/96yTIE6ocUsjcZN5jCkS6NLftJeg=; b=UELtddOZuMT+pCIX3tmQXWL8Ex98C1i1hvSdhHa63fmNILDgkRLdUPTa57al5OM474 C0ZAYrXBT4itWIGzSju9XGMhCRguqRMyuzicg/EVSZmGiIyjDUwnU4hq+QAYWdVda3RC 06/S8b+ZwobBZunxWAYsR8eRq4Ubcx3FiaOlxXN25B+oH+7jHfznSDVnhRdDW+RXKs2X 6se2iyFkcOPELHnEqQ6qgFOHlI59jUxhU61gWmhUvc6CMW4dKn/JQnOMbACHUg65UgjN YNX8U3SXS0uYaVxs1nW8kG9gL7Sr3JY8e8PeFzdVFpqyA4FLNvcZ/DaTBnCiytUFu2e+ dcGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:date:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=n0CcD0fXFqO9Z8/96yTIE6ocUsjcZN5jCkS6NLftJeg=; b=O8186RQ5OUa4Es4ARlhV8FChRrVcTpcklIcV729WKArc+ea0Fi9KgcQp+d0rIql0O1 f+g6POweG3BEjyClzeH0MFGruJKhv0nDkFG18/Dp6G93YneuNKHTa0ofYal4YVym6Rq5 P7ilENphfnjQ+QlzgyjpbOFePDV4aNdkb+6tnZkj50kR+tKBij3FKPtsHRMY+8fXOvpp T0iqUTF3oEoNDFMEDYJDe3lEbjp2FJ9HwdjdYWR+lBKAJrkcbR7FL1IOyW+aRKCwMU1x 2sx7L/Wk/8w9sY6umKccvJuXRf1SXoVEnXsZasLaJSThW3dCDMYpMVfOTitdYs7Ntri5 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AIVw113DV+0WVk1sx1DevzZqGVYTVKGoKsPqFTsDbx7D9ITH8Yglai95 4uHcnEq0nYQVhw== X-Received: by 10.36.82.208 with SMTP id d199mr74804itb.7.1502130359257; Mon, 07 Aug 2017 11:25:59 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.36.184.70 with SMTP id m67ls5229861ite.18.gmail; Mon, 07 Aug 2017 11:25:58 -0700 (PDT) X-Received: by 10.129.48.5 with SMTP id w5mr931251yww.219.1502130358334; Mon, 07 Aug 2017 11:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502130358; cv=none; d=google.com; s=arc-20160816; b=nMoqJwjeZU9gTwUou6QUZkEgL2h9QNf13VUhkthwnOP5pXR9X0o5jtP3AfmVagtYAM EEvwm/LCQdYVGyg04VcnxT8g4gg5TrmEi25GDfJKlcaloWPbW0Zz+TqHcJZGoSkoPlt4 /BA4672nuvTxng1TmnPciw1HbcSNR8sOjpMtwQANrki/h8OJa/V+9ixRtpgo8FCkrgbf +iEwlQGNW4yfvxc2TYiZ9FERyChkrI26JCgtfGhB13tOn9uxYIB1oUtcj9DbgqEPn4e3 QLAQXPIykPlrMLMdIwApM0e7DloqS2T6A/K7UJqkRjr7K9HwpcdU7mDStxLZaXeTL8Z6 w6uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:to:date:from:dkim-signature :arc-authentication-results; bh=rixHE87tGbw7I+nnkBYC1RfeVicarjU/xYGl+U5wn28=; b=Q7/sDaRxTi+8nzfC4/9w8gwOqzviyWgdgDwRp9rvDaci6d1h6JykLWi7qk4oVXkGFg slqsqGAlU051rBCiDwWBF0pt5AckwV1VDmXkPmeKIU3f91MdRrkgtI3FTXRLmg+KWfKW 9iRqdSd/MV/X299ZeXeNOL6ROK7nawoKVEWPzVpCY01yZsVxEHtET+fwkTv52EBDz0DS owfr3lnKWxUIpgjdFU4D4NEekW1GEW3nT/b+roABtAhLVqLGJMUOT3q9lW0tGuPyDXeI 3m2nCO2J0DvZ1erXNhPXE22dV/Ug7HFtsO/oMDpd4BqS3rHWX4oatBZwkxeXcVT5tk5O 2qEg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.b=IQL3HxNf; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c05::230 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pg0-x230.google.com (mail-pg0-x230.google.com. [2607:f8b0:400e:c05::230]) by gmr-mx.google.com with ESMTPS id e206si1082292pfh.19.2017.08.07.11.25.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Aug 2017 11:25:58 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c05::230 as permitted sender) client-ip=2607:f8b0:400e:c05::230; Original-Received: by mail-pg0-x230.google.com with SMTP id l64so4601888pge.5 for ; Mon, 07 Aug 2017 11:25:58 -0700 (PDT) X-Received: by 10.99.156.1 with SMTP id f1mr1330198pge.327.1502130357846; Mon, 07 Aug 2017 11:25:57 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id h20sm7036510pfk.175.2017.08.07.11.25.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Aug 2017 11:25:57 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 7ABFCA1C5; Mon, 7 Aug 2017 14:25:46 -0400 (EDT) Content-Disposition: inline In-Reply-To: <85d3801f-6a20-4873-bf2e-e8cd7f13445e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-PGP-Key: http://johnmacfarlane.net/jgm.asc X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.b=IQL3HxNf; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c05::230 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:18026 Archived-At: 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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to > [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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-discuss-/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