diff --git a/lib/redcloth_for_tex.rb b/lib/redcloth_for_tex.rb index fbf23688..c238ed7c 100644 --- a/lib/redcloth_for_tex.rb +++ b/lib/redcloth_for_tex.rb @@ -7,6 +7,7 @@ class String gsub!( '&', '\\\\&' ) gsub!( '%', '\%' ) gsub!( '$', '\$' ) + gsub!( '~', '$\sim$' ) end end @@ -459,14 +460,16 @@ class RedClothForTex < String (?=\s|$) /x ) do |m| pre,atts,text,title,url,slash,post = $~[1..7] - + + url.gsub!(/(\\)(.)/, '\2') url = check_refs( url ) atts = pba( atts ) atts << " title=\"#{ title }\"" if title atts = shelve( atts ) if atts - "#{ pre }#{ text }#{ post }" + "#{ pre }\\textit{#{ text }} \\footnote{\\texttt{\\textless #{ url }#{ slash }" + + "\\textgreater}#{ post }}" end end