jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.72k stars 3.39k forks source link

LaTeX breaks when identifier of multi-block footnote is in header section #6733

Open jtbayly opened 4 years ago

jtbayly commented 4 years ago

$ pandoc --version pandoc 2.10.1

This is very similar to https://github.com/jgm/pandoc/issues/4521. Perhaps even the same problem at root.

Here's some example markdown:

## Introduction[^testlong]

[^testlong]: Here is my multiparagraph footnote.

    Second paragraph of footnote.

Text of chapter comes here.

HTML (and ePub) outputs work just fine, but LaTeX produces the following error message:

! Paragraph ended before \hypertarget was complete.
<to be read again> 
                   \par 
l.182 

It appears to be a problem with LaTeX, in general, but there is also a solution mentioned on the previous issue:

Change empty line inside footnote to empty TeX comment

Perhaps multi-paragraph footnotes output in LaTeX can be made more robust by doing this in general?

jgm commented 4 years ago

Change empty line inside footnote to empty TeX comment

Wouldn't this have the effect of removing the paragraph break?

jtbayly commented 4 years ago

I’m not sure. Sorry. I was just relying on the legwork already done in that other issue, and assuming the solution was good.

I suppose that even if it did remove the paragraph break that would be better than failing with an error when the markdown is fine.

jtbayly commented 4 years ago

… Or maybe an error is actually better so you don’t silently produce unexpected output.