Last year, Mr. Kano of Lambda Note announced TeXConf 2018 and TeX & LaTeX Advent Calendar 2018. EPS in a modern TeX environment in Day 4 article of //adventar.org/calendars/3382) He mentioned how to use the file.
In this article, a tool called ** eps2pgf ** was introduced.
Some people think the same thing, and some people have already made a Java conversion tool called ** eps2pgf ** (Reference. )). Currently, although it is posted on SourceForge, it seems that it is not maintained without the source, but for the time being, I downloaded it and used it, and I got some satisfactory results.
This tool called eps2pgf is a Java tool more than 10 years ago (it was August 2008 when you look at the update date), but now it is Status. : Abandoned
, and development seems to have stopped for a long time. Although it is an Apache license, the source is missing.
However, it is still a very useful tool (I am happy to be able to convert EPS to PGF source Mr. Kano's article / 183000)). However, installing the JVM just for this is a hassle, so I created a Docker container that packs the JVM and this tool.
Docker Hub has a lot of Java (JRE, JDK) images, even the official ones, and I'm wondering which one to choose. In the next article, each feature and selection criteria were summarized in an easy-to-understand manner.
This time,
so,
I chose ʻopenjdk: 8-jre-alpine`.
The completed image has been uploaded to Docker Hub as doratex / eps2pgf, so
$ docker pull doratex/eps2pgf
Then you can pull.
Since / workdir
is the working directory in the container, it is assumed that it will be bound-mounted with the current directory.
alias eps2pgf="docker run --rm \
--mount type=bind,src=\"\$(pwd)\",dst=/workdir \
doratex/eps2pgf"
It will be easier if you set an alias such as. Since the wrapper script of ʻeps2pgf.jar is specified as ʻENTRYPOINT
of the Docker image, under this alias is set.
$ eps2pgf tiger.eps -o tiger.pgf
You can convert EPS plates to PGF sources, for example.
The original ʻeps2pgf.jardocumentation is available from the SourceForge Repository Archive (https://sourceforge.net/projects/eps2pgf/). It is also recorded in
/ eps2pgf / doc /` in the Docker container, so
$ docker run --rm \
--mount type=bind,src="$(pwd)",dst=/workdir \
--entrypoint /bin/cp \
doratex/eps2pgf \
-p /eps2pgf/doc/eps2pgf_manual.pdf .
You can also retrieve it to the current directory as such.
Dockerfile
The Dockerfile prepared to create this image is as follows.
Dockerfile
FROM openjdk:8-jre-alpine
LABEL maintainer="doraTeX <taylorkgb [at] gmail.com>"
WORKDIR /workdir
RUN apk upgrade --update && \
mkdir /eps2pgf && \
cd /eps2pgf && \
wget -q https://excellmedia.dl.sourceforge.net/project/eps2pgf/Eps2pgf/Eps2pgf%200.7.0/eps2pgf-0.7.0.zip && \
unzip eps2pgf-0.7.0.zip && \
rm eps2pgf-0.7.0.zip && \
cd /usr/local/bin && \
printf "%s\n" \
"#!/bin/sh" \
"java -jar /eps2pgf/eps2pgf.jar \"\$@\"" \
> eps2pgf && \
chmod +x eps2pgf
ENTRYPOINT ["eps2pgf"]
Recommended Posts