From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/13334 Path: news.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Issues with using include-before/include-after when output is pdf Date: Thu, 23 Jul 2015 09:20:35 -0700 Message-ID: <20150723162035.GF31766@protagoras.berkeley.edu> References: <12a3b4c1-e64e-4f0d-ba1b-545311045f86@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 1437668464 27482 80.91.229.3 (23 Jul 2015 16:21:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jul 2015 16:21:04 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBYNIYSWQKGQE34NRM3Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jul 23 18:20:51 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-vn0-f62.google.com ([209.85.216.62]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZIJEo-0000Xh-Oy for gtp-pandoc-discuss@m.gmane.org; Thu, 23 Jul 2015 18:20:50 +0200 Original-Received: by vnct143 with SMTP id t143sf57616702vnc.0 for ; Thu, 23 Jul 2015 09:20:50 -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:x-spam-checked-in-group:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe; bh=sE2Y59dy8Mvl0TJ4hEAx/sez91hx/F22l3XKxXdgxMw=; b=y0ukV8KTTSw9yoAHVmQTKiyPnkFSh0I9tPBT8n2XxIXMyW8++UwU3o7setLD4kgN13 EpG6t4WNwEwKDFBYKnuMYVsSWiwynI7S+EdiMxLHEIDKm5ScXksM2C1PWOxD4bYMeqVL 0pw6KR8Xz/K+LX/zVnsFK0BK4tKVrBYik7aXdjjpFMPewg8r9C2+qr9UMAtvrLbpMsHk wZ+/QGyrj0V/clQt4WvxnzaiFD/gAhe+5CQ6rSdksZFhnvUUuRFEGtJ31dFKAzBMs8Dp pM4tO+C7pnuWKx4pJF/rYqxKksp/8EmxqwEYLvWKYYk3HDLY1QSWTdYer+HzvV+dxYAX 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:x-spam-checked-in-group :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=sE2Y59dy8Mvl0TJ4hEAx/sez91hx/F22l3XKxXdgxMw=; b=Cys9x9aRn/R6NHyFiqbqbrOnJwZSUeDwcjmSaNhzxANJk7uH2XBlP69h8+ezIPUa6f 3YYzN3pvRtVw8dZhAkKMHZSQ6fT323rl6I50GMr2NuA8aABw3AT99NtiM9LVKngPfdSu CV4W9fTBW0LzF610Q5ZSJPcYUyvcrhiRcb6K7GVp6t4Nxc0Ej242Xc/+SQE5nYOu10VC GyESrCSuVXEl5D66fiN9jKGJUOZaSeroA3lwIkOarH4hHh3phr0Gnv/7b8XRyJNo6o40 KOeQZcC7sNANIb4x55Ydm+z74WfBub+mTkZjegD0f24hZg X-Received: by 10.140.101.243 with SMTP id u106mr194470qge.27.1437668450127; Thu, 23 Jul 2015 09:20:50 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.140.33.5 with SMTP id i5ls1031570qgi.50.gmail; Thu, 23 Jul 2015 09:20:49 -0700 (PDT) X-Received: by 10.140.232.13 with SMTP id d13mr8793067qhc.2.1437668449348; Thu, 23 Jul 2015 09:20:49 -0700 (PDT) Original-Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com. [209.85.192.170]) by gmr-mx.google.com with ESMTPS id x3si936616pdh.2.2015.07.23.09.20.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jul 2015 09:20:49 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 209.85.192.170 as permitted sender) client-ip=209.85.192.170; Original-Received: by pdbnt7 with SMTP id nt7so88523884pdb.0 for ; Thu, 23 Jul 2015 09:20:49 -0700 (PDT) X-Gm-Message-State: ALoCoQlIj+Q0LI72VGwceYjMOR0iQvBOLwRzTbuCQrTQEQLKGELc4vAZB/AqZ43E38CnCvdC0OzY X-Received: by 10.70.126.193 with SMTP id na1mr20475016pdb.26.1437668449167; Thu, 23 Jul 2015 09:20:49 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id br14sm5203622pdb.47.2015.07.23.09.20.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jul 2015 09:20:47 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id B160AA30F; Thu, 23 Jul 2015 12:20:35 -0400 (EDT) Content-Disposition: inline In-Reply-To: <12a3b4c1-e64e-4f0d-ba1b-545311045f86-/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.192.170 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-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:13334 Archived-At: Currently pandoc-citeproc adds the bibliography to the body. You can use a pandoc filter to intercept this section (which has the identifier "references") and put it inside a special latex environment. That would probably be the easiest solution. See http://pandoc.org/scripting for basic instructions; if you need help, ask here. +++ Tahir B [Jul 23 15 09:12 ]: > I wanted to format the body of my article text such that paragraphs > (all but first in a section) were indented and that lines were spaced > out. But I wanted the bibliography to not be indented and have normal > spacing. > Following the instructions I got from some Google searches I thought > the following would do the trick: > --- >title: This is a test >linestretch: 1.5 >header-includes: > - \usepackage{fullpage} >include-before: > - \setlength{\parindent}{15pt} >include-after: > - \setlength{\parindent}{0pt} > - \setstretch{1} >--- > >Unfortunately this did not work as I had hoped. I tried three approaches for gen >erating a pdf: just pandoc, pandoc+csl+latex, pandoc+biblatex+latex. In all thre >e cases what I found was that the include-after lines were added actually after >the bibliography command had been called. > >Here is my attempt to reproduce the issue: > >[1]https://gist.github.com/majorgreys/af344eb9824b947f393b > >In the pandoc+csl+latex outputted tex file I got this: > >\section*{References}\label{references} >\addcontentsline{toc}{section}{References} > >Last, First. 1981. \emph{Book Title}. Publisher. > >---------. 2001. \emph{Book Title 2}. Publisher. > >\setlength{\parindent}{0pt} > >\setstretch{1} > > >And, in the pandoc+biblatex+latex outputted tex file I got this: > >\printbibliography[title=References] > >\setlength{\parindent}{0pt} > >\setstretch{1} > > >This then led me to look at the default latex template, where the relevant lines > are: > >$body$ > >$if(natbib)$ >$if(bibliography)$ >$if(biblio-title)$ >$if(book-class)$ >\renewcommand\bibname{$biblio-title$} >$else$ >\renewcommand\refname{$biblio-title$} >$endif$ >$endif$ >\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} > >$endif$ >$endif$ >$if(biblatex)$ >\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$ > >$endif$ >$for(include-after)$ >$include-after$ > >$endfor$ > > >Now it makes sense why in all three approaches the include-after clauses do not >end up affecting the bibliography. > >I can certainly modify the latex template so that the include-after block is bef >ore the natbib block. But that only resolves the issue when I'm not using citepr >oc. > >I wonder if include-after behavior for straight pdf output should actually be li >ke the modified latex template I just described. Should $body have the citeproc- >generated bibliography appended to it or should the include-after applied before > the bibliography is inserted into the document? I expected that the latter woul >d be how things worked, but maybe there are many good reasons for the former to >be the typical behavior. > >Hope my issue and questions made sense. > >Thanks! >Tahir > > -- > 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 [2]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to > [3]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > [4]https://groups.google.com/d/msgid/pandoc-discuss/12a3b4c1-e64e-4f0d- > ba1b-545311045f86%40googlegroups.com. > For more options, visit [5]https://groups.google.com/d/optout. > >References > > 1. https://gist.github.com/majorgreys/af344eb9824b947f393b > 2. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > 3. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > 4. https://groups.google.com/d/msgid/pandoc-discuss/12a3b4c1-e64e-4f0d-ba1b-545311045f86-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer > 5. https://groups.google.com/d/optout