Skip to content

Instantly share code, notes, and snippets.

@pixelite
Last active March 14, 2018 15:11
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pixelite/5556982 to your computer and use it in GitHub Desktop.
Save pixelite/5556982 to your computer and use it in GitHub Desktop.
Creating a Vagrant vm with sphinx and pdflatex

First create a Vagrantfile:

vagrant init precise64

Then add the following to the new Vagrantfile:

config.vm.provision :shell, :inline => <<-EOT
  apt-get update
  apt-get -y install python-pip
  pip install sphinx
  # all these packages are necessary, otherwise running "make latexpdf" gives errors
  apt-get install -y texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
EOT

Note that these latex packages add up to about 1GB of space, and will take 10 minutes (or more) to download. If that's OK, provision the VM:

vagrant up # takes like 10 minutes...

Everything succeed? Then the following will work for a suitably-configured sphinx Makefile:

vagrant ssh
cd /vagrant
make latexpdf # assumes you have a sphinx compatible Makefile which has been customized to support latexpdf

Error messages from pdflatex

  • I can't find file ptmr8t'.` : means missing package texlive-fonts-recommended
  • titlesec.sty not found: means missing package texlive-latex-extra
  • "LaTeX Error: "cmap.sty" not found" : missing package texlive-latex-recommended

Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment