I'm writing an essay but I'm stuck with a problem. In my little example I've got two Markdown files
- test1.md: one chapter with two footnotes, [^1] and [^2]
- test2.md: one chapter with two footnotes, [^1] and [^2]
Converting each file to PDF through pandoc keeps those footnotes the right way. The problem appears when I generate the combined PDF. Then I get the four footnotes ordered from 1 to 4. I use this metadata.yaml:
---
title: Prueba footnotes
author: javipas
date: 2023-01-11
tags: [documentation, example]
documentclass: book
header-includes: |
\usepackage{footnotebackref}
\usepackage{chngcntr}
\counterwithout{footnote}{chapter}
---
And the pandoc command is used the following way:
pandoc -t pdf test1.md test2.md metadata.yaml -s --file-scope --output=test.pdf
But all I get there is the footnotes 1 and 2 (1 and 2 of Chapter 1) at the end of the page where they are shown, and then the footnotes 3 and 4 (1 and 2 of Chapter 2) at the end of the page where they are shown in Chapter 2.
What I want is the footnotes to restart on each chapter, so those 3 and 4 should be again a 1 and a 2. I saw on SuperUser that using the --file-scope flag could help, but it doesn't (or I don't see how). I've seen that there are answers to this if you write the document with a LaTeX editor, but that's a little too much for me and I would like to continue to work with Markdown if possible.
I'm using MacTex on a Mac M1 and macOS Ventura updated to the latest version. Pandoc is on version 2.19.2. I think some TeX header-includes could help, but those used in the metadata.yaml don't seem to be the right ones.