Use plantuml.jar in console with jlatexmath.jar

0 votes
asked Nov 23, 2021 in Question / help by philose

I download files from 

  1. https://github.com/plantuml/plantuml/releases/download/v1.2021.14/plantuml-1.2021.14.jar
  2. http://beta.plantuml.net/plantuml-jlatexmath.zip 

My files structure as below:

2016/11/18  15:54         3,318,083 batik-all-1.7.jar
2016/11/25  22:53           642,396 jlatexmath-minimal-1.0.3.jar
2016/11/25  22:53           184,905 jlm_cyrillic.jar
2016/11/25  22:53           187,638 jlm_greek.jar
2021/11/23  12:16         3,837,373 plantuml-jlatexmath.zip
2021/11/22  21:51         8,881,344 plantuml.jar
2021/11/23  12:15                99 test.txt

test.txt content:

@startmath
f(t)=(a_0)/2 + sum_(n=1)^ooa_ncos((npit)/L)+sum_(n=1)^oo b_n\ sin((npit)/L)
@endmath

Java version:

java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

When I do command 'java -jar plantuml.jar test.txt', I get errors:

formula=f(t)=(a_0)/2 + sum_(n=1)^ooa_ncos((npit)/L)+sum_(n=1)^oo b_n\ sin((npit)/L)
Latex={f{{\left({t}\right)}}}=\frac{{{a}_{{0}}}}{{2}}+{\sum_{{{n}={1}}}^{\infty}}{a}_{{n}}{\cos{{\left(\frac{{{n}\pi{t}}}{{L}}\right)}}}+{\sum_{{{n}={1}}}^{\infty}}{b}_{{n}}\ {\sin{{\left(\frac{{{n}\pi{t}}}{{L}}\right)}}}
java.lang.ClassNotFoundException: org.scilab.forge.jlatexmath.TeXFormula
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at net.sourceforge.plantuml.math.TeXIconBuilder.<init>(TeXIconBuilder.java:53)
        at net.sourceforge.plantuml.math.LatexBuilder.buildIcon(LatexBuilder.java:67)
        at net.sourceforge.plantuml.math.LatexBuilder.getImage(LatexBuilder.java:83)
        at net.sourceforge.plantuml.math.AsciiMath.getImage(AsciiMath.java:71)
        at net.sourceforge.plantuml.math.ScientificEquationSafe.getImage(ScientificEquationSafe.java:115)
        at net.sourceforge.plantuml.math.ScientificEquationSafe.export(ScientificEquationSafe.java:142)
        at net.sourceforge.plantuml.math.PSystemMath.exportDiagramNow(PSystemMath.java:71)
        at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:177)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagramsDefault(PSystemUtils.java:209)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:93)
        at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:178)
        at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:519)
        at net.sourceforge.plantuml.Run.processArgs(Run.java:402)
        at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:369)
        at net.sourceforge.plantuml.Run.main(Run.java:204)

Anyone can give me a hand? Thanks.

1 Answer

0 votes
answered Nov 23, 2021 by plantuml (295,000 points)
 
Best answer
Could you try with last snapshot? https://github.com/plantuml/plantuml/releases/tag/snapshot

And tell us the result. Thanks!
commented Nov 24, 2021 by Philose

Thanks for your reply. I get the right result with 'plantuml-SNAPSHOT.jar'.

Test details as below (git-bash.exe in 'git for windows 2.32.0'):

USER@DESKTOP-PLANTUML /f/Desktop/uml
$ ll
total 16697
-rw-r--r-- 1 cui 197121 3318083 Nov 18  2016 batik-all-1.7.jar
-rw-r--r-- 1 cui 197121  642396 Nov 25  2016 jlatexmath-minimal-1.0.3.jar
-rw-r--r-- 1 cui 197121  184905 Nov 25  2016 jlm_cyrillic.jar
-rw-r--r-- 1 cui 197121  187638 Nov 25  2016 jlm_greek.jar
-rw-r--r-- 1 cui 197121 8914147 Nov 24 13:07 plantuml-SNAPSHOT.jar
-rw-r--r-- 1 cui 197121 3837373 Nov 24 13:02 plantuml-jlatexmath_2.zip
-rw-r--r-- 1 cui 197121      97 Nov 24 13:04 test.txt

USER@DESKTOP-PLANTUML /f/Desktop/uml
$ cat test.txt
@startmath
f(t)=(a_0)/2 + sum_(n=1)^ooa_ncos((npit)/L)+sum_(n=1)^oo b_n\ sin((npit)/L)
@endmath

USER@DESKTOP-PLANTUML /f/Desktop/uml
$ java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

USER@DESKTOP-PLANTUML /f/Desktop/uml
$ java -jar plantuml-SNAPSHOT.jar test.txt

USER@DESKTOP-PLANTUML /f/Desktop/uml
$
...