URLs with special characters in Footnotes

Hi, I often need to link to URLs with special characters like

https://en.wikipedia.org/wiki/List_of_online_music_databases http://millionsongdataset.com/sites/default/files/AdditionalFiles/unique_artists.txt

in Footnotes.

I always remove the link, otherwise LaTeX would make a construct like this:

\footnote{\href{https://en.wikipedia.org/wiki/List_of_online_music_databases}{ https:\slash \slash en.wikipedia.org\slash wiki\slash List\emph{of}online\emph{music}databases}\footnote{\href{https://en.wikipedia.org/wiki/List_of_online_music_databases}{https:\slash \slash en.wikipedia.org\slash wiki\slash List\_of\_online\_music\_databases}}

Without the URL being a link it‘s slightly better (without the double footnote) but the underscores are still not escaped:

\footnote{https:\slash \slash en.wikipedia.org\slash wiki\slash List\emph{of}online\emph{music}databases}

What I do want is:

\footnote{https://en.wikipedia.org/wiki/List\_of\_online\_music\_databases}

I compile MMD to LaTeX.

How do I archive this or what workaround is there for this kind of requirement? Thanks!

Hi kb,

Your question appears to be a particularly narly one for which I myself have not found an answer.

The only reference I was able to find was to a solution offered by Ijon Tichy on Latex.org:

(https://latex.org/forum/viewtopic.php?t=33574#p113105)

that the author themselves states is problematic and does NOT recommend.

Have you thought of posting your question on StackExchange.com, e.g.:

https://tex.stackexchange.com/search?q=URLs+with+special+characters+in+Footnotes ?

I believe there is a larger audience on StackExchange.com with some pretty creative types that may have an answer.

Thanks,
scrive
:slight_smile:

Thanks for your reply! Actually I tinkered a bit and switched to a compile Option using a Python Script and some really “creative” Regexes to tackle these problems before and after using MMD to convert to Tex. This way my Scrivener Export directly generates a PDF file via Markdown, Regex, MMD to TeX, Regex, XeLaTeX, BibTeX, XeLaTeX, cleanup.