def convert_string(item)

      escape(item).
      
      
      # convert ... to elipsis (and make sure .... becomes .<elipsis>)
        gsub(/\.\.\.\./, '.\ldots{}').gsub(/\.\.\./, '\ldots{}').

      # convert single closing quote
        gsub(%r{([^ \t\r\n\[\{\(])\'}) { "#$1'" }.
        gsub(%r{\'(?=\W|s\b)}) { "'" }.

      # convert single opening quote
        gsub(/'/, '`').

      # convert double closing quote
        gsub(%r{([^ \t\r\n\[\{\(])\"(?=\W)}) { "#$1''" }.

      # convert double opening quote
        gsub(/"/, "``").

      # convert copyright
        gsub(/\(c\)/, '\copyright{}')

    end
def convert_string(item)

      escape(item).
      
      
      # convert ... to elipsis (and make sure .... becomes .<elipsis>)
        gsub(/\.\.\.\./, '.\ldots{}').gsub(/\.\.\./, '\ldots{}').

      # convert single closing quote
        gsub(%r{([^ \t\r\n\[\{\(])\'}) { "#$1'" }.
        gsub(%r{\'(?=\W|s\b)}) { "'" }.

      # convert single opening quote
        gsub(/'/, '`').

      # convert double closing quote
        gsub(%r{([^ \t\r\n\[\{\(])\"(?=\W)}) { "#$1''" }.

      # convert double opening quote
        gsub(/"/, "``").

      # convert copyright
        gsub(/\(c\)/, '\copyright{}')

    end
some of these patterns are taken from SmartyPants...