 
 $ = window.$
 
-async = require('async')
-
-misc = require('smc-util/misc')
-misc_page = require('./misc_page')
-
+async           = require('async')
+underscore      = require('underscore')
+
+misc            = require('smc-util/misc')
+misc_page       = require('./misc_page')
 {defaults, required} = misc
 
 {alert_message} = require('./alerts')

        ###

    cms: =>
        [@latex_editor.codemirror, @latex_editor.codemirror1]

    spell_check: (cb) =>
        @preview.pdflatex.spell_check

    _reset_inline_errors: () =>
        $('[data-toggle="popover"]').popover('hide')
        for cm in @cms()
            cm.clearGutter('Codemirror-latex-errors')
            for line, line_handler of cm._smc_inline_errors
                # use line_handler to always find the correct line
                cm.removeLineClass(line_handler, 'background')
            cm._smc_inline_errors = {}

    _render_inline_error: (line, message, content, error_type) =>
        line -= 1 # to get 0-based numbering for the remaining code
