Installation Part IBystroTeX consists of the frontend (Racket) and backend (Java). The Java part works
like a server. It is actually an HTTP server. It listens on some port on the localhost.
We will start with setting up this server.
To install the server, you will need to install the following things on your computer:
Now execute the following commands:
git clone https://github.com/amkhlv/latex2svg
git submodule init
git submodule update
mvn clean install
This will take some time, as various libraries will have to be downloaded (and saved in ~/.ivy2 and ~/.sbt).
Our Java server will communicate to the Racket frontend some initial settings (including the anti-CSRF token) by writing them into an XML file. You have to decide how it should name this file and where to put it. Suppose that you decided to call it bystroConf.xml, and choosen some directory where it will be:
remember this location; you will need need it in the following steps
Under this assumption, start the server by typing the following command:
target/universal/stage/bin/latex2svg -DbystroFile=/path/to/bystroConf.xml -Dhttp.port=9749 -Dhttp.address=127.0.0.1
If you want to use BibTeX, add the option -Dbibfile=/path/to/your/file.bib
The port number 9749 is also up to you to choose. The frontend will know it because it will be written (among other things) to /path/to/bystroConf.xml
Now the server is running.
Notice that we specified the option -Dhttp.address=127.0.0.1. Therefore the server is only listening on a local interface (the “loopback”); it is not possible to connect to it from the outside. However, it would be still possible to attack it from a running browser by CSRF. Our defense is token and custom header. Should CSRF somehow succeed in spite of these measures, actually exploiting it would require a vulnerability in JLaTeXMath.