Improved rendering of hyperlinks in TeX and PDF [sfoy]

This commit is contained in:
Alexey Verkhovsky 2005-03-27 18:32:26 +00:00
parent 78bad46419
commit 68683890e1

View file

@ -7,6 +7,7 @@ class String
gsub!( '&', '\\\\&' ) gsub!( '&', '\\\\&' )
gsub!( '%', '\%' ) gsub!( '%', '\%' )
gsub!( '$', '\$' ) gsub!( '$', '\$' )
gsub!( '~', '$\sim$' )
end end
end end
@ -460,13 +461,15 @@ class RedClothForTex < String
/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