PolicyEngine / PolicyEngine/policyengine-app-v2
Add LaTeX math support to blog posts
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-mathandrehype-katexplugins (already installed as dependencies) - Imports KaTeX CSS
- Adds test suite for math rendering
Issues to Address
- Display math not working: Block-level math with
$$...$$doesn't render correctly - 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
- Use a different syntax for math (e.g.,
$$$...$$$or:math:...::) - Configure remark-math to use different delimiters
- Only enable math support for specific posts via frontmatter flag
- Use code fences with
mathlanguage identifier
Related
- Commit:
074437a9(will be reverted from rail-fares-freeze branch)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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