The website for LaTeX2JS — author interactive math equations and diagrams online using LaTeX and PSTricks.
Built with Next.js (static export) on the same architecture as constructive.io and danlynch.com:
- JSON-LD knowledge graph —
src/data/jsonld/holds Schema.org entities. Public pages publish a linked subgraph with canonical HTTPS fragment IDs asapplication/ld+json. - SEO registry —
src/seo.tsholds per-route titles/descriptions; canonicals are derived from typed routes. - Sitemap + robots.txt — generated post-build from the exported HTML by
src/seo/seo.ts. - llms.txt + Markdown twins —
gen-llm-mdgeneratesout/llms.txtand a.mdtwin for each public page from the exported HTML and JSON-LD. Runpnpm generate:llm-mdto refresh them from an existing build. - Content as data — the interactive PSTricks examples live as
.texfiles incontent/examples/, registered insrc/data/examples.ts, and rendered client-side by@latex2js/react.
LaTeX2JS is the frontend of Mathapedia, the original project. Originated as a UC Berkeley EECS master's project co-advised by Prof. Babak Ayazifar and Prof. Edward A. Lee. Math rendering powered by MathJax.
pnpm install
pnpm dev # http://localhost:5007
pnpm test # JSON-LD graph validation + registry testspnpm build # next build + llms.txt/md twins + sitemap/robots into out/
pnpm run deploy:all # build and deploy locally with AWS credentialsMerging does not deploy. To deploy, go to Actions > Deploy > Run workflow and select main.
Select dry-run to preview without changing production.
The production environment needs AWS_DEPLOY_ROLE_ARN, AWS_REGION,
AWS_S3_BUCKET, AWS_CLOUDFRONT_DISTRIBUTION_ID, and SITE_URL.
See the shared deployer guide
for one-time AWS OIDC setup.