If you do not want to install a tex distribution locally (which takes ages), with this project you can build your PDF from any .tex
file. The onSave feature is also available 😊
- No need of installing latex on your machine
- Just need ~700 MB of space (size of the docker image)
- Copy and paste the
Dockerfile
anddocker-compose.yml
and put them at the root of your project - Create a folder
main/
in the root of your latex project - Go inside
main/
and createmain.tex
file - Write something in it for example
\documentclass{article}
\usepackage{tikzsymbols}
\begin{document}
Here it is an example of \normalsize \LaTeX \ document. Enjoy \Laughey[1.3]
\end{document}
- Since the auto save is not activated yet, test the PDF generation simply by typing
docker-compose up
Of course you can change either the main/
folder or the main.tex
simply by going to the docker-compose.yml
editing the following lines:
- ./main:/data
to- <your folder>:/data
command: main.tex
tocommand: <name of your .tex file in your folder>
It can also happen that you import some packages in the project that are not included in the docker image yet. For this:
- import them in
Dockerfile
like
RUN tlmgr install sectsty helvetic .....
- rebuild the image using
docker-compose up --build
To achieve this in Visual Studio Code, install Run on Save and follow the extension instructions. I have put this in my settings.json
. In order to check if it works, you have to go under the output tab of Visual Studio Code terminal and select 'Run On Save' option
"emeraldwalk.runonsave": {
"commands": [
{
"match": ".tex$",
"cmd": "docker-compose up"
}
]
}