             for label in graphic.labels
               figures[label] = figure
 
+  title2section = (title) ->
+    title[...title.indexOf ' ']  ## section number
   formatLabel = (label) ->
     "``#{label.replace /^fig:/, ''}''"
 

        if start?
          now = new Date
          body = tex[start...match.index]
          body = body.replace /\\label{([^{}]*)}/g, (match, p1) ->
            labels[p1] = title[...title.indexOf ' ']
            ''
          console.log "Importing '#{title}'"
          messages.push

      depths = []
      start = null
      labels = {}
      links = {}
      messages = []
      figurecount = 0
      r = /\\(sub)*section\s*{((?:[^{}]|{[^{}]*})*)}|\\bibliography/g
