From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/13751 Path: news.gmane.org!not-for-mail From: Melroch Newsgroups: gmane.text.pandoc Subject: Re: Markdown in LaTeX blocks? Date: Sun, 18 Oct 2015 01:49:00 +0200 Message-ID: References: <33a034bb-fc38-4df2-b8b1-8934e3c76358@googlegroups.com> <20151015033741.GA2874@MacBook-Air.local> <20151015172910.GA85155@D25Q40BGFY13.Berkeley.EDU> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11401320740dd20522558e18 X-Trace: ger.gmane.org 1445125750 28486 80.91.229.3 (17 Oct 2015 23:49:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Oct 2015 23:49:10 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCWMVYEK54FRB3N4ROYQKGQEL3MKYAY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Oct 18 01:49:03 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-lf0-f60.google.com ([209.85.215.60]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZnbDi-0000Kq-9V for gtp-pandoc-discuss@m.gmane.org; Sun, 18 Oct 2015 01:49:02 +0200 Original-Received: by lfaz124 with SMTP id z124sf22308729lfa.0 for ; Sat, 17 Oct 2015 16:49:02 -0700 (PDT) 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:x-spam-checked-in-group :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=KEHAt91sUry8FvOCttgU9sO3rNQzsrbo4H+q244xIto=; b=v5rY1hxocybCr9GBzAfrl/pGwZ4I8bGmEctH96OzPaknPEw3Tvg7Fkm/4927BLKbHY 1UzxM8kEQ2icuNZi738z3V85qCf2eaw+8CqeOl/auj7c67RxwZyrSg4FLKchhCOFYyae Pb/xI5ncIVXZxj7t0pZ4L4U1En3dFDTuP4RfDmEX84eVt7u28KKWCqDp66b4Izi6kMjD qZAjeMoQCVTkrynWa2NlQBiseoIV4VRcKBXTzH3TFiDBNELSRZxVX7MqUHRa+abIxCO4 mMPMelihDC0tAjIcZv4D4Rtty4jsv6H88NsLRSjj9vcdjMuI5IwMdBbPeA5fudF6VRie Dw2g== X-Received: by 10.180.206.142 with SMTP id lo14mr116398wic.0.1445125742084; Sat, 17 Oct 2015 16:49:02 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.180.23.194 with SMTP id o2ls375476wif.12.gmail; Sat, 17 Oct 2015 16:49:01 -0700 (PDT) X-Received: by 10.194.240.230 with SMTP id wd6mr5415506wjc.0.1445125741222; Sat, 17 Oct 2015 16:49:01 -0700 (PDT) Original-Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com. [2a00:1450:4010:c07::22e]) by gmr-mx.google.com with ESMTPS id b6si461830lbp.1.2015.10.17.16.49.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Oct 2015 16:49:01 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c07::22e as permitted sender) client-ip=2a00:1450:4010:c07::22e; Original-Received: by lfaz124 with SMTP id z124so92911169lfa.1 for ; Sat, 17 Oct 2015 16:49:01 -0700 (PDT) X-Received: by 10.25.149.139 with SMTP id x133mr5717548lfd.53.1445125741086; Sat, 17 Oct 2015 16:49:01 -0700 (PDT) Original-Received: by 10.25.17.42 with HTTP; Sat, 17 Oct 2015 16:49:00 -0700 (PDT) Original-Received: by 10.25.17.42 with HTTP; Sat, 17 Oct 2015 16:49:00 -0700 (PDT) In-Reply-To: X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c07::22e as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; 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-Spam-Checked-In-Group: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:13751 Archived-At: --001a11401320740dd20522558e18 Content-Type: text/plain; charset=UTF-8 There is a workaround: Put this at the top of your document: ```` \newcommand{\hideFromPandoc}[1]{#1} \hideFromPandoc{ \let\Begin\begin \let\End\end } ```` Then in your document: ```` \Begin{center} Here is *markdown*! \End{center} ```` Note the capitalization and empty lines! The newcommand creates a dummy command which stops pandoc from breaking the LaTeX inside its argument. The real magic is the \let commands which make LaTeX perfectly happy with \Begin and \End as synonyms of \begin and \end while pandoc just sees two inline commands rather than a block. That's why you need the empty lines around them to really get a block in LaTeX. If you want to generate both LaTeX and HTML from the same source you can put a div inside the environment: ```` \Begin{center}
Here is *markdown*!
\End{center} ```` No extra blank lines are needed then but you will get some extra empty `

` elements which you may want to remove from your HTML. The eqhivalent for commands is like this: ```` \textsfHere is *markdown* ```` It looks totally weird but it works because the LaTeX writer puts braces around the span content. If you are not going to produce HTML you don't even need the `class="sans"`! I hope this helps. /bpj Den 15 okt 2015 20:00 skrev "Yihui Xie" : > Okay, just filed a feature request at > https://github.com/jgm/pandoc/issues/2453 > > Regards, > Yihui > -- > Yihui Xie > Web: http://yihui.name > > > On Thu, Oct 15, 2015 at 12:29 PM, John MACFARLANE > wrote: > > +++ Yihui Xie [Oct 14 15 22:45 ]: > >> > >> Interesting. I guess that is also simple to implement in R. I'll try > >> it later. Thanks! > >> > >> Is there a particular reason that we only have the > >> markdown_in_html_blocks extension but not markdown_in_tex_blocks? > > > > > > Not really. Maybe this would make sense to add. > > -- > 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/CANROs4eAAAjSOD%2BWjfS5gEvyHhzQ6yFP9t3WU6VgkUS2abX5gg%40mail.gmail.com > . > For more options, visit 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/CADAJKhAO-Yv3s5nx-OsrkH7W_fKi5t%2BXh8WJ-r%3DO-Ksk7NUxVQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout. --001a11401320740dd20522558e18 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

There is a workaround:

Put this at the top of your document:

````
\newcommand{\hideFromPandoc}[1]{#1}
\hideFromPandoc{
=C2=A0=C2=A0=C2=A0 \let\Begin\begin
=C2=A0=C2=A0=C2=A0 \let\End\end
}
````

Then in your document:

````
\Begin{center}

Here is *markdown*!

\End{center}
````

Note the capitalization and empty lines!

The newcommand creates a dummy command which stops pandoc fr= om breaking the LaTeX inside its argument.
The real magic is the \let commands which make LaTeX perfectly happy with \= Begin and \End as synonyms of \begin and \end while pandoc just sees two in= line commands rather than a block. That's why you need the empty lines = around them to really get a block in LaTeX.

If you want to generate both LaTeX and HTML from the same so= urce you can put a div inside the environment:

````
\Begin{center}
<div class=3D"center">
Here is *markdown*!
</div>
\End{center}
````

No extra blank lines are needed then but you will get some e= xtra empty `<p></p>` elements which you may want to remove from= your HTML.

The eqhivalent for commands is like this:

````
\textsf<span class=3D"sans">Here is *markdown*</span>=
````

It looks totally weird but it works because the LaTeX writer= puts braces around the span content. If you are not going to produce HTML = you don't even need the `class=3D"sans"`!

I hope this helps.

/bpj

Den 15 okt 2015 20:00 skrev "Yihui Xie"= ; <xieyihui-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
Okay, just filed a feat= ure request at https://github.com/jgm/pandoc/issues/2453

Regards,
Yihui
--
Yihui Xie <
xieyihui-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org&= gt;
Web: htt= p://yihui.name


On Thu, Oct 15, 2015 at 12:29 PM, John MACFARLANE <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:
> +++ Yihui Xie [Oct 14 15 22:45 ]:
>>
>> Interesting. I guess that is also simple to implement in R. I'= ll try
>> it later. Thanks!
>>
>> Is there a particular reason that we only have the
>> markdown_in_html_blocks extension but not markdown_in_tex_blocks?<= br> >
>
> Not really.=C2=A0 Maybe this would make sense to add.

--
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 pa= ndoc-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/CANROs4eAAAjSOD%2BWjfS5gEvyHhzQ6yFP9t3WU6= VgkUS2abX5gg%40mail.gmail.com.
For more options, visit 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://gro= ups.google.com/d/msgid/pandoc-discuss/CADAJKhAO-Yv3s5nx-OsrkH7W_fKi5t%2BXh8= WJ-r%3DO-Ksk7NUxVQ%40mail.gmail.com.
For more options, visit http= s://groups.google.com/d/optout.
--001a11401320740dd20522558e18--