def mod_abstract(text)
#      return text
      abstract,section = [],[]
      content = ""
      text.split("\n").each do |line|
        case line
        when /^\\section(.+)/
          section.push $1
        end
#        p section[-1]
        case section[-1]
        when /\{abstract\}/, /\{【abstract】\}/
          abstract << line+"\n"
        when /\{概要\}/, /\{【概要】\}/
          abstract << line+"\n"
        else
          content << line+"\n"
        end
      end
#      p abstract
      if abstract.size>1 then
        abstract.delete_at(0)
        content.gsub!(/\\tableofcontents/){|text|
          tt="\n\\abstract\{\n#{abstract.join}\}\n\\tableofcontents"
        }
      end
      return content
    end
def mod_abstract(text)
#      return text
      abstract,section = [],[]
      content = ""
      text.split("\n").each do |line|
        case line
        when /^\\section(.+)/
          section.push $1
        end
#        p section[-1]
        case section[-1]
        when /\{abstract\}/, /\{【abstract】\}/
          abstract << line+"\n"
        when /\{概要\}/, /\{【概要】\}/
          abstract << line+"\n"
        else
          content << line+"\n"
        end
      end
#      p abstract
      if abstract.size>1 then
        abstract.delete_at(0)
        content.gsub!(/\\tableofcontents/){|text|
          tt="\n\\abstract\{\n#{abstract.join}\}\n\\tableofcontents"
        }
      end
      return content
    end
convert section to abstract in the plain text