Skip to content

Implemented latex compatibility with plugin#14

Merged
marcuswu5 merged 2 commits intoCMU-313:mainfrom
zenxol:feature/latex-compatibility
Feb 15, 2026
Merged

Implemented latex compatibility with plugin#14
marcuswu5 merged 2 commits intoCMU-313:mainfrom
zenxol:feature/latex-compatibility

Conversation

@zenxol
Copy link

@zenxol zenxol commented Feb 14, 2026

Summary

Adds LaTeX/math support to the forum so users can write and render math in new topics and replies.

  • Toolbar button: LaTeX (superscript) button in the composer that inserts $$ $$ or wraps the selection with $$...$$.
  • Rendering: MathJax 3 loads from CDN when needed and renders inline $...$ and display $$...$$ in the composer preview and in posts.

Changes

  • New plugin in vendor/nodebb-plugin-composer-latex/ (library, client scripts, MathJax loader, language file).
  • package.json: dependency added for nodebb-plugin-composer-latex (local vendor path).

How to use

  1. Create a new topic or reply.
  2. Use the LaTeX button (x² icon) or type $...$ (inline) or $$...$$ (display).
  3. Preview and published posts will render the math.

Setup for reviewers / after merge

  • npm install then ./nodebb build (Redis or DB must be running).
  • In Admin → Extend → Plugins, activate Composer LaTeX if it isn’t already active. This is a mandatory step!

Testing

  • In the composer, click the LaTeX button and confirm $$ $$ is inserted.
  • Type e.g. $$x^2 + y^2 = z^2$$ and use Preview to confirm it renders.
  • Post and confirm the same math renders in the topic.
latex

NOTE

generated from ai: What it does support (math):
Equations: fractions, roots, integrals, sums, limits
Symbols: Greek letters, operators, relations
Matrices, cases, align-style blocks
Inline $...$ and display $$...$$ math
So anything you’d write in LaTeX math mode (or that MathJax’s TeX input supports) works.
What it does not do:
Full document LaTeX – no \documentclass, \begin{document}, sections, etc.
Arbitrary packages – no TikZ, full tabular, custom .sty files, etc.
Chemistry – no \ce{...} unless you add something like the mhchem extension to MathJax.
General typography – it’s a math renderer, not a full LaTeX compiler.

@zenxol zenxol closed this Feb 14, 2026
@zenxol zenxol reopened this Feb 14, 2026
@zenxol zenxol closed this Feb 14, 2026
@coveralls
Copy link

coveralls commented Feb 14, 2026

Pull Request Test Coverage Report for Build 22022418762

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 78.828%

Totals Coverage Status
Change from base Build 21806455475: 0.0%
Covered Lines: 25357
Relevant Lines: 30331

💛 - Coveralls

@zenxol zenxol reopened this Feb 14, 2026
@zenxol zenxol changed the title integrated latex button to frontend and mathjax rendering for latex Implemented latex compatibility with plugin Feb 14, 2026
@marcuswu5 marcuswu5 self-requested a review February 15, 2026 01:54
Copy link

@marcuswu5 marcuswu5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@marcuswu5 marcuswu5 merged commit 6e47a28 into CMU-313:main Feb 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments