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

better inline latex #4

Open
ratmice opened this issue Jul 2, 2019 · 0 comments
Open

better inline latex #4

ratmice opened this issue Jul 2, 2019 · 0 comments

Comments

@ratmice
Copy link
Owner

ratmice commented Jul 2, 2019

Currently we have a hack in place for inline latex using:

```latex
...
```

Which is the only standard mechanism in place,
this suffers from at least 1 problem:
It is not possible to tell if we should attempt to syntax highlight the latex code(good luck, parsing TeX is turing complete.), or if we want to render it.

We could recommend something like:

```latex render=true
...
```

but the render=true part Is ignored and not exposed by the markdown parser, so we cannot branch on it. Better inline LaTeX is really required, unfortunately the ecosystem is a mess

My preference is to implement the consistent attribute syntax. While consistent attribute syntax is largely orthogonal to math support it includes attributes on code blocks `...`{.$},

Which should be consistent with code fences

```$
...
```

being equivalent to:

```
...
```{.$}

Once we have the consistent attribute syntax in place, it's fairly easy to introduce the necessary syntaxes for supporting KaTeX or MathJax in pulldown_cmark, and enable them based upon a config::Document::comment_format.

The difficulty here isn't in coming up with the parser syntax changes, but making sure the AST has a uniform data structure to parse it to, Unfortunately that comes along with a bunch of non-math attributes for every Markdown element, and a few questions about how it interacts with the existing markdown extensions.

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

1 participant