Skip to content

Instantly share code, notes, and snippets.

@kauplan
Created February 13, 2020 05:11
Show Gist options
  • Save kauplan/973d5037e2cc0f8edb474bd0960c2dcc to your computer and use it in GitHub Desktop.
Save kauplan/973d5037e2cc0f8edb474bd0960c2dcc to your computer and use it in GitHub Desktop.
「@<href>{URL, TEXT}」を「TEXT\footnote{\url{URL}}」に変換する
ReVIEW::LATEXBuilder.class_eval do
def compile_href(url, label)
if /\A[a-z]+:/ =~ url
if label
#macro('href', escape_url(url), escape(label)) # original
escape(label) + macro('footnote', macro('url', escape_url(url)))
else
macro('url', escape_url(url))
end
else
macro('ref', url)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment