From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/12365 Path: news.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: How to enclose reference list entries in a latex environment? Date: Sat, 28 Mar 2015 08:27:04 -0700 Message-ID: <20150328152704.GC49524@localhost.hsd1.ca.comcast.net> References: <20150327182009.GB37676@localhost.hsd1.ca.comcast.net> <20150327182752.GD37676@localhost.hsd1.ca.comcast.net> <584f68ea-db87-4c21-9c13-10d8f6a9118f@googlegroups.com> <20150328031718.GD37821@localhost.hsd1.ca.comcast.net> <08aa7ab5-40b2-45f2-8a86-635c75018bb9@googlegroups.com> <472e1709-92d6-4c1d-961d-edad2b55bfd0@googlegroups.com> <9f84082a-3ad0-40f2-b0f5-ad564cbe5d24@googlegroups.com> <46a6f65e-a2fe-4207-bbf2-0c96524ebe7d@googlegroups.com> <8efa389a-8880-491d-8f18-7e8ae1b38669@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=UTF-8; format=flowed X-Trace: ger.gmane.org 1427556472 1336 80.91.229.3 (28 Mar 2015 15:27:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Mar 2015 15:27:52 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBVUQ3OUAKGQELPNFYVA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Mar 28 16:27:37 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-yh0-f58.google.com ([209.85.213.58]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ybsdr-0007Yr-DK for gtp-pandoc-discuss@m.gmane.org; Sat, 28 Mar 2015 16:27:19 +0100 Original-Received: by yhab6 with SMTP id b6sf4631218yha.0 for ; Sat, 28 Mar 2015 08:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=from:date:to:subject:message-id:references:mime-version :content-type: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 :sender:list-subscribe:list-unsubscribe; bh=U0BvBFSjEzCQ6AU4kKqW5NnJABfwzR55PkrVR1zrRGA=; b=ZNzybmGdaer+WNHtk43WXWFHbNFfoAXd35KYMVHahvvuRWZ0d57m8Dh9kh3tZ4qeKU a8bL88jBbj81zTdVTCw1uRONi40FcwH7F7rTPyvslcTc0JkULdSF1Nfa+RtV/TkhSvMT lPl77jEpVW6ne7wvMA67rsY8D70HZdlSUvzbWdHAi51qSuOvkvX9YIoYOsRP0F131smy rlx1dy819mOou60/8cD7cv2GJdIH0PJtHSsPZ09bzbVRAlRvr8mkac75Teg3J7S66Nc3 0s/Cv70m0ALf/x2UWwAZ+3eLPRqv3ScrB2bazTckT9NDC3XeJRVoLOCg6El2/meAQsWc GhaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:subject:message-id:references :mime-version:content-type: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:sender:list-subscribe:list-unsubscribe; bh=U0BvBFSjEzCQ6AU4kKqW5NnJABfwzR55PkrVR1zrRGA=; b=SSEkmnfNXSgqWkj+L+M8CR1N1PpH14wABMymFCVrfVOFn98lUSntdePsqPI0zkucBO AEB0FHFpPaohFfSqubDc3u22WYS4Qvtp1vQEtczktAoC6bT1FtP3F8utgcRLrKdtm9la o1df058N/Vr3Sa7CfVjxPIB1sAKtnHPWj+c7eTpnyjr9q5sE1sGupK+vQhB7lZc/UKNL cdcxr9RInPIT8PXjLn4bwcBNYpIc66EGqo99qheV/MzMJwCdeFxMVkqNbqNWkC3Y2q7O am+6TyuoIXmYO1hXv+J3jCcyoEua2eAX5WsDMB2FpscQZqSpHDqvWYPNUaFHwAteQR5j GD X-Received: by 10.140.109.246 with SMTP id l109mr388862qgf.22.1427556438473; Sat, 28 Mar 2015 08:27:18 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.140.35.178 with SMTP id n47ls1808073qgn.10.gmail; Sat, 28 Mar 2015 08:27:18 -0700 (PDT) X-Received: by 10.236.63.42 with SMTP id z30mr27677663yhc.37.1427556438131; Sat, 28 Mar 2015 08:27:18 -0700 (PDT) Original-Received: from mail-ig0-f182.google.com (mail-ig0-f182.google.com. [209.85.213.182]) by gmr-mx.google.com with ESMTPS id g3si435852igr.2.2015.03.28.08.27.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Mar 2015 08:27:18 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 209.85.213.182 as permitted sender) client-ip=209.85.213.182; Original-Received: by ignm3 with SMTP id m3so47980990ign.0 for ; Sat, 28 Mar 2015 08:27:18 -0700 (PDT) X-Gm-Message-State: ALoCoQmMc0+YkaKVjy2AAQXaxtOnG+G/Lgvgsd3q7CEgrZ+fsQZS9VXAheEeR/Zmp5SGCuNmwUG/ X-Received: by 10.50.66.141 with SMTP id f13mr6008120igt.9.1427556437907; Sat, 28 Mar 2015 08:27:17 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by mx.google.com with ESMTPSA id k9sm3617872ige.6.2015.03.28.08.27.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Mar 2015 08:27:16 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id E7B1CA329; Sat, 28 Mar 2015 11:27:04 -0400 (EDT) Content-Disposition: inline In-Reply-To: <8efa389a-8880-491d-8f18-7e8ae1b38669-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-PGP-Key: http://johnmacfarlane.net/jgm.asc User-Agent: Mutt/1.5.23 (2014-03-12) X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 209.85.213.182 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: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:12365 Archived-At: As far as I can see, there's no problem having a blank line after `\item` in latex. So, something like this? import Text.Pandoc.JSON import Text.Pandoc.Walk main :: IO () main = toJSONFilter addHangPara addHangPara :: Maybe Format -> Block -> Block addHangPara (Just (Format "latex")) (Div ("",["references"],[]) (h@(Header _ _ _) : blocks)) = Div ("",["references"],[]) ( [h, latex "\\begin{references}"] ++ concatMap addItem blocks ++ [latex "\\end{references}"] ) where latex = RawBlock (Format "latex") addHangPara _ x = x addItem :: Block -> [Block] addItem x = [RawBlock (Format "latex") "\\item", x]