At the moment you have to declare katex globally for auto-render to work. The easiest way not to force this would be to add katex as a property of the renderMathInElement options which could be used by the user to supply an instance of katex, although this is perhaps slightly cumbersome. Alternatively you could do a conditional require if require is defined and katex is not defined globally, using a relative path so katex would be pulled in automatically assuming the directory structure is correct (and make sure katex isn't bundled during the build).