Macaulay does not advance

I have compiled Macaulay2 v2.1.4 and it works from the terminal but from the current version of TeXmacs I get:

Macaulay2, version 1.24.11
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems,
Isomorphism, LLLBases, MinimalPrimes, OnlineLookup,
PackageCitations, Polyhedra, PrimaryDecomposition, ReesAlgebra,
Saturation, TangentCone, Truncations, Varieties
i1 : 444444

Busy…

The program is not progressing.

I looked at the output of M2 --TeXmacs, which is the command that TeXmacs runs. It is a piece of html code. Example:

verbatim:html:<math xmlns="http://www.w3.org/1998/Math/MathML"><mtable columnalign="right center left">
<mtr><mtd><mstyle color="red"><mi>o1</mi></mstyle></mtd>
<mtd><mstyle color="red"><mo>=</mo></mstyle></mtd>
<mtd><mn>444</mn></mtd>
</mtr>
<mtr></mtr>
<mtr><mtd><mstyle color="red"><mi>o1</mi></mstyle></mtd>
<mtd><mstyle color="red"><mo>:</mo></mstyle></mtd>
<mtd><mi>���</mi></mtd>
</mtr>
</mtable>
</math>

Does anyone know if TeXmacs is expected to read this output without need for a converter? I did not see one in the Macaulay 2 plugin directory.

Yes, TeXmacs can read html from plugins. There should be an extra ‘DATA BEGIN’ character between ‘verbatim:’ and ‘html:’ to indicate that a new type of data packet is starting. Equally, there should be ‘DATA END’ characters at the end. Perhaps the terminal doesn’t show these. The ouput from Debug->io on the terminal might be more informative, as it does show those characters.

TeXmacs] debug-io, [INPUT]444
TeXmacs] debug-io, [OUTPUT 1]
TeXmacs] debug-io, [OUTPUT 0][BEGIN]verbatim:
TeXmacs] debug-io, [OUTPUT 1]
TeXmacs] debug-io, [OUTPUT 0][BEGIN]html:<

and it stops there. Any clue? Is [OUTPUT 0] correct?

OUTPUT 0 is correct, that means the plugin is printing to its standard output stdout. OUTPUT 1 is for stderr, printing errors.

This does show that the plugin opens two data blocks, one verbatim, containing another html data block, but never closes either of them, otherwise you’d see an [END]. TeXmacs is waiting for those to display the result, so it hangs.

With this information, it is quite possible then that one should place the bug report with the maintainers of Macaulay 2. If this is the case, maybe @bztd might be willing to do it?

There may be an issue on the TeXmacs side as well: on the command line M2 does print more than html:<, so it’s unclear why the rest of the output (i.e. math xmlns....) doesn’t reach TeXmacs.

Maybe would be useful to see another plugin working so that we can compare. I do not have this program on my machine to test. However from their webpage seems that the plugin worked in the past. Something could be wrong with TeXmacs, or with a specific operating system.

I did not find another plugin that outputs html (I did look only at a few of them).
The Macaulay 2 module that communicates with TeXmacs seems this

The only recent change is the addition of the line

needs "reals.m2"

at the beginning. Changes before that go back to 2008.

``

There is already a bug report in M2

I will add the link to this conversation.

I seems that the code in texmacs.m2 does not work correctly. I do not know Macauly2 enough to be able to fix it, but if you replace in this program the line

<< tmhtml fixn mathMode mtable {{po,red "<mo>=</mo>",fmt v},{},{po,red "<mo>:</mo>",fmt class v}})

with

<< tmhtml mathMode mtable {{po,red "<mo>=</mo>",fmt v},{},{po,red "<mo>:</mo>",fmt class v}})

(i.e. remove the invocation to the fixn function), then it mostly works (but the output of the matrix is wrong):


The part of the code that I do no understand is this fixn function, since if one calls separate("\0", s) on a string (e.g. on s="pippo") then one obtains a list of single character strings and I do not understand if this makes sense or not. It seems to me a bug, probably in the definition of separate:

A better fix is to replace the definition of the function fixn with

fixn := s -> concatenate between("\0", apply(separate("\\0", s), fix))

however there is still a problem with the typesetting of matrices.

This seems now fixed in the repository, check: https://github.com/Macaulay2/M2/pull/3627

4 Likes