Html links in footnotes

I feel like I should know this, but i’m getting stuck repeatedly.

I’m wanting to place a footnote which has in it html LINKED TEXT. Whatever way around i do it, thus far, I get a footnote, with the TEXT, which is suitably linked. Great … but it also includes another nested footnote … which I don’t want.

I have set “Convert links to Multimarkdown” and tried both using plain multimarkdown :

[text](http://link)

I’ve also tried using Scrivener links, via CTRL + K to insert linked text …

and using inline footnotes too.

Same result. Am i missing something?

I feel like I’ve worked around this before, but looking around the forum, I’ve not found anything quite about this.

Thoughts, anyone?

We can help you better if you post a minimal working example and then the exact output you are getting. The following should work just fine:

Here is main text.^[And here is footnote text with a [hyperlink](https://www.google.com).]

Note that it should not matter whether you use inline markdown syntax like I have above, or put the text in a Scrivener footnote.

1 Like

One more thing: I do not have “Convert links to Multimarkdown” checked. Are you sure that is needed? Give it a try without that.

Also, are you processing the markdown with pandoc?

1 Like

For the record, it should work fine with Scrivener’s hyperlink conversion option as well. These were input as simple “rich text” formatted footnotes and links. Sample output:

Whik gronk; thung epp rintax whik jince dwint srung sernag nix la quolt sernag brul jince.[^cf1] Twock, quolt whik tharn dri cree gen... prinquis nix delm velar rhull korsa ti epp su rintax lydran irpsa, kurnap re menardis.[^fn1]

[^cf1]: Here is an inline footnote with [a link in it](https://www.literatureandlatte.com/).

[^fn1]: Here is an inspector footnote with [a link in it](https://www.literatureandlatte.com/).

A few things to check:

  • Your forum profile says macOS Scrivener 3.2.3, which is quite old. Maybe it’s just the forum tag that needs to be updated though.

  • Are you talking about the converted result you are getting to some file type? For example, MMD’s LaTeX output will indeed place hyperlinks in a footnote, for printability, and I haven’t tried it, but I would presume you’d get a nested footnote in that condition (is that undesirable?).

    You can’t disable that. I did not want that look for our user manuals, so I added a regex to my post-processing script, that runs after LaTeX conversion. Here is the search pattern, to be replaced with nothing:

    \\footnote\{\\href[^\}]+\}\{[^\}]+\}\}

    That will only nuke footnotes that consist entirely of an \href{text}{url} command, from end to end. So the footnote that has a hyperlink somewhere within it will remain. I think that could be expanded upon to only strip out footnotes with footnotes that are only hyperlinks, if you wanted to be more surgical about it, but it might get complicated if you have footnotes with multiple links.

2 Likes

Apologies for poor quality of original post — it was late, at the end of a long day!

I’ll work through these suggestions and report back…

This seems to describe the problem. It is after La/XeTex processing to pdf that I have the undesirable result. I’ll look at a workaround, like you’ve done. A lot of websites seem to relocate docs without leaving permalinks in place, so I may move over to naming a document that can be searched for, rather than direct link.

I’ll update my Scrivener version.

I have seen the Internet Archive used as a backup reference before, so that if the primary fails, one can still get to what you were referring to.

1 Like

You may be wedded to your workflow, but it sounds like maybe you aren’t processing the markdown with Pandoc?

Correct; I don’t use Pandoc. My workflow is Scrivener, MMD, Latex, PDF.

That is how I rolled, too. Until I had a few cases of needing to produce docx and since then I’ve used Scrivener as a rich text editor for markdown, using Pandoc to process my Scrivener inputs and spit out docx/pdf/tex depending on my desired output.

2 Likes