                 @_show() # update layout, since hiding spinner might cause a linebreak in the button bar to go away
                 opts.cb?()
 
-    render_error_page: (cb) =>
+    render_error_page: () =>
+        # looks bad, but it isn't: @_render_error_page is synchronized at it's heart
+        async.series([
+            @get_rnw_concordance,
+            @_render_error_page
+        ])
+
+    _render_error_page: (cb) =>
         log = @preview.pdflatex.last_latex_log
         if not log?
             cb()

        if mesg.file?.slice(0,2) == './'
            mesg.file = mesg.file.slice(2)

        if mesg.line and mesg.file == preview.pdflatex.filename_rnw
            mesg.line = @rnw_concordance(mesg.line)

        elt = @_error_message_template.clone().show()
        elt.find("a:first").click () =>

        @element = templates.find(".salvus-editor-latex").clone()

        @_pages = {}

        # this maps tex line numbers to the ones in the Rnw file via an array
        @_rnw_concordance = null

        # initialize the latex_editor
