Closed jedbrown closed 3 years ago
Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:
Heya, Do you mean that you would want the RST equation
directive converted to dollarmath? Or what would've an example input text?
Convert RST :math: and :math:numref: to dollarmath.
in v0.2.0 :math:`a^2 + b^2 = c^2`
is converted to $a^2 + b^2 = c^2$
(controlled by the --dollar-math/--no-dollar-math
).
I haven't yet added conversion of math directives
Cool! This is really helpful, but display math is currently being double-escaped. a.rst
:
.. math::
:label: poisson-ratio
\begin{aligned}
\lambda &= \frac{E \nu}{(1 + \nu)(1 - 2 \nu)} \\
\mu &= \frac{E}{2(1 + \nu)}
\end{aligned}.
rst2myst convert a.rst
produces a.md
:
```{math}
:label: poisson-ratio
\\begin\{aligned}
\\lambda &= \\frac{E \\nu}{(1 + \\nu)(1 - 2 \\nu)} \\\\
\\mu &= \\frac\{E}{2(1 + \\nu)}
\\end\{aligned}.
ok cheers, I'll have a look why that is
all done in v0.3.0 ;give it a go and let me know if there are any more issues 😄
Gorgeous, thank you! I notice one remaining quirk in how dollarmath is applied for display math without a label/spacing. The block
.. math::
\bm\sigma = \lambda (\operatorname{trace} \bm\epsilon) \bm I_3 + 2 \mu \bm\epsilon,
becomes
```{math} \bm\sigma = \lambda (\operatorname{trace} \bm\epsilon) \bm I_3 + 2 \mu \bm\epsilon,
while those with intervening spaces are placed in `$$`, e.g.,
````rst
.. math::
\bm\sigma = \lambda (\operatorname{trace} \bm\epsilon) \bm I_3 + 2 \mu \bm\epsilon,
becomes
$$
\bm\sigma = \lambda (\operatorname{trace} \bm\epsilon) \bm I_3 + 2 \mu \bm\epsilon,
$$
as I think is intended. I don't recall if the former syntax is KaTeX-specific. We've been using it over MathJax because it has produced better quality and more consistent results between our HTML and PDF output. And I can work around this easily enough as we migrate this project to MyST.
Yeh for some weird reason the math directive can have an argument, which is actually just part of the body: https://github.com/sphinx-doc/sphinx/blob/eda4b1cfc49cddfeb8d9ce3b0c495ebebb01fb6c/sphinx/directives/patches.py#L183
so I just have to append that to the body if there is one
Is your feature request related to a problem? Please describe.
The dollarmath feature of MyST is huge for readability of math-intensive writing. The current
rst2myst parse
produces a direct translation that has similar verbosity to ReST.Describe the solution you'd like
I'd like to have an option that enables inline
$\pi$
and displayedWe may be able to help with the implementation, but have a couple questions:
dollarmath
is an optional feature, I'm curious how you would like this gated in the interface. I could see it being managed by new keys indirectives.yml
, though a new--myst-extensions dollarmath
would be more convenient.Cc: @DiffeoInvariant