Closed gbebie-valerian-antidot closed 11 months ago
I see that the TexParser has an "isPartial" flag which might work in certain cases: https://github.com/opencollab/jlatexmath/blob/master/jlatexmath/src/main/java/org/scilab/forge/jlatexmath/TeXParser.java so maybe the problem could be fixed from the Java extension code by making the parser more relaxed.
But in general I agree with the current situation in which the publishing fails, otherwise you might end up with broken image references.
Or another workaround, in the XSLT you could change its version to 3.0 and add a try catch around that xsl-copy which parses the image. https://www.saxonica.com/html/documentation12/xsl-elements/try.html
But in general I would not change the current default behavior. Images may be important, for example in the aeronautical industry you do not want to present some kind of invalid fallback equation which may be used further by people to perform computations based on it.
Many thanks for your support on this question, Radu. I took a moment to answer because I initially preferred to preserve the exceptions in the logs, and making sure the client could get information, and being able to troubleshoot them. I eventually had to edit the source code of the jlatexmath library because we had too many errors stopping the processing. I solved this difficulty by using try/catch in the texParser.java
And it works well now.
Hello! It seems the processing for a publication fails when an equation is incorrectly formatted and contains a missing parenthesis (either opening or closing). I also had other use cases where the publication failed because of a parenthesis declared in latex as a string and not as /left( or \right)
My problem is not being informed about the inconsistent equation, but the fact the publishing fails and stops.
I wonder if it wouldn't be possible to get a more permissive rendering. I've installed the latex-images-support plugin to render the equations in the editor and it helps me to determine which equations are problematic. On the flip side, when an equation is not correctly rendered, I notice I can render it in a service such as quicklatex.com .
So, my feeling is that the java library impIemented in the plugin to render svgs is a bit restrictive and I wonder if there wouldn't a way to be more permissive, i.e. providing warning messages in the logs without stopping the whole execution of the publishing.
To provide additional info, here is an extract of the logs when an error stops the processing. In this example, an opening parenthesis is missing.