posit-dev / posit-dev/multimark

Math markdown support

Open
#5 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8
Forks
1
Avg merge
6d 1h
Merged PRs (30d)
2

Description

Prework

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.