Search code examples
mathformularenderdocusaurus

How to render math formulas in docusaurus v2 for a separate page (not in "docs" folder)?


I can successfully render math formulas in docusaurus v2 in all documents (contained in docs folder), but I would like to create a separate document (referenced from top site bar) with some definitions throughout the whole text and don't want it to appear in documents sidebar. So I create this document in src/pages folder but unfortunately math formulas do not render there and all I see is just the text itself like Some formula: $\sqrt{a^2+b^2}$.

I've created test.md in src/pages/ with sample contents:

# Test

Some formula: $\sqrt{a^2+b^2}$

and access it with url http://localhost:3000/mysite/test. The page appears, but formulas do not render.


Solution

  • By putting test.md into docs folder and referencing it with docs/test solves the issue. However link to it does appear in the default sidebar.