-_ = require 'underscore'
+_ = require 'lodash'
 
 MATH_MARKER_BLOCK  = '\u200c\u200c\u200c' # zero-width non-joiner
 MATH_MARKER_INLINE = '\u200b\u200b\u200b' # zero-width space

  # schedule a Mathjax pass if there is at least one [data-math] or <math> element present

  if windowImpl.MathJax?.Hub?.Queue? and root.querySelector(COMBINED_MATH_SELECTOR)
    typesetDocument(windowImpl)


# The following should be called once and configures MathJax.

COMBINED_MATH_SELECTOR = "#{MATH_DATA_SELECTOR}, #{MATH_ML_SELECTOR}"

# Search document for math and [data-math] elements and then typeset them
typesetDocument = (root, windowImpl) ->
  latexNodes = []
  for node in root.querySelectorAll(MATH_DATA_SELECTOR)
    formula = node.getAttribute('data-math')
    # divs should be rendered as a block, others inline
    if node.tagName.toLowerCase() is 'div'
