# Markdown footnotes

Markdown footnotes[^footnote] works in the preview window but not when I print/save to pdf and open this in (the OS X application) Preview.

However, copying, saving the HTML to a separate file and then opening it in Safari yields functioning footnotes—even when I print/save THIS document to pdf.

Is this a bug or am I doing something wrong with the preview window?

[^footnot]: Such as this one.

If you are just using File > Print to print from the Drafts main window, you are just printing as plain text. To print as HTML (converted from the Markdown), you need to use an output method that is using your formatting. If you use File > Print while the preview window is to the front with the formatting you desire, you will get the formatted output.

Thanks for taking the time,

However, this is what I’ve tried in Drafts:

1. Show Peview
2. Print
3. Save as PDF
4. Open in Preview

My result (with Drafts 17.2.5 and macOS Mojave 10.14.6, MBP (Retina 15", late 2013):

• External links such as this and even this works but not
• internal links such as this footnote[^fn].

I can get a working pdf by

1. Copy HTML
2. Save HTML in a file
3. Open the file in Safari
4. Print…
5. Save as PDF.
6. Open the pdf in Preview.

So it is possible to get a fully functioning pdf and the process can even be automized but I assume it would be easier if it could be generated directly from the Drafts preview window.

[^fn]: This footnote works fine in the Drafts preview window but not in the pdf generated from it in Preview.

maybe check the “Markdown Options” in the settings on both devices, maybe they are different (there is a switch for Footnotes)

Interesting tip!

Clicking Random footnotes in the Markdown tab of Drafts preferences yields a preview window where the back link works(! as not before) but not the actual footnote. Printing and saving this document to pdf none of these works.

On further inspection the footnote points to this resource:

file:///Applications/Drafts.app/Contents/Resources/#fn:7997

This got me thinking that it could possibly be some kind of a bug that doesn’t seem too impossible to fix.

(BTW the Footnote option has been selected all the time and unmark it doesn’t help either.)

Is anybody able to create a pdf from Drafts with clickable footnotes?

I’ve opened a bug on this to do more research. I don’t see an obvious workaround at the moment, but will see what I can figure out.

Thanks a lot,

Hope I was able to describe the problem clearly.

Since the link information i perfectly all right in the HTML and works in the Drafts preview window it seems to me the problem could be isolated to printing the preview to pdf.

(Maybe this has nothing to do with this issue but it reminds me that links in Word documents never works when saved as pdf. I’ve had to open them with Pages and exporting in order for links the work. Could it be a printing issue?)

I’m not sure the footnote problem is within the control of Drafts or if this finding has anything to do with it but I noticed that TeX code (s.a. $$\int\limits_{0}^{\infty}\frac{x^3}{e^x+1}dx = \frac{\pi^4}{15}$$) renders beautifully in Drafts’ preview window—but not when printing to pdf.

However, copying the HTML (as before) and printing from Safari to pdf does the job. Any hint?

Sorry for the mistake. I just copied som TeX code without checking the validity. Of course it should be:

$$\int\limits_{0}^{\infty}\frac{x^3}{e^x-1}dx = \frac{\pi^4}{15}$$

This is of minor importance for the original problems with Markdown footnotes but it just struck me there was an error. (Actually this integral appears in Planck radiation law which I once used as part of a salary demand in the form of a differential equation, combining atomic numbers for gold, silver and copper among other things I have worked with. It turned out my employer thought everything looked good besides this salary demand which h thought was too low

1 Like