From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/17897 Path: news.gmane.org!.POSTED!not-for-mail From: sven.androd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Newsgroups: gmane.text.pandoc Subject: How to use LaTeX command "\write18{}" in Pandoc Date: Wed, 12 Jul 2017 01:10:09 -0700 (PDT) Message-ID: <9a1c3693-5d46-4de0-921b-3408ca893bad@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_7210_2015977252.1499847009958" X-Trace: blaine.gmane.org 1499847014 26679 195.159.176.226 (12 Jul 2017 08:10:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Jul 2017 08:10:14 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBC2YBFXZ6ILBBYVSS7FQKGQEH2W56HY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jul 12 10:10:09 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-qt0-f192.google.com ([209.85.216.192]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVCik-0006Yl-7j for gtp-pandoc-discuss@m.gmane.org; Wed, 12 Jul 2017 10:10:06 +0200 Original-Received: by mail-qt0-f192.google.com with SMTP id c20sf1762465qte.0 for ; Wed, 12 Jul 2017 01:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=r+lWJuXUP0g1h+lBXI2aCrvv8yJCIWZq760MekGOIQA=; b=RnAMB9u/cBTyhDJW08pkwi7Hc0dhCqcCsigIQaf//p8oJ6zIClZA/snnQAVPtkUQ3R MnpfS1BkaTVayc70hyiFCVZtwuUiGRmh+XN+FMRUAi3Bep76zGjtCTtJmzz/SJM6oOjI db+nRt1EdBp3lbX8GAKqx/ObkxFf4vpwykap92eIDsRXEJuf1vz9BiPG9duKGgJAItMP mBh0vAQxb2sGa38/2H9wN9ZQQIU07+AI6mTJRLOYEYUNX/U2yTQh37+fiowOtEOuHCFX wrBdjtiOgXFCoBtJHEITSULPh9Ma6SYrPfUcb7JPsjiNAcUVRMdUN34KcpJSrYDy4rvY 3Gdg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=r+lWJuXUP0g1h+lBXI2aCrvv8yJCIWZq760MekGOIQA=; b=aQy5EUSUUlDAwh6Tf1PMcjGvAR2ozPExfBtzXJ73tpmIC1GzC3pgfjPNWNC4cMEtnN u928I/V4rtGAAKHX8sNZi6ib/yTJwliM6Asmr6pIXK5R2gh9VDMJ2QU1BqowGDwG7gFq WTRKTo361i+n2rZOkEWG/WovjGE54Bq2H6U99vGF6eSvyIeP/Er4NbMr8rkuNfHxgXDP BU3XVgcpZ+2j28J/P2bs+juQknrpafapqkFFayZ08k0OPND6xWM9rXEfsFz6t2OZwGK/ u5s6zqkesmhVMKZe+TA30gFByda7rQtINEbSZxafvj2+3mdTxgL8r/m5VoTylYjCs/vh e/FA== 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: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=r+lWJuXUP0g1h+lBXI2aCrvv8yJCIWZq760MekGOIQA=; b=rJ/4yU+D6o4/qTkuwdVOaod2WXKNYt2CzuL5GRWl+5ppg1RuYSZYMcBOsYBotnV15r xQGEfJ3sxp1nKDhSee9fgAQhEzi9yIiHw/H0I4OBvsnPXkJrApYzt/cJJ8R98B8iupcc /bj7lUJ19XC6UJIX3s2IeUdHevOiKbaqyEtJzF7duZB5joUYUmuhL1VPH1pRxJhXD59m O2CM0ZclulgByanuzm1Pt/hKi2/g4Lth6cltf7GHaahqAQJHsKcSPUlMAotaVHyKHmN7 J2f6JQgGp3LftMXxyqMKCGqtxzDckBISbOLNPoNAzOj2PZn8EEowyWKl1TIMLj/+huy5 zUcw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AIVw112++KXHZymstWqqTRJrP8nXtF2CL3FWEGFqZwa7XwKVc+lAXkvd 7VQw5UMfEIJMvg== X-Received: by 10.36.124.10 with SMTP id a10mr830408itd.6.1499847011670; Wed, 12 Jul 2017 01:10:11 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.107.13.210 with SMTP id 201ls2727672ion.24.gmail; Wed, 12 Jul 2017 01:10:10 -0700 (PDT) X-Received: by 10.36.3.81 with SMTP id e78mr291592ite.9.1499847010553; Wed, 12 Jul 2017 01:10:10 -0700 (PDT) X-Original-Sender: sven.androd-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:17897 Archived-At: ------=_Part_7210_2015977252.1499847009958 Content-Type: multipart/alternative; boundary="----=_Part_7211_714192893.1499847009959" ------=_Part_7211_714192893.1499847009959 Content-Type: text/plain; charset="UTF-8" Hi everyone! I'm using the LaTeX command "\write18{}" to be able to issue commands directly when compiling the document. However, when I'm trying to convert from Markdown to LaTeX, the "write18 {}" command gets escaped and therefore can't be processed by LaTeX. Example (Markdown file, temp.md): # This is a section Capturing the output of a command with `write18`. ## Description Some examples where the content does not get escaped: \section{git --version} \input{git --version} \write{git --version} Some examples where the content gets escaped: \immediate\write18{git --version} \write18{git --version} This gets compiled down to (pandoc --to latex temp.md) \section{This is a section}\label{this-is-a-section} Capturing the output of a command with \texttt{write18}. \subsection{Description}\label{description} Some examples where the content does not get escaped: \section{git --version} \input{git --version} \write{git --version} Some examples where the content gets escaped: \immediate\write18\{git --version\} \write18\{git --version\} As you can see, the "\write18{git --version}" command gets compiled down to "\write18\{git --version\}" that's escaped and therefore cannot be processed by LaTeX. This seems to have something to do with the Markdown reader, since if you print out the JSON AST, each input gets treated separately. Output of "pandoc --to json temp.md | python -m json.tool" ... { "c": [ { "c": [ "tex", "\\write" ], "t": "RawInline" }, { "c": "18{git", "t": "Str" }, { "t": "Space" }, { "c": "--version}", "t": "Str" } ], "t": "Para" } ... *Now to my actual question: is this expected behavior or some kind of missing token definition? And if so; how would I work around it? *I'd rather not write a Pandoc filter that would process the entire AST, but if the above behavior is expected I guess that's a solution that could work. Otherwise, does anyone else have any suggestions? Thank you Best regards, Sven -- 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/9a1c3693-5d46-4de0-921b-3408ca893bad%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_7211_714192893.1499847009959 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi everyone!

I'm using= the LaTeX command "write1= 8 {}" command gets escaped and therefore can't be processed= by LaTeX.

Example (Markdown file, temp.md):=
# Th= is is a section
C= apturing t= he output of a command with `w= rite18`.

## Description=
Some examples
where
the content does not
get escaped:

\section{git --<= /span>version}

\input{git --version}

\= write{git --version}

Some examples where the content gets escaped:

\immediate\w= rite18{git --version}

\write18{git --version}<= /span>

This gets compiled down to (p= andoc --to latex temp.md)
\section{This is a section}\label{this-is-a-<= /span>section}

Capturing the output of a command <= /span>with= \texttt{write18}.

\subsection{Desc= ription}\<= /span>label{description}

Some examples where the content does not get escaped:

\section<= /span>{git --version}

\input{git --= version}

\write{git --version}

Some exa= mples wher= e the cont= ent gets escaped:
\immediate\write18\{git --version\}

\write18\{git --version\}


As you can see, the "\write18{git --version}" command gets compiled down t= o "\write18\{git -= -version\}" that's escaped and therefore cannot be processe= d by LaTeX.
This seems to have something to do with the Markdown reader,= since if you print out the JSON AST, each input gets treated separately. <= br>
Output of "pandoc --to json temp.md | python -m json.tool"
...
=C2=A0 =C2=A0 =C2=A0 =C2=A0
{
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0
"c": = [
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0
"c": = [
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0
&qu= ot;tex",
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0
&qu= ot;\\write"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0
],<= /span>
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
"t"
: "RawInline"
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
},
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0
{
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
"c":
"18{git",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
"t": "Str"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
},<= span style=3D"color: #000;" class=3D"styled-by-prettify">
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0
"t": = "Space"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
<= span style=3D"color: #660;" class=3D"styled-by-prettify">},
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0
"c": = "--ve= rsion}",
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
<= span style=3D"color: #080;" class=3D"styled-by-prettify">"t": "Str"
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
],
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0
"t": <= /span>"Para&= quot;
= =C2=A0 =C2=A0 =C2=A0 =C2=A0
}
...
=

Now to my actual question= : is this expected behavior or some kind of missing token definition? And i= f so; how would I work around it?
I'd r= ather not write a Pandoc filter that would process the entire AST, but if t= he above behavior is expected I guess that's a solution that could work= . Otherwise, does anyone else have any suggestions?

Thank you
Best regards,
Sven

--
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/9a1c3693-5d46-4de0-921b-3408ca893bad%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_7211_714192893.1499847009959-- ------=_Part_7210_2015977252.1499847009958--