         if mesg.content
             elt.find(".salvus-latex-mesg-content").show().text(mesg.content)
         return elt
+
+    # convert line number of tex file to line number in Rnw file
+    rnw_concordance: (line) =>
+        if not @_rnw_concordance?
+            return line
+
+    get_rnw_concordance: (cb) =>
+        if @preview.pdflatex.ext == 'rnw'
+            conc_fn = @preview.pdflatex.base_filename + '-concordance.tex'
+            salvus_client.read_text_file_from_project
+                project_id : @project_id
+                path       : @_path + '/' + conc_fn
+                cb         : (err, res) =>
+                    err ?= res.error
+                    if err
+                        alert_message
+                            type    : "error"
+                            message : "Unable to read concordance file -- #{err}"
+                    else
+                        c = res.content
+                        c = c.split('%')[1..].join(' ').replace(/\n/g, '')
+                        c = c[...c.indexOf('}')]
+                        @_rnw_concordance = (parseInt(n) for n in c.split(/[ ]+/))
+                    cb()
+        else
+            cb()
 
     download_pdf: (print = false) =>
         redux.getProjectActions(@project_id).download_file

                @_show() # update layout, since hiding spinner might cause a linebreak in the button bar to go away
                opts.cb?()

    render_error_page: () =>
        log = @preview.pdflatex.last_latex_log
        if not log?
            return
        p = (new LatexParser(log)).parse()


editor          = require('./editor')
printing        = require('./printing')
{project_tasks} = require('./project_tasks')
{salvus_client} = require('./salvus_client')

templates = $("#salvus-editor-templates")

