posit-dev / posit-dev/multimark
Math markdown support
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8
- Forks
- 1
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 2
Description
Prework
- Read and abide by the multimark code of conduct and contributing guidelines.
- Search for duplicates among the existing issues (both open and closed).
Proposal
After seeing the new release of great_tables, I wanted to try making a table which has math notation in one of the columns. This does not work however, as, if I understand correctly, the markdown to latex or html conversion goes via this package, which does not seem to support mathematics.
MWE:
from multimark import markdown_to_html, markdown_to_latex
test_markdown_math = r"$\frac{a}{b}$"
test_latex = markdown_to_latex(test_markdown_math)
test_html = markdown_to_html(test_markdown_math)
gives '\\$\\textbackslash{}frac\\{a\\}\\{b\\}\\$\n' and '<p>$\\frac{a}{b}$</p>\n' for test_latex and test_html respectively.
My request is therefore if it would be possible to add such a conversion to this package? For me, it would greatly improve the usability of great_tables for making scientific content in Quarto. Don't know how big of a task this is, but happy to hear your thoughts!
Thanks in advance,
Olivier
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 markdown_to_html and markdown_to_latex entry points and run the Python MWE from the issue to reproduce both outputs. Trace the conversion path for $\frac{a}{b}$; done means mathematical notation is handled correctly in both HTML and LaTeX output without the current escaping or literal text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- content
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100