We can run a Docker application in any environment, Linux, Windows, or Mac. Docker provides a set of official base images for most used operating systems and apps. Docker allows you to take full control of your environment, installing what you need, removing, and installing from Dockerfile.
In this article, I will show you three ways how to use LaTeX on Docker and VSCode Remote Containers extension. In the first part, we use tianon/latex image, and qmcgaw/latexdevcontainer Docker image in the second part. At the end, we create our image based on the qmcgaw/latexdevcontainer Docker image.
If you wish, you can delete LaTeX from your computer.
For me I needed to run:
$ brew uninstall mactex
Please install Docker Desktop and VSCode’s Remote-Containers and LaTeX-Workshop VSCode extension.
VSCode extension Microsoft Remote — Containers. Image by Author
VSCode extension LaTeX Workshop. Image by Author
Guide to Auto-Update PDF Using latexmk and VSCode
Pull tianon/latex image:
$ docker pull tianon/latex
Open settings.json by SHIFT+CMD+P:
VSCode SHIFT+CMD+P. Image by Author.
And add the following:
{
// ... YOUR OTHER SETTINGS ...
// latex
"latex-workshop.docker.enabled": true,
"latex-workshop.latex.outDir": "./out",
"latex-workshop.synctex.afterBuild.enabled": true,
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.docker.image.latex": "tianon/latex",
// End
}
#pdf #vscode #containers #docker #latex