Improved rendering of hyperlinks in TeX and PDF [sfoy]
This commit is contained in:
parent
78bad46419
commit
68683890e1
|
@ -7,6 +7,7 @@ class String
|
||||||
gsub!( '&', '\\\\&' )
|
gsub!( '&', '\\\\&' )
|
||||||
gsub!( '%', '\%' )
|
gsub!( '%', '\%' )
|
||||||
gsub!( '$', '\$' )
|
gsub!( '$', '\$' )
|
||||||
|
gsub!( '~', '$\sim$' )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -459,14 +460,16 @@ class RedClothForTex < String
|
||||||
(?=\s|$)
|
(?=\s|$)
|
||||||
/x ) do |m|
|
/x ) do |m|
|
||||||
pre,atts,text,title,url,slash,post = $~[1..7]
|
pre,atts,text,title,url,slash,post = $~[1..7]
|
||||||
|
|
||||||
|
url.gsub!(/(\\)(.)/, '\2')
|
||||||
url = check_refs( url )
|
url = check_refs( url )
|
||||||
|
|
||||||
atts = pba( atts )
|
atts = pba( atts )
|
||||||
atts << " title=\"#{ title }\"" if title
|
atts << " title=\"#{ title }\"" if title
|
||||||
atts = shelve( atts ) if atts
|
atts = shelve( atts ) if atts
|
||||||
|
|
||||||
"#{ pre }<a href=\"#{ url }#{ slash }\"#{ atts }>#{ text }</a>#{ post }"
|
"#{ pre }\\textit{#{ text }} \\footnote{\\texttt{\\textless #{ url }#{ slash }" +
|
||||||
|
"\\textgreater}#{ post }}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue