diff options
author | Michael Kropat <mail@michael.kropat.name> | 2015-04-12 12:03:49 -0400 |
---|---|---|
committer | Michael Kropat <mail@michael.kropat.name> | 2015-04-12 12:03:49 -0400 |
commit | 344ed502a4172309a61c8ca982a7c9852f105f33 (patch) | |
tree | b84fb9c7a1c579f18c7c0fe4bbc01151f153d599 | |
parent | e23c7ba963e97cd6111b9d3ab5daa62bc7ee9ecd (diff) |
Add Vagrant support
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | README.md | 25 | ||||
-rw-r--r-- | Vagrantfile | 15 | ||||
-rw-r--r-- | dapper-invoice.cls | 5 |
5 files changed, 49 insertions, 1 deletions
@@ -2,3 +2,4 @@ *.log *.out *.pdf +.vagrant/ @@ -1,3 +1,7 @@ +# Makefile forked from Mike Wilcox's resume project Makefile [1] +# +# [1] https://github.com/mjw56/mike-wilcox-latex-resume/blob/master/Makefile + .SUFFIXES: .tex .pdf .PHONEY : default install uninstall clean pdf watch @@ -8,8 +8,14 @@ A billable-time invoice featuring style over substance. - [TeX Live](https://www.tug.org/texlive/acquire-netinstall.html) +— or — + +- [Vagrant](https://www.vagrantup.com/downloads.html) + ### Generating an Invoice +#### Using TeX Live Locally + ``` cp example.tex your-invoice-101.tex # make some changes to your-invoice-101.tex @@ -18,6 +24,25 @@ make your-invoice-101.pdf Your invoice will be created as `your-invoice-101.pdf` +#### Using Vagrant + +``` +cp example.tex your-invoice-101.tex +vagrant up # this may take a while the first time +vagrant ssh -c 'cd /vagrant; make REPORT=your-invoice-101 watch' +``` + +Now whenever you make changes to `your-invoice-101.tex` on your host machine, +the watcher inside the VM will automatically build `your-invoice-101.pdf`, +which will be saved back to the host machine. + +When finished editing, input <kbd>Control</kbd>-<kbd>C</kbd> to stop the +watcher, then run: + +``` +vagrant halt +``` + ### Documentation See [example.tex](example.tex) and [dapper-invoice.cls](dapper-invoice.cls) for details. diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..6359137 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,15 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.box = "ubuntu/trusty64" + + config.vm.provider "virtualbox" do |v| + v.memory = 1024 # necessary to avoid 'I can't write on file' errors + end + + config.vm.provision "shell", inline: \ + 'apt-get install -y texlive texlive-fonts-extra texlive-latex-extra texlive-science texlive-xetex' +end diff --git a/dapper-invoice.cls b/dapper-invoice.cls index ba722fb..af9e104 100644 --- a/dapper-invoice.cls +++ b/dapper-invoice.cls @@ -1,6 +1,6 @@ % dapper-invoice.cls -- a billable-hours invoice featuring style over substance -\ProvidesClass{dapper-invoice}[2015/01/18] +\ProvidesClass{dapper-invoice}[2015/04/12] \NeedsTeXFormat{LaTeX2e} \LoadClass[11pt]{article} @@ -15,6 +15,9 @@ % For "At*" hooks \RequirePackage{etoolbox} +% For page number calculations +\RequirePackage{ifthen} + % For adjusting footer \RequirePackage{fancyhdr} |