One such library could be katex.
Apple pages gained latex support and is a charm but the classic paper format is not very mobile friendly.
Thanks for the suggestion! Upcoming releases of DEVONthink will support locally linked scripts.
DEVONthink To Go already supports this when you use the XHTML version of the script tag:
Version 2.1.7 will convert self-closing tags to the XHTML form internally and so make the self-closing script tags also work.