PolicyEngine / PolicyEngine/policyengine-app-v2

Add LaTeX math support to blog posts

Open
#480 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1
Forks
3
Avg merge
1d 50m
Merged PRs (30d)
39

Description

Summary

Add LaTeX/KaTeX math rendering support to the MarkdownFormatter component for blog posts.

Reference Implementation

A WIP implementation exists in commit 074437a9 on the rail-fares-freeze branch. This commit:

  • Adds remark-math and rehype-katex plugins (already installed as dependencies)
  • Imports KaTeX CSS
  • Adds test suite for math rendering

Issues to Address

  1. Display math not working: Block-level math with $$...$$ doesn't render correctly
  2. Dollar sign conflicts: Enabling remark-math means $ signs in currency amounts (e.g., $100) would need to be escaped as \$. This is problematic for a policy blog that frequently references currency.

Potential Solutions

  1. Use a different syntax for math (e.g., $$$...$$$ or :math:...::)
  2. Configure remark-math to use different delimiters
  3. Only enable math support for specific posts via frontmatter flag
  4. Use code fences with math language identifier

Related

  • Commit: 074437a9 (will be reverted from rail-fares-freeze branch)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MarkdownFormatter component and inspect commit 074437a9 on the rail-fares-freeze branch, including its math rendering test suite. Compare the proposed delimiter and frontmatter options, then verify that block math renders correctly without breaking currency amounts such as $100. Done means the chosen syntax works for blog posts and the relevant tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, markdown
Domain
content
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.