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

Math expressions delimited by $$ are not showing in table #461

Open
zeckdude opened this issue Jun 3, 2019 · 2 comments
Open

Math expressions delimited by $$ are not showing in table #461

zeckdude opened this issue Jun 3, 2019 · 2 comments
Labels
Area: Math Area: Table GitHub Flavored Markdown table. Issue: Bug Needs Discussion We haven't decided what to do. Upstream Pertaining to an upstream component, or blocked by an upstream issue.

Comments

@zeckdude
Copy link

zeckdude commented Jun 3, 2019

What is the problem?

I am using the double dollars signs and it shows up great in actual Github Markdown, but not in the preview pane when used in a table. When the same code is used outside of a table, it works fine. Also, when you use a single dollar sign for the inline math, it works fine, but the double dollar signs doesn't work in the table, but both cases work fine in Github.

Not working in the preview pane
Screen Shot 2019-06-02 at 9 47 52 PM

Working in Github
Screen Shot 2019-06-02 at 9 47 23 PM

How can I reproduce it?

  1. Create a table
  2. Add the following Latex code in a table cell: $$ 6, -\tfrac{7}{2}, 0, \tfrac{3}{4}, \tfrac{11}{6}, 12 $$
  3. Look at the table in the preview pane

Code example

| Term | Definition | Example |
|---------------|----------------------------------------|----------------------------------------------------------|
| Rational number | Any number that is either an integer or a fraction  | $$ 6, -\tfrac{7}{2}, 0, \tfrac{3}{4}, \tfrac{11}{6}, 12 $$ |

Is there any error message in the console?

No :(

Related links

Environment

     Operating system: Mac OSX
       VSCode version: 1.34.0
Markdown All-in-one version: 2.3.1
@yzhang-gh
Copy link
Owner

Thanks for the feedback.

I noticed that you are using the Github MathJax Chrome extension
This extension uses waylonflinn/markdown-it-katex which requires $$ to be the start or end of a line.

I agree it should work as you said. But I am afraid there won't be a quick fix from the upstream module.

@yzhang-gh yzhang-gh added Issue: Bug Upstream Pertaining to an upstream component, or blocked by an upstream issue. labels Jun 3, 2019
@Lemmingh Lemmingh added the Area: Table GitHub Flavored Markdown table. label Oct 31, 2020
@Lemmingh
Copy link
Collaborator

The GFM Spec only allows inline-level elements in a table.

So far, however, markdown-it-katex treats display math area ($$...$$) as block-level element:

https://github.com/yzhang-gh/markdown-it-katex/blob/c77efb25e3e5eb3367b45077cc7c1473908fedc1/index.js#L191-L194


For now, you can try using inline math area ($...$) with the \displaystyle command. For example:

| Refractive index | OPL                                                 |
| ---------------- | --------------------------------------------------- |
| Gradient         | ${ \displaystyle \int_{C}{ n \operatorname{d}l } }$ |

@Lemmingh Lemmingh added the Needs Discussion We haven't decided what to do. label Aug 23, 2021
@Lemmingh Lemmingh changed the title Math symbols are not showing in table in VS Code Math expressions delimited by $$ are not showing in table Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Math Area: Table GitHub Flavored Markdown table. Issue: Bug Needs Discussion We haven't decided what to do. Upstream Pertaining to an upstream component, or blocked by an upstream issue.
Projects
None yet
Development

No branches or pull requests

3 participants