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

Support doxygen-style math delimiters #121

Open
bilderbuchi opened this issue Feb 24, 2022 · 5 comments
Open

Support doxygen-style math delimiters #121

bilderbuchi opened this issue Feb 24, 2022 · 5 comments

Comments

@bilderbuchi
Copy link

Summary

The Readme tells us that mdmath uses "markdown-it-texmath's support of different formula delimiters".
In the list of Mdmath: Delimiters configuration settings, doxygen is conspicuously absent although it's listed in markdown-it-texmath's Readme.

Using this markdown file

Dollars:

$$
  L[y] := y'' - V y = \rho(x).
$$

Brackets:

\[
  L[y] := y'' - V y = \rho(x).
\]

Doxygen:

\f[
  L[y] := y'' - V y = \rho(x).
\f]

I tested different settings for the Mdmath: Delimiters settings.

brackets works correctly. Interestingly I need a VS Code restart for the setting to become active.

Expected behavior

Using the doxygensetting, I expect the formula to be rendered.

Actual behavior

Unfortunately, using doxygen does not seem to do anything - the code remains raw and not rendered into a formula
image
(I suspect that the dollars variant keeps getting rendered because of base markdown extension support)

Environment

     Operating system: windows 10
       VSCode version: 1.64.2
Markdown+Math version: 2.7.4
@bilderbuchi
Copy link
Author

bilderbuchi commented Apr 28, 2022

@goessner is there anything I can do on my side (tweak settings in a file or so) to enable doxygen math delimiters in mdmath, Stefan?

@goessner
Copy link
Owner

Yes ... please try to add doxygen delimiters to the delimiters array in

https://github.com/goessner/markdown-it-texmath

I will come back to markdown-it-texmath and mdmath in two weeks at the earliest.

thanks

@bilderbuchi
Copy link
Author

Thank you! I tried to poke around and do something like this already, but unfortunately I could not locate the files related to the VS Code extension on my disk. (I'm not a web/JS person, so that will also not help)
Doxygen delimiters are already present, though, as far as I can tell: https://github.com/goessner/markdown-it-texmath/blob/b08ddd342f26ddcdc3afa2218f1b55410f44029b/texmath.js#L215-L234

The point I tried to make in the issue description is that support seems to be there in markdown-it-texmath, but it does not work in mdmath.

@goessner
Copy link
Owner

goessner commented Apr 29, 2022

Ahh ... I see. In fact I need to update mdmath to current markdown-it-texmath version. This will take same time beside other actions.

What you can try to do is replace in your folder

/Users/<name>/.vscode/extensions/mdmath/node-modules/markdown-it-texmath

the texmath.js file or the complete folder. If it works, it is fine, if not, you are lost and have to wait for my next update.

Alternatively you can copy the doxygen stuff into your texmath.js file.

@bilderbuchi
Copy link
Author

bilderbuchi commented Apr 29, 2022

Aahh, I was looking in APPDATA...
Yes, replacement of the folder seems to have worked! I get preview of equations now.

Curiously, it seems empty lines are neecessary before starting an equation block (for it to be rendered correctly), which I'm not sure is expected for markdown, but I guess that's a markdown-it-texmath limitation?

Also, the \f{environment}{ Doxygen formula syntax does not work, but I think getting to that is probably more effort. I'll use manual enviroments \begin{eqnarray}/end{eqnarray} inside the block as a workaround.

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