Easily set up a LaTeX environment with Vagrant on any operating system. This sets up vanilla Tex Live on a Vagrant precise box and runs a python script to compile latex source code in real-time.
NOTE: I have now switched to using TeX Live in the Windows 10 Windows Subsystem for Linux (WSL) for compiling LaTeX. It's faster, has support for inotify (instead of polling the hard drive for changes), and is easier to use. It is very similar to this project and can be found here: https://github.com/stevenengler/Real-Time-LaTeX.
- Install VirtualBox and Vagrant.
- Open a terminal / command prompt in the directory of the Vagrantfile.
- Run
vagrant up
to build and start the Vagrant environment. This will download Tex Live with some packages (approx 600mb total) and install it. - Run
vagrant halt
to shutdown the Vagrant virtual machine.
Simply save your *.tex files in the LaTeX_documents directory and create a "latex_project.config" file that points to your tex file. The directory that you save the "latex_project.config" file in will be the projet directory. The file must have a line with the path of the tex file to be compiled. If any files in the project directory (recursively) are modified, the file pointed to by the "latex_project.config" file will be compiled. All of the files from the compilation process (including the pdf) will be stored in a new directory named "compiled/", which will be in the project directory (where the "latex_project.config" is located). You can have multiple projects in the LaTeX_documents directory. Projects outside of the LaTeX_documents directory are not watched by this program and will not be compiled.
SumatraPDF automatically reloads any open PDF files when they're changed, and also supports inverse search using synctex. Open the PDF in SumatraPDF, and open the tex file in Notepad++. If the Vagrant environment is running, any changes that are made in Notepad++ will automatically be seen in SumatraPDF. The Windows snap feature is useful to snap SumatraPDF to one side of the screen, and Notepad++ to the other.
- LaTeX_documents
- Report
- latex_project.config
- report.tex
- compiled
- report.pdf
- report.log
- etc...
- School
- Computer Science
- latex_project.config
- source
- document.tex
- introduction.tex
- section_one.tex
- images
- flowchart.png
- compiled
- document.pdf
- document.log
- etc...
- Computer Science
- Report