Pipeline for LaTeX > MathML > Similarity > Rendering
This project is a Java application (Spring Boot) with an embedded Apache Server.
It takes on the following tasks:
Task 1 and 2 are executed via an embedded REST Service in this project and is written in Java.
Task 3 is executed via an external JS widget written by students at the HTW Berlin.
Check-out this project and build it via Maven. In the /target
directory you will
find the executable server instance mathpipeline.jar
.
mvn clean install
Maven 3.2 or higher is required for the build plugin, it will create an executable jar.
For the conversion from LaTeX to MathML, LaTeXML
is required. Via configuration you can choose
to use an external service for the LaTeX > MathML conversion or use a
local installation of LaTeXML.
You can find LaTeXML here: http://dlmf.nist.gov/LaTeXML/get.html.
Copy the Jar from the target
folder to wherever you want.
Start the server by java -jar mathpipeline.jar
.
Now just call the server on http://localhost:8080/index.html
and
you can start whatever you what to do.
Since this is a Spring Boot application it can easily be used as a
Service in a Linux environment, see:
https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html
Copy the Jar from the target
folder to /var/mathpipeline/
Simply create a symlink (change the path towards your installation)
$ sudo ln -s /var/mathpipeline/mathpipeline.jar /etc/init.d/mathpipeline
Once installed, you can start and stop the service in the usual way,
e.g. service mathpipeline [start|stop|status|restart]
You can find an automatic log in /var/log/mathpipeline.log
.
It is recommended to limit your JVM and set VM options. Just place a file
called mathpipeline.conf
besides the mathpipeline.jar
and add the following content:
export JAVA_OPTS="-Xmx512m -Xms256m"
It should then look like this:
$ <your_installation_path>
$ ls
mathpipeline.jar
mathpipeline.conf
$ cat mathpipeline.conf
export JAVA_OPTS="-Xmx512m -Xms256m"
We use Swagger for the API documentation. You can always view the API per
default on http://localhost:8080/swagger-ui.html
.
If you want to use a custom configuration place a file named application.yaml
in the execution / installation folder. The content should be (this is the default configuration used by the application):
server:
# servlet-path: /pipe # custom servlet-path
port: 8080 # default server port, if not set otherwise
# Math AST Renderer - Main URL
mast.url: http://math.citeplag.org
# the use of the latexml online service (via url)
# if no url is given a local latexml installation will be called
latexml:
active: true
url: http://gw125.iu.xsede.org:8888 # url for online service or emtpy ""
params: # parameters for the online service
whatsin: math
whatsout: math
includestyles:
format: xhtml
pmml:
cmml:
nodefaultresources:
linelength: 90
quiet:
preload:
- "LaTeX.pool"
- "article.cls"
- "amsmath.sty"
- "amsthm.sty"
- "amstext.sty"
- "amssymb.sty"
- "eucal.sty"
- "DLMFmath.sty"
- "[dvipsnames]xcolor.sty"
- "url.sty"
- "hyperref.sty"
- "[ids]latexml.sty"
- "texvc"
# Mathoid - alternative Latex to MathML converter
mathoid:
active: true
url: http://localhost:10044/mml
The vmext-demo
docker is now a private docker container. It is no
longer maintained over DockerHub because it contains LaCASt (currently private).
Updating vmext-demo on DKE has to be done manually now.
target/mathpipeline.jar
lacast.config.yaml
according to your system needs.java -jar target/mathpipeline.jar
and check on localhost:8080/swagger-ui.html
scp target/mathpipeline user@dke01:~/mathpipeline.jar
docker ps
. The name is vmext-demo
and tag lacast
.docker cp mathpipeline.jar vmext-demo:/mathpipeline.jar
docker commit vmext-demo vmext-demo:lacast
(first the docker name, than the image name)/usr/bin/docker-compose restart vmext-demo
. That’s it.
If you need to start from scratch you need a free developer license for mathematica and:
docker build . -t vmext-demo:lacast
(thats the image name). This may take somedocker run --name vmext-demo -p 8080:8080 vmext-demo:lacast
docker exec -it vmext-demo /bin/bash
/usr/bin/wolframscript
and activate your license (e-mail credentials you took to get your free developer license.exit
docker commit vmext-demo vmext-demo:lacast
.