lib/polytexnic/literal.rb in polytexnic-1.6.4 vs lib/polytexnic/literal.rb in polytexnic-1.6.5

- old
+ new

@@ -207,19 +207,20 @@ # or by Tralics (where it converted to a link # by the postprocessor). # For completeness, we handle the case where the author neglects to # use the nonbreak space ~. def hyperrefs(string) + part = language_labels["part"] chapter = language_labels["chapter"]["word"] section = language_labels["section"] table = language_labels["table"] box = language_labels["aside"] figure = language_labels["figure"] fig = language_labels["fig"] listing = language_labels["listing"] equation = language_labels["equation"] eq = language_labels["eq"] - linked_item = "(#{chapter}|#{section}|#{table}|#{box}|#{figure}" + + linked_item = "(#{part}|#{chapter}|#{section}|#{table}|#{box}|#{figure}" + "|#{fig}\.|#{listing}|#{equation}|#{eq}\.)" ref = /(?:#{linked_item}(~| ))*(\\(?:eq)*ref){(.*?)}/i string.gsub!(ref) do "\\hyperref[#{$4}]{#{$1}#{$2}#{$3}{#{$4}}}" end