public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Tahir B <tahir.butt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Issues with using include-before/include-after when output is pdf
Date: Thu, 23 Jul 2015 09:12:28 -0700 (PDT)	[thread overview]
Message-ID: <12a3b4c1-e64e-4f0d-ba1b-545311045f86@googlegroups.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 3295 bytes --]

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 generating a pdf: just pandoc, pandoc+csl+latex, pandoc+biblatex+latex. In all three 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: 


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 before the natbib block. But that only resolves the issue when I'm not using citeproc.


I wonder if include-after behavior for straight pdf output should actually be like 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 would 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 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/12a3b4c1-e64e-4f0d-ba1b-545311045f86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 5828 bytes --]

             reply	other threads:[~2015-07-23 16:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23 16:12 Tahir B [this message]
     [not found] ` <12a3b4c1-e64e-4f0d-ba1b-545311045f86-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-07-23 16:20   ` John MacFarlane
     [not found]     ` <20150723162035.GF31766-nFAEphtLEs/fysO+viCLMa55KtNWUUjk@public.gmane.org>
2015-08-24 16:27       ` Tahir B
     [not found]         ` <7cc8e08e-14fd-4d56-b258-036540acba31-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-08-24 17:14           ` John MACFARLANE
     [not found]             ` <20150824171445.GB45262-4kKid1p5UN4xFjuZnxJpBp3lxR28IOakuDuwTybUTCk@public.gmane.org>
2015-08-24 17:28               ` Tahir B
     [not found]                 ` <5b01e8e8-d59b-4589-a46c-ecdbc010df4d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-08-24 17:42                   ` Tahir B

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12a3b4c1-e64e-4f0d-ba1b-545311045f86@googlegroups.com \
    --to=tahir.butt-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).