Original author: https://github.com/arkark/latexmk-docker
Useful LaTeX environment on Docker.
- One command to LaTeX environment
- Colored latexmk output
- Automatic conversion from
、。to,.
$ docker pull akashisn/latexmk- Docker image size: 3.09GB (compress size: 1.40GB)
If you want to install all packages of TeX Live, pull akashisn/latexmk:full whose size is 4.11GB (compress size: 1.94GB)
- Prepare
main.texand some necessary files: e.g., other*.texfiles,*.bibfiles, and image files. - Move to the directory.
- Execute:
If you use Mac, execute:
$ docker run --rm -it -v $PWD:/workdir -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) akashisn/latexmkIf you use Windows, execute in PowerShell:$ docker run --rm -it -v $PWD:/workdir akashisn/latexmk> docker run --rm -it -v "$(pwd):/workdir" akashisn/latexmk - Edit latex files and preview
out/main.pdfwhile monitoring a latexmk's log. - Press
Ctrl+Cto exit.
The default latexmk file is here, which uses uplatex.
If you want to customize it, add .latexmkrc file to the working directory.
For example, add the following .latexmkrc when using lualatex:
#!/usr/bin/env perl
$pdflatex = "lualatex --synctex=1 --interaction=nonstopmode --halt-on-error %O %S";
$max_repeat = 5;
$pdf_mode = 1;
$pdf_previewer = ":";
$out_dir = "out";
$pvc_view_file_via_temporary = 0;Latexdiff:
$ docker run --rm -it -v $PWD:/workdir -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) akashisn/latexmk latexdiff-vc <ARGS>Colored latexmk with a root filename:
$ docker run --rm -it -v $PWD:/workdir -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) akashisn/latexmk latexmk-ext <FILE_NAME>