sphinx-doc / sphinx-doc/sphinx

Create a display math *role*

Open
#8,166 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

markup type:enhancement
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.

I would like to include an equation inside a paragraph. This is customary in math-y texts, where breaking a paragraph on equation is often incorrect since an equation may be a part of a sentence. Right now display math can only be created using a directive, which necessarily breaks the paragraph.

Describe the solution you'd like

I propose to implement a new role, e.g. :math:display:`content` , or anything alike, which creates a math_block nodes in the doctree.

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 by reviewing the existing display-math directive and the doctree handling for math_block nodes. Determine how a new math role could preserve paragraph flow while producing the requested node, then verify that the role works inside a paragraph and matches existing display-math behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
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.