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

LaTeX in markdown document #357

Open
PierreMarchand20 opened this issue Jun 19, 2019 · 4 comments
Open

LaTeX in markdown document #357

PierreMarchand20 opened this issue Jun 19, 2019 · 4 comments

Comments

@PierreMarchand20
Copy link

There is an issue about code fences #242, but I was wondering if it was possible to support latex/math environnement in markdown out of the box ?

I know that the extension has great support for LaTeX Workshop without any configuration needed, so I was wondering if it was possible to do the same for markdown (and more especially this extension, related to this issue).

I know that I can use some regex to just ignore every math environnement, but I think we could do something with the need of user-defined setting, and may be better than just ignoring everything.

@Jason3S
Copy link
Collaborator

Jason3S commented Jun 23, 2019

@PierreMarchand20 thank you for bringing this up. I hope to have better support in the future for embedded languages.

For the moment, I will look at a way to exclude them. Do you have any examples of its usage in markdown?

@PierreMarchand20
Copy link
Author

I am using the extension Markdown All in One to take notes when I am attending presentations. I am a phd in applied mathematics, so there are lots of equations, notations, greek letters, etc. Here's a small example:

# Low regularity Cauchy problem in general relativity on characteristic hypersurfaces by Olivier Graf

## Einstein equation

$(\mathcal{M},\overline{g})$ a quadratic form symmetric (-+++) where $\mathcal{M}\simeq \mathbb{R}_t\times \mathbb{R}_x^3$ and $\overline{g}=(\overline{g}_{\mu,\nu}(t,x))$. This is to be the gravitational potential

Einstein equation:
$$
[\operatorname{Ric}(\overline{g})]_{\mu,\nu}- \dfrac{1}{2} \operatorname{R}(\overline{g})\overline{g}_{\mu,\nu}= \mathrm{T}_{\mu,\nu} \qquad(EE)
$$

- $\mathrm{T}_{\mu,\nu}=0$ (vacuum)
- $\operatorname{Ric}(\overline{g})_{\mu,\nu}=\sum_{\alpha,\beta,\gamma,\delta}\overline{g}_{\alpha,\beta}\partial^2\overline{g}_{\delta,\gamma}+\sum \overline{g}_{\alpha,\beta} \partial g \partial g$ where $\partial=\partial_t,\partial_x,,\partial_y,\partial_z$
-> 10 equations

Actually, I do not see when spell check in latex environments for markdown documents could be useful. So may be, we could at least exclude them by default ?

@gauss256
Copy link

I'd like this too. I can disable single-line expressions (like $e=mc^2$) with an exclusion reg exp \$.*\$, but that doesn't help with multiline expressions.

@gauss256
Copy link

I've solved it by using the right regular expression exclusions. The following will exclude spell checking inside code blocks and LaTeX, whether inline or multiline. This goes into settings.json.

"cSpell.languageSettings": [
    {
      // use with Markdown files
      "languageId": "markdown",
      // Exclude code, LaTeX
      "ignoreRegExpList": [
        "\\$.*\\$",
        "\\$\\$([\\n\\(\\)]|[^(\\$\\$)])*\\$\\$",
        "`.*`",
        "```([\\n\\(\\)]|[^(\\$\\$)])*```",
      ]
    }
  ]

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

No branches or pull requests

3 participants