From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/3266 Path: news.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Converting mixed latex (lhs) + markdown to latex (lhs) Date: Sat, 17 Mar 2012 09:17:56 -0700 Message-ID: <20120317161756.GA22862@protagoras.phil.berkeley.edu> References: <8e3f5907-1c7d-4ef9-ae76-8103621fa223@do4g2000vbb.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=ISO-8859-1 X-Trace: dough.gmane.org 1332001227 708 80.91.229.3 (17 Mar 2012 16:20:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 17 Mar 2012 16:20:27 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncCO38oIeaEBC585L7BBoEKcfAvA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Mar 17 17:20:26 2012 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pz0-f58.google.com ([209.85.210.58]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S8wMk-0000nl-1n for gtp-pandoc-discuss@m.gmane.org; Sat, 17 Mar 2012 17:20:26 +0100 Original-Received: by mail-pz0-f58.google.com with SMTP id h21sf6817785dal.3 for ; Sat, 17 Mar 2012 09:20:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:date:from:to:subject:message-id:references :mime-version:in-reply-to:x-pgp-key:user-agent:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type:content-disposition; bh=ApkyVtfO2miCvp4EVePGlx01Mq7hj+FDr3qJJJrqj+o=; b=FKOAPtMWNtkusAWBDygze2rRgAipKa+zS9aQtW8UlEL0xp3bl1PHRf3ntGZCF0qYK0 r5DXq+6MOve9jNCFULhrtv5ZFsgBtDJG+7qq/FiVCqOvAS9FNELVdbT2ySaeOE8B47Ws 9/JGU8JZ0Ww9V0VlkYYS5crK9piyalwdGIHAU= Original-Received: by 10.68.136.41 with SMTP id px9mr1907401pbb.10.1332001209275; Sat, 17 Mar 2012 09:20:09 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.68.219.2 with SMTP id pk2ls14800764pbc.5.gmail; Sat, 17 Mar 2012 09:20:08 -0700 (PDT) Original-Received: by 10.68.74.201 with SMTP id w9mr9005998pbv.0.1332001208862; Sat, 17 Mar 2012 09:20:08 -0700 (PDT) Original-Received: by 10.68.74.201 with SMTP id w9mr9005995pbv.0.1332001208849; Sat, 17 Mar 2012 09:20:08 -0700 (PDT) Original-Received: from cm06fe.IST.Berkeley.EDU (cm06fe.IST.Berkeley.EDU. [169.229.218.147]) by gmr-mx.google.com with ESMTPS id e6si9637799pbt.1.2012.03.17.09.20.08 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Mar 2012 09:20:08 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 169.229.218.147 as permitted sender) client-ip=169.229.218.147; Original-Received: from protagoras.phil.berkeley.edu ([128.32.137.142]) by cm06fe.ist.berkeley.edu with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (auth plain:jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org) (envelope-from ) id 1S8wMR-00088y-MG for pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; Sat, 17 Mar 2012 09:20:08 -0700 Original-Received: by protagoras.phil.berkeley.edu (Postfix, from userid 1000) id 987A323126; Sat, 17 Mar 2012 09:17:56 -0700 (PDT) In-Reply-To: <8e3f5907-1c7d-4ef9-ae76-8103621fa223-2dFLOe7gW+OqFmioV6QfyGB/v6IoIuQBVpNB7YpNyf8@public.gmane.org> X-PGP-Key: http://johnmacfarlane.net/jgm.asc User-Agent: Mutt/1.5.20 (2009-06-14) X-Original-Sender: fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 169.229.218.147 as permitted sender) smtp.mail=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: Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-Subscribe: , List-Unsubscribe: , Content-Disposition: inline Xref: news.gmane.org gmane.text.pandoc:3266 Archived-At: +++ Alessandro Vermeulen [Mar 17 12 00:58 ]: > Dear all, > > I'm seeking for a solution to convert blocks of markdown syntax within > a latex lhs file to another file in latex lhs but with the markdown > parts transformed to latex. E.g. a file containing the following: > > ``` > \documentclass{article} > \begin{document} > Some paragraph > > \begin{someliterallatex} > \end{someliterallatex} > > * A markdown > * list > > \end{document} > ``` > > Should be converted into the following: > > ``` > \documentclass{article} > \begin{document} > Some paragraph > > \begin{someliterallatex} > \end{someliterallatex} > > \begin{itemize} > \item A markdown > \item list > \end{itemize} > > \end{document} > ``` Cut out the document body, and run it through 'pandoc -f markdown -t latex'. Literal LaTeX environments will be passed through verbatim, and the rest converted from markdown to latex. Then add in the preamble and '\begin{document}...\end{document}'. If you leave in the \begin{document}...\end{document}, pandoc treats the whole thing as a literal latex environment and does not convert markdown within it. John