oxygenxml / dita-latex

DITA Open Toolkit plugin which allows publishing embedded Latex mathematical equations to HTML and PDF
Apache License 2.0
7 stars 3 forks source link

Publication fails when an equation is incorrectly formatted #4

Closed gbebie-valerian-antidot closed 11 months ago

gbebie-valerian-antidot commented 1 year ago

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.


     [xslt]     at org.scilab.forge.jlatexmath.TeXParser.processEscape(TeXParser.java:1243)
     [xslt]     at org.scilab.forge.jlatexmath.TeXParser.parse(TeXParser.java:705)
     [xslt]     at org.scilab.forge.jlatexmath.TeXFormula.<init>(TeXFormula.java:261)
     [xslt]     at org.scilab.forge.jlatexmath.TeXFormula.<init>(TeXFormula.java:245)
     [xslt]     at com.oxygenxml.latex.svg.LatexToSVG$1.call(LatexToSVG.java:70)
     [xslt]     at net.sf.saxon.functions.IntegratedFunctionCall.iterate(IntegratedFunctionCall.java:293)
     [xslt]     at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:852)
     [xslt]     at net.sf.saxon.expr.parser.Evaluator$6.evaluate(Evaluator.java:173)
     [xslt]     at net.sf.saxon.expr.SystemFunctionCall.evaluateArguments(SystemFunctionCall.java:454)
     [xslt]     at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:546)
     [xslt]     at net.sf.saxon.expr.instruct.CopyOf.processLeavingTail(CopyOf.java:559)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:944)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:627)
     [xslt]     at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:374)
     [xslt]     at net.sf.saxon.expr.instruct.CallTemplate.processLeavingTail(CallTemplate.java:434)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:264)
     [xslt]     at net.sf.saxon.expr.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:548)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:478)
     [xslt]     at net.sf.saxon.trans.XsltController.applyTemplates(XsltController.java:661)
     [xslt]     at net.sf.saxon.s9api.AbstractXsltTransformer.applyTemplatesToSource(AbstractXsltTransformer.java:360)
     [xslt]     at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:349)
     [xslt]     at org.dita.dost.store.StreamStore.transformUri(StreamStore.java:221)
     [xslt]     at org.dita.dost.store.StreamStore.transform(StreamStore.java:199)
     [xslt]     at org.dita.dost.module.XsltModule.transform(XsltModule.java:225)
     [xslt]     at org.dita.dost.module.XsltModule.transform(XsltModule.java:198)
     [xslt]     at org.dita.dost.module.XsltModule.execute(XsltModule.java:155)
     [xslt]     at org.dita.dost.ant.ExtensibleAntInvoker.execute(ExtensibleAntInvoker.java:189)
     [xslt]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
     [xslt]     at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
     [xslt]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [xslt]     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
     [xslt]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
     [xslt]     at org.apache.tools.ant.Task.perform(Task.java:350)
     [xslt]     at java.base/java.util.Vector.forEach(Vector.java:1365)
     [xslt]     at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
     [xslt]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
     [xslt]     at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
     [xslt]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [xslt]     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
     [xslt]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
     [xslt]     at org.apache.tools.ant.Task.perform(Task.java:350)
     [xslt]     at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:391)
     [xslt]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
     [xslt]     at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
     [xslt]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [xslt]     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
     [xslt]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
     [xslt]     at org.apache.tools.ant.Task.perform(Task.java:350)
     [xslt]     at org.apache.tools.ant.Target.execute(Target.java:449)
     [xslt]     at org.apache.tools.ant.Target.performTasks(Target.java:470)
     [xslt]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
     [xslt]     at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
     [xslt]     at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
     [xslt]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
     [xslt]     at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
     [xslt]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
     [xslt]     at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
     [xslt]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [xslt]     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
     [xslt]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
     [xslt]     at org.apache.tools.ant.Task.perform(Task.java:350)
     [xslt]     at org.apache.tools.ant.Target.execute(Target.java:449)
     [xslt]     at org.apache.tools.ant.Target.performTasks(Target.java:470)
     [xslt]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
     [xslt]     at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
     [xslt]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [xslt]     at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
     [xslt]     at org.dita.dost.invoker.Main.runBuild(Main.java:694)
     [xslt]     at org.dita.dost.invoker.Main.startAnt(Main.java:211)
     [xslt]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
     [xslt]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
     [xslt] java.lang.RuntimeException: Internal error evaluating template rule  at line 14 in module file:/Users/gaspardbebie-valerian/Downloads/dita-ot-3.7.4_20231010-latex/plugins/com.oxygenxml.latex.svg/xsl/xhtmlSVG.xsl
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:408)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:944)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:353)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:293)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:568)
     [xslt]     at net.sf.saxon.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:627)
     [xslt]     at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:374)
     [xslt]     at net.sf.saxon.expr.instruct.CallTemplate.processLeavingTail(CallTemplate.java:434)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:264)
     [xslt]     at net.sf.saxon.expr.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:548)
     [xslt]     at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:478)
     [xslt]     at net.sf.saxon.trans.XsltController.applyTemplates(XsltController.java:661)
     [xslt]     at net.sf.saxon.s9api.AbstractXsltTransformer.applyTemplatesToSource(AbstractXsltTransformer.java:360)
     [xslt]     at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:349)
     [xslt]     at org.dita.dost.store.StreamStore.transformUri(StreamStore.java:221)
     [xslt]     at org.dita.dost.store.StreamStore.transform(StreamStore.java:199)
     [xslt]     at org.dita.dost.module.XsltModule.transform(XsltModule.java:225)
     [xslt]     at org.dita.dost.module.XsltModule.transform(XsltModule.java:198)
     [xslt]     at org.dita.dost.module.XsltModule.execute(XsltModule.java:155)
     [xslt]     at org.dita.dost.ant.ExtensibleAntInvoker.execute(ExtensibleAntInvoker.java:189)
     [xslt]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
     [xslt]     at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
     [xslt]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [xslt]     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
     [xslt]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
     [xslt]     at org.apache.tools.ant.Task.perform(Task.java:350)
     [xslt]     at java.base/java.util.Vector.forEach(Vector.java:1365)
     [xslt]     at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
     [xslt]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
     [xslt]     at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
     [xslt]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [xslt]     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
     [xslt]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
     [xslt]     at org.apache.tools.ant.Task.perform(Task.java:350)
     [xslt]     at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:391)
     [xslt]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
     [xslt]     at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
     [xslt]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [xslt]     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
     [xslt]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
     [xslt]     at org.apache.tools.ant.Task.perform(Task.java:350)
     [xslt]     at org.apache.tools.ant.Target.execute(Target.java:449)
     [xslt]     at org.apache.tools.ant.Target.performTasks(Target.java:470)
     [xslt]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
     [xslt]     at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
     [xslt]     at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
     [xslt]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
     [xslt]     at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
     [xslt]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
     [xslt]     at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
     [xslt]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [xslt]     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
     [xslt]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
     [xslt]     at org.apache.tools.ant.Task.perform(Task.java:350)
     [xslt]     at org.apache.tools.ant.Target.execute(Target.java:449)
     [xslt]     at org.apache.tools.ant.Target.performTasks(Target.java:470)
     [xslt]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
     [xslt]     at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
     [xslt]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [xslt]     at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
     [xslt]     at org.dita.dost.invoker.Main.runBuild(Main.java:694)
     [xslt]     at org.dita.dost.invoker.Main.startAnt(Main.java:211)
     [xslt]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
     [xslt]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
     [xslt] Caused by: org.scilab.forge.jlatexmath.ParseException: Unknown symbol or command or predefined TeXFormula: 'right'
     [xslt]     at org.scilab.forge.jlatexmath.TeXParser.processEscape(TeXParser.java:1243)
     [xslt]     at org.scilab.forge.jlatexmath.TeXParser.parse(TeXParser.java:705)
     [xslt]     at org.scilab.forge.jlatexmath.TeXFormula.<init>(TeXFormula.java:261)
     [xslt]     at org.scilab.forge.jlatexmath.TeXFormula.<init>(TeXFormula.java:245)
     [xslt]     at com.oxygenxml.latex.svg.LatexToSVG$1.call(LatexToSVG.java:70)
     [xslt]     at net.sf.saxon.functions.IntegratedFunctionCall.iterate(IntegratedFunctionCall.java:293)
     [xslt]     at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:852)
     [xslt]     at net.sf.saxon.expr.parser.Evaluator$6.evaluate(Evaluator.java:173)
     [xslt]     at net.sf.saxon.expr.SystemFunctionCall.evaluateArguments(SystemFunctionCall.java:454)
     [xslt]     at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:546)
     [xslt]     at net.sf.saxon.expr.instruct.CopyOf.processLeavingTail(CopyOf.java:559)
     [xslt]     at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:752)
     [xslt]     at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
     [xslt]     at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298)
     [xslt]     at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:389)
     [xslt]     ... 125 more
     [xslt] java.lang.RuntimeException: Internal error evaluating template rule  at line 423 in module file:/../plugins/org.dita.html5/xsl/topic.xsl```
raducoravu commented 1 year 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.

gbebie-valerian-antidot commented 11 months ago

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.