From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/13542 Path: news.gmane.org!not-for-mail From: nickbart1980-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Newsgroups: gmane.text.pandoc Subject: Re: Specifying location of bibliography in document Date: Mon, 31 Aug 2015 00:09:15 -0700 (PDT) Message-ID: <42c762b6-b9b7-4748-b2b9-12daa5046c78@googlegroups.com> References: <20150829140403.GA47273@MacBook-Air.local> <20150829142113.GA47586@MacBook-Air.local> <20150829154527.GA49705@MacBook-Air.local> <20150831055419.GC60048@MacBook-Air.local> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2550_1372658477.1441004955142" X-Trace: ger.gmane.org 1441004963 602 80.91.229.3 (31 Aug 2015 07:09:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 31 Aug 2015 07:09:23 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDIPX6WQ4INBBHH3R6XQKGQE7AKIKTY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Aug 31 09:09:18 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-qg0-f58.google.com ([209.85.192.58]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZWJDQ-0004Ub-3u for gtp-pandoc-discuss@m.gmane.org; Mon, 31 Aug 2015 09:09:16 +0200 Original-Received: by qgz60 with SMTP id 60sf1974409qgz.1 for ; Mon, 31 Aug 2015 00:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe; bh=MDnAIJUoj/0Q+8HblhvOyFud+BYLUyIVPRmJXMwKCWI=; b=jXMFSFci00bWgCqBIoLgn2VOUoM3XNUi9c/TgWCPU0H74y77tzMk+1paLaBDi7uSs3 pMG81WgGFTwdqfaQKEukfA5RCqbzXWDU2Vgj9/O7Y9wzm8Lzf0Qbg+v10sryewitQTev 8BR9may7/2QU6wbDdkCQ+ivhK7lHwFaeDpZYO3MM/+laY3X8ZQskoQKm+nIOIdMo0RPf DqMnegMU8+lfavvpt6HwBppizw+UhG21gJyePEJx65WFJcveKKrr9bMxWlzPmiFl4pTB 6QrW1pDtaKSNgKDrE8qw15+CJI4R7rce9SbQ6BGLLvvJi+GgkNKliLnzMlIDimq1PO// E9QA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe; bh=MDnAIJUoj/0Q+8HblhvOyFud+BYLUyIVPRmJXMwKCWI=; b=afp/bIrUcvq8L+79LVhpXXquuwE4QPScsyh6/lx8h2pK9wXJIDb3AB8ZYWmP25mwFX Tpy3OtPzrhl+L/3mrEV/2sAOksOogHuKc4zOx6WWM3ihH7YjV1AewFoCwW8WRX9aJ5En k6PuT1so/yqYo/RZdwDzTn34Pi38ReLSYwoq9mU2/hjLnxBDCFIlOTUKWu74TSmbDmuq 8jsglFJp13ciz995urNfm0b5ZA53f5YWBOHUGJBlNnfUbTQpVKCLs7e6iyLe68yd3K/c ZgRqA/gYjw27T+yeVeONzBIYTvNBQ4ydi2aNyBVAdAysRUKwZvGkZg7I9SOr0InAcFBw GtOw== X-Received: by 10.182.240.227 with SMTP id wd3mr316582obc.3.1441004956431; Mon, 31 Aug 2015 00:09:16 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.182.91.111 with SMTP id cd15ls2982495obb.26.gmail; Mon, 31 Aug 2015 00:09:15 -0700 (PDT) X-Received: by 10.182.52.169 with SMTP id u9mr317147obo.21.1441004955970; Mon, 31 Aug 2015 00:09:15 -0700 (PDT) In-Reply-To: <20150831055419.GC60048-jF64zX8BO08aTFSqC7bH4WZHpeb/A1Y/@public.gmane.org> X-Original-Sender: nickbart1980-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-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:13542 Archived-At: ------=_Part_2550_1372658477.1441004955142 Content-Type: multipart/alternative; boundary="----=_Part_2551_1096754554.1441004955143" ------=_Part_2551_1096754554.1441004955143 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I have a filter that adds the needed raw latex commands: ~~~ #!/usr/bin/env runhaskell -- addRefEnvItem.hs import Text.Pandoc.JSON main :: IO () main =3D toJSONFilter addRefEnvItem addRefEnvItem :: Maybe Format -> Block -> Block addRefEnvItem (Just (Format "latex")) (Div ("",["references"],[]) (h@(Header _ _ _) : blocks)) =3D Div ("",["references"],[])=20 ( [h, latex "\\begin{references}\\sloppy"] ++=20 concatMap addItem blocks ++ [latex "\\end{references}"] ) where latex =3D RawBlock (Format "latex") addRefEnvItem _ x =3D x addItem :: Block -> [Block] addItem x =3D [RawBlock (Format "latex") "\\item", x]=20 ~~~ =E2=80=A6 but it has stopped working after the latest updates. What are the= =20 adjustments needed? On Monday, August 31, 2015 at 5:54:33 AM UTC, John MacFarlane wrote: > > +++ Andrew Dunning [Aug 30 15 13:06 ]:=20 > > Will this also allow for the insertion of extra markup through a=20 > > template? (For instance, a LaTeX class I am using wants the=20 > > bibliography to be surrounded=20 > > by \begin{thebibliography}...\end{thebibliography}, and it would be= =20 > > fantastic to be able to achieve that.)=20 > > The bibliography was never part of a template and still=20 > isn't. It is inserted directly into the document body.=20 > > There are various ways to achieve what you want. One is=20 > write a simple filter that can run after pandoc-citeproc.=20 > It would intercept a Div with id =3D references, and=20 > add the needed raw latex commands to the beginning and end=20 > of its contents.=20 > > --=20 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 e= mail 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/42c762b6-b9b7-4748-b2b9-12daa5046c78%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_2551_1096754554.1441004955143 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I have a filter that adds the needed raw latex commands:
~~~
#!/usr/bin/env runhaskell

-- addRefEnvItem.hs

im= port Text.Pandoc.JSON

main :: IO ()
main =3D toJSONFilter addRefE= nvItem

addRefEnvItem :: Maybe Format -> Block -> Block
addR= efEnvItem (Just (Format "latex"))
=C2=A0 (Div ("",[&= quot;references"],[]) (h@(Header _ _ _) : blocks)) =3D
=C2=A0 Div (= "",["references"],[])
=C2=A0=C2=A0=C2=A0 ( [h, late= x "\\begin{references}\\sloppy"] ++
=C2=A0=C2=A0=C2=A0 concat= Map addItem blocks ++ [latex "\\end{references}"] )
=C2=A0 whe= re latex =3D RawBlock (Format "latex")
addRefEnvItem _ x =3D x=

addItem :: Block -> [Block]
addItem x =3D [RawBlock (Format &= quot;latex") "\\item", x]
~~~

=E2=80=A6 but it ha= s stopped working after the latest updates. What are the adjustments needed= ?

On Monday, August 31, 2015 at 5:54:33 AM UTC, John MacFarlane wrot= e:
+++ Andrew Dunning [Aug 30 1= 5 13:06 ]:
> =C2=A0 Will this also allow for the insertion of extra markup thro= ugh a
> =C2=A0 template? (For instance, a LaTeX class I am using wants the
> =C2=A0 bibliography to be surrounded
> =C2=A0 by \begin{thebibliography}...\end{thebibliography}, an= d it would be
> =C2=A0 fantastic to be able to achieve that.)

The bibliography was never part of a template and still
isn't. =C2=A0It is inserted directly into the document body.

There are various ways to achieve what you want. =C2=A0One is
write a simple filter that can run after pandoc-citeproc.
It would intercept a Div with id =3D references, and
add the needed raw latex commands to the beginning and end
of its contents.

--
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/42c762b6-b9b7-4748-b2b9-12daa5046c78%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_2551_1096754554.1441004955143-- ------=_Part_2550_1372658477.1441004955142--