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

TeXmacs fixes #3627

Merged
merged 4 commits into from
Jan 18, 2025
Merged

TeXmacs fixes #3627

merged 4 commits into from
Jan 18, 2025

Conversation

d-torrance
Copy link
Member

This includes @mgubi's proposed fix for #2534 and also fixes the reported matrix display issue. This was a small bug in mathML(MatrixExpression) where we were trying to just display the first row.

Before

image

After

image

@mgubi, @bztd: Thoughts?

We were only trying to format the first row of the matrix and not the
entire thing.
@bztd
Copy link

bztd commented Jan 17, 2025

I will apply the changes to the stable version and do testing.

Also respect the interpreter depth when printing output variables.
In particular, this gives us a correct AfterPrint for matrices in
TeXmath mode.
@d-torrance
Copy link
Member Author

I added a couple more commits adding AfterPrint support for TeXmacs mode. So for example, we get the source/target info for matrices like we do with the standard and webapp modes:

image

@mgubi
Copy link

mgubi commented Jan 17, 2025

I do not know Macauly2, so I trust you :) the output seems correct. What about the matrix which includes symbolic entries and is in the TeXmacs' help for the M2 Plugin? (Help->Plugin->Macauly2).

@d-torrance
Copy link
Member Author

Yes, that works!

image

@mgubi
Copy link

mgubi commented Jan 17, 2025

I gave a look at the web app. Since TeXmacs can read plugin output in HTML format, one could reuse the code written for the web app to produce HTML output to send to texmacs. Most of the features of the web app could be emulated in TeXmacs.

@d-torrance
Copy link
Member Author

The webapp mode outputs html, but the math is mostly $-delimited LaTeX that is rendered using Javascript (KaTeX). For example:

i2 : 2:0matrix {{1, 2}, {3, 4}}

o2 = $\left(\!\begin{array}{cc}
1&2\\
3&4
\end{array}\!\right)$

o2 : <span><samp class="token class-name">Matrix</samp> ${\mathbb Z}^{2}\,\longleftarrow \,{\mathbb Z}^{2}$</span>

Is that something that TeXmacs would support? Otherwise, I think the current MathML-based implementation mostly works.

@mgubi
Copy link

mgubi commented Jan 17, 2025

IIRC TeXmacs imports correctly Wikipedia pages with math (which should be MathJax). Alternatively one needs to switch to "latex" input in those pieces. TeXmacs supports "html", "latex" and some others.

@bztd
Copy link

bztd commented Jan 18, 2025

In my local tests M2 already works in TeXmacs.

@d-torrance
Copy link
Member Author

Great! I'll go ahead and merge this

@d-torrance d-torrance merged commit 65ffc2b into Macaulay2:development Jan 18, 2025
5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants