When I want to save a bunch of tex equations/symbols as svg files I find there is no efficient software to fulfill this goal. But I find the interesting pipeline which is implemented on a Linux system. The following is what I did on my CentOS7 server.
Install Latex
Login in as root. Then install texlive using the following two commands
1 | yum install texlive-latex |
Check your pdflatex version using
1 | pdflatex --version |
Install pdfcrop
pdfcrop is written by perl. First install perl on CentOS
1 | yum install perl |
Check the perl version using
1 | perl -v |
Then download or clone the pdfcrop repository
1 | git clone https://github.com/ho-tex/pdfcrop.git |
cd to the directory where you can see the perl file. Run with a test pdf using
1 | perl pdfcrop.pl test.pdf |
The output is named as
1 | test-crop.pdf |
Install poppler
The original pipeline uses pdf2svg which requires poppler and cairo of high version. Installing dependencies on CentOS7 is a terrible struggle. The simplest way is to use pdftocairo which is contained in poppler-utils.
1 | yum install poppler-utils |
Then run with a test pdf
1 | pdftocairo test.pdf output.svg -svg |
Pack the pipeline
Write a bash script to pack all steps together.
1 | #!/bin/bash |