summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kropat <mail@michael.kropat.name>2015-04-12 12:03:49 -0400
committerMichael Kropat <mail@michael.kropat.name>2015-04-12 12:03:49 -0400
commit344ed502a4172309a61c8ca982a7c9852f105f33 (patch)
treeb84fb9c7a1c579f18c7c0fe4bbc01151f153d599
parente23c7ba963e97cd6111b9d3ab5daa62bc7ee9ecd (diff)
Add Vagrant support
-rw-r--r--.gitignore1
-rw-r--r--Makefile4
-rw-r--r--README.md25
-rw-r--r--Vagrantfile15
-rw-r--r--dapper-invoice.cls5
5 files changed, 49 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index ef5f7e5..e97f79a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
*.log
*.out
*.pdf
+.vagrant/
diff --git a/Makefile b/Makefile
index 5a11bb4..a769db8 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/README.md b/README.md
index 3f312d1..e0a7759 100644
--- a/README.md
+++ b/README.md
@@ -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}