{"id":20607,"library":"temml","title":"Temml","description":"A lightweight LaTeX-to-MathML Core conversion library for JavaScript, currently at v0.13.2. Released under MIT license, it offers a smaller bundle size (171KB minified) compared to MathJax (338KB) and KaTeX (280KB), with better LaTeX coverage than TeXZilla. It supports system fonts for minimal footprint and includes a comprehensive test suite. Essential for accessibility and SEO-friendly math rendering in modern browsers. Active development with periodic releases aimed at fixing bugs and adding LaTeX functions.","status":"active","version":"0.13.2","language":"javascript","source_language":"en","source_url":"git://github.com/ronkok/Temml","tags":["javascript","typescript"],"install":[{"cmd":"npm install temml","lang":"bash","label":"npm"},{"cmd":"yarn add temml","lang":"bash","label":"yarn"},{"cmd":"pnpm add temml","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export is the main function; named export does not exist.","wrong":"import { temml } from 'temml'","symbol":"temml","correct":"import temml from 'temml'"},{"note":"Named export for auto-rendering within DOM elements. Use with bundlers or ESM environments.","wrong":"const renderMathInElement = require('temml').renderMathInElement","symbol":"renderMathInElement","correct":"import { renderMathInElement } from 'temml'"},{"note":"Type import for TypeScript users to define option interfaces.","wrong":null,"symbol":"TemmlOptions","correct":"import type { TemmlOptions } from 'temml'"}],"quickstart":{"code":"import temml, { renderMathInElement } from 'temml';\n\n// Generate MathML string\nconst mathml = temml('E = mc^2', {\n  displayMode: true,\n  throwOnError: false\n});\nconsole.log(mathml);\n\n// Auto-render all math in a DOM element\ndocument.addEventListener('DOMContentLoaded', () => {\n  renderMathInElement(document.body, {\n    delimiters: [\n      {left: '$$', right: '$$', display: true},\n      {left: '$', right: '$', display: false}\n    ],\n    throwOnError: false\n  });\n});","lang":"typescript","description":"Demonstrates converting LaTeX to MathML string using temml() and auto-rendering math in the document body with renderMathInElement()."},"warnings":[{"fix":"Set `wrap: 'text'` explicitly in options to preserve old behavior, or update styles to handle MathML core wrappers.","message":"Rendering option `wrap` default changed from `'text'` to `'none'` in v0.12.0, breaking rendering behavior for inline math without explicit wrap option.","severity":"breaking","affected_versions":">=0.12.0"},{"fix":"Replace `\\url{...}` and `\\href{url}{text}` with manual HTML anchor elements outside math mode.","message":"Removed support for `\\url` and `\\href` commands in v0.11.07: these LaTeX commands no longer produce hyperlinks.","severity":"breaking","affected_versions":">=0.11.07"},{"fix":"Upgrade Node.js to version 18.13.0 or later, or use a polyfill/compatibility shim.","message":"Temml requires Node.js >=18.13.0 for server-side usage; older Node versions cause runtime errors or missing features.","severity":"gotcha","affected_versions":">=0.11.0"},{"fix":"Include the Latin Modern Math font via CSS or use a font loading strategy to ensure correct rendering in Chromium-based browsers.","message":"Chromium renders system fonts incorrectly for some MathML constructs; Latin Modern font (380KB) is recommended for best visual quality.","severity":"gotcha","affected_versions":">=0.9.0"},{"fix":"Monitor changelog for upcoming API changes; consider using the core `temml()` function with custom DOM manipulation instead.","message":"Temml's `renderMathInElement` function may be deprecated in future in favor of a more streamlined API; current behavior is stable.","severity":"deprecated","affected_versions":">=0.11.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use default import: `import temml from 'temml'`.","cause":"Importing the default export as a named export, e.g., `import { temml } from 'temml'`.","error":"TypeError: temml is not a function"},{"fix":"Replace `\\url{...}` with an HTML anchor element outside math mode.","cause":"Using LaTeX commands removed in v0.11.07.","error":"Error: Unsupported function: \\url"},{"fix":"Run `npm install temml` and ensure import path is correct (e.g., `import temml from 'temml'`).","cause":"Missing temml package in node_modules or incorrect import path.","error":"Module not found: Error: Can't resolve 'temml'"},{"fix":"Ensure the target element exists in the DOM before calling `renderMathInElement`, e.g., inside `DOMContentLoaded` event.","cause":"Calling `renderMathInElement` on a DOM element that is not yet mounted or is null.","error":"TypeError: Cannot read properties of undefined (reading 'firstChild')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}