public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Spacing too short between a bibliography and a subsequent heading in PDF output (with a solution/workaround)
@ 2021-02-09 10:37 Bastien DUMONT
  0 siblings, 0 replies; only message in thread
From: Bastien DUMONT @ 2021-02-09 10:37 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1715 bytes --]

With the attached file test-biblio-header-spacing.md and the default LaTeX template, I observed that the space between the bibliography and the subsequent heading is too short in PDF output (see bad.pdf). This comes from the l. 381 in the default template that implements the hanging indentation in the CSLReferences environment:

   \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi

I have not been able to tweak \everypar so that I could, for instance, revert it to its former definition at the end of the environment. Instead, as \hangindent needs to be reset at every paragraph and bibliographical items are always preceded by the \leavevmode command, I achieved the same result by redefining \leavevmode without interfering with the spacing at the end of the bibliography (see custom-template.latex and good.pdf):

   \ifodd #1
   \edef\leavevmodesave{\leavevmode}
   \def\leavevmode{\leavevmodesave\setlength{\hangindent}{\cslhangindent}}
   \fi

(Notice that I removed \ignorespaces here: since we are at the beginning of a paragraph, I suspect it is not relevant. But I may be mistaken.)

However I have only vague ideas about TeX. Although I haven't noticed any side effect, I fear that I have missed something, or that a cleaner solution exists. Has anyone a better insight?

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/YCJl10BwugKyauLh%40localhost.

[-- Attachment #2: test-biblio-header-spacing.md --]
[-- Type: text/markdown, Size: 822 bytes --]

---
title: My lesson
lang: en
references:
- type: article-journal
  id: first
  title: A first reference whith a long title to show the hanging indent
  author:
  - family: Firstauthor
    given: Hername
  container-title: A rather long journal title
  issue: 200
  issued: 2020
- type: article-journal
  id: second
  title: A second, newer reference whith a long title to show the hanging indent
  author:
  - family: Secondauthor
    given: Hisname
  container-title: A rather long journal title
  issue: 201
  issued: 2021
---

# Mandatory readings

:::{#refs}
:::

# Introduction

Before reading this, please see the abovementionned papers. These are very important for the purpose of this lesson.

# Basics

So you read the articles, right? Let's expose the basics first, and then we will be able to elaborate on it.

[-- Attachment #3: bad.pdf --]
[-- Type: application/pdf, Size: 90328 bytes --]

[-- Attachment #4: good.pdf --]
[-- Type: application/pdf, Size: 90323 bytes --]

[-- Attachment #5: custom-template.latex --]
[-- Type: application/x-latex, Size: 13963 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-09 10:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 10:37 Spacing too short between a bibliography and a subsequent heading in PDF output (with a solution/workaround) Bastien DUMONT

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).