2

I've looked and looked but can't find the answer. (I have read the manual! Cover to cover. Many times. But I may still have missed it ...) How do I disable a pandoc reader option? The specific one I'm after is --file-scope. From Pandoc's behaviour it is clear that --file-scope is on. I have a doc with over a thousand footnotes to convert (to epub3) split up into chapters in markdown and the author numbered them consecutively thru the the whole document. Pandoc is starting the numbering over for each section/"file"/chapter. Alternatively, there's no specific command controlling footnote numbering, is there?

Thanks very much for any useful answers in advance Mike

user1625815
  • 65
  • 1
  • 7

1 Answers1

1

What you are seeing isn't the effect of --file-scope (which is disabled by default), but of pandoc's feature that it splits the document into different files (within the epub) at the chapter level. In each file, footnotes are reset and start again from "1". This is a long-standing issue in pandoc.

The only workaround I see is to call pandoc with --shift-heading-level-by=1, but that will change your document structure. External tools are needed to fix this.

Aside: splitting into files can be increased via --epub-chapter-level, but not reduced.

tarleb
  • 19,863
  • 4
  • 51
  • 80
  • 1
    Sorry I have no idea how I missed that open issue. It occurred to me that if I have some repeatable/reproducible workflow I could just unip the epub3 last step and fix the id and href props in the xhtml files to be consecutively numbered myself. FWIW, I found the discussion of --file-scope in the manual pretty confusing. You could conceivably think that if "file scope" is disabled then it would number consecutively thru the whole epub. The manual talks explicitly about section numbering, etc. but not footnote numbering. If it's of any use. Thanks very much for the feedback. Know what to do now – user1625815 Mar 14 '21 at 19:56