Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline math doesn't render correctly when inside a Markdown table #636

Closed
michaelosthege opened this issue Feb 23, 2022 · 2 comments
Closed

Comments

@michaelosthege
Copy link

I have a notebook containing a Markdown table like this:

first second
$$x \in \mathcal{R} $$ 👈 this one renders, but distorts the layout
$x \in \mathcal{R} $ 👈 this one doesn't render

After building the docs with Sphinx, I get this:

grafik

I tried to add more text before & after the math to illustrate the problem with the $$ version, but it didn't work.
The error hints that the problem may arise from the RST intermediate representation (probably related to #36).

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| first                                                                                                                                                                                                                                                   | second
                                                                                                                                         |
+=========================================================================================================================================================================================================================================================+=========================================================================================================================================================================================================================================================+
| not inline                                                                                                                                                                                                                                              | 👈 this one renders, but distorts the layout
                                                                                                                                          |
|                                                                                                                                                                                                                                                         |
                                                                                                                                         |
| .. math:: x \in \mathcal{R}                                                                                                                                                                                                                             |
                                                                                                                                         |
|                                                                                                                                                                                                                                                         |
                                                                                                                                         |
| \ math                                                                                                                                                                                                                                                  |
                                                                                                                                         |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| inline $x :nbsphinx-math:`\in `:nbsphinx-math:`\mathcal{R}` $ math                                                                                                                                                                                      | 👈 this one doesn’t render
                                                                                                                                          |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@mgeier
Copy link
Member

mgeier commented Mar 4, 2022

Sorry for the late response, especially since the answer is quite simple:

Long story short, use $x \in \mathcal{R}$ and everything should be fine.

@michaelosthege
Copy link
Author

Thank you, @mgeier !
I didn't notice the spaces and wouldn't have expected them to be a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants