 
         await
           for figure in attach
-            figuremsg =
-              title: "Figure #{figure.labels[figure.labels.length-1]}"
-              body: body
-
             figure.files = []
-            for filename in figure.graphics
+            for graphic in figure.graphics
+              filename = graphic.filename
               base = basename filename
               file = new File [zip.files[filename].asArrayBuffer()],
                        base,

  unless importer?
    console.warn "Unrecognized import format '#{format}'"
    return
  for file in files
    reader = new FileReader
    reader.onload = (e) ->
      importer group, e.target.result
    reader["readAs#{importer.readAs}"] file

            for file in figure.files
              filerev =
                file: file.file2id
                format: 'latex'
                published: now
              if file.graphic.labels.length > 0
                filerev.title = "Figure " +
                  ("``#{label}''" for label in file.graphic.labels).join " / "
              if file.graphic.subcaption
                filerev.body = file.graphic.subcaption
              filemsg = _.clone filerev
              filemsg.creator = me
              filemsg.created = now
