aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-05-28 18:43:02 -0400
committerHolden Rohrer <hr@hrhr.dev>2020-05-28 18:43:02 -0400
commit84aed252dd24fc62cfec4b877edd5c8e90e43035 (patch)
tree11bfdb7a69b0ae7f8a738ff09db9650685090dd9
parentd1fcf6fb400ef1dab7d988354b4ca48614e93420 (diff)
parentd6ed0246fef2253ad8f4c4e98fcf27c016bdbd37 (diff)
Merge branch 'configure'
-rw-r--r--.gitignore1
-rw-r--r--Makefile64
-rw-r--r--Makefile.orig47
-rw-r--r--README10
-rwxr-xr-xconfigure23
l---------logbook/datatables.tex1
-rw-r--r--logbook/document.tex2
l---------outputs/document.pdf1
l---------outputs/poster.pdf1
l---------outputs/report.pdf1
l---------poster/datatables.tex1
-rw-r--r--poster/results.tex2
l---------report/datatables.tex1
-rw-r--r--report/tables.tex2
14 files changed, 85 insertions, 72 deletions
diff --git a/.gitignore b/.gitignore
index 6c7023f..81ad520 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@ outputs/*
imgs/made
gen/tables.tex
graph
+Makefile
diff --git a/Makefile b/Makefile
deleted file mode 100644
index f55bb12..0000000
--- a/Makefile
+++ /dev/null
@@ -1,64 +0,0 @@
-.POSIX:
-.SUFFIXES: .tex .pdf
-
-DIRS = outputs graph
-PDFS = poster/document.pdf report/document.pdf logbook/document.pdf
-pdfs: outputs/poster.pdf outputs/report.pdf outputs/logbook.pdf
-$(DIRS):
- mkdir -p $@
-
-outputs/poster.pdf: poster/document.pdf outputs
- cp -f $< $@
-outputs/report.pdf: report/document.pdf outputs
- cp -f $< $@
-outputs/logbook.pdf: logbook/document.pdf outputs
- cp -f $< $@
-
-png: outputs/poster.png
-clean:
- rm -rf imgs gen/tables.tex $(DIRS) data/tables.tex $(PDFS)
-
-imgs: python/data.py python/img.py
- mkdir -p imgs
- cd imgs && \
- python3 ../python/img.py
-
-graph/depth_width.png: python/data.py python/depwid.py graph
- cd graph && python3 ../python/depwid.py
-
-graph/nearest_neighbor.png: python/data.py python/neighbor.py graph
- cd graph && python3 ../python/neighbor.py
-
-graph/made: graph/depth_width.png graph/nearest_neighbor.png graph
- touch graph/made
-
-outputs/poster.png: outputs/poster.pdf outputs
- gs -sDEVICE=pngalpha -r288 -o outputs/poster.png outputs/poster.pdf
-
-$(PDFS): gen/tables.tex imgs graph/made
-
-.tex.pdf:
- cd ${@D} && \
- pdftex document.tex >/dev/null
- rm ${@D}/document.log
-
-poster/document.pdf: poster/abstract.tex poster/analysis.tex poster/conclusion.tex poster/document.tex poster/format.tex poster/hypothesis.tex poster/imagesfive.tex poster/imagesfour.tex poster/imagesone.tex poster/imagesthree.tex poster/imagestwo.tex poster/materials.tex poster/methods.tex poster/notes.tex poster/palette.tex poster/research.tex poster/results.tex poster/vars.tex poster/voronoi.tex
-
-report/document.pdf: report/abstract.tex report/analysis.tex report/biblio.tex report/conclusion.tex report/document.tex report/format.tex report/graphs.tex report/intro.tex report/materials.tex report/pics.tex report/procedure.tex report/research.tex report/tables.tex
-
-logbook/document.pdf: logbook/biblio.tex logbook/bulletnotes.tex logbook/conclusion.tex logbook/document.tex logbook/hypothesis.tex logbook/mats.tex logbook/methods.tex logbook/research.tex logbook/vars.tex
-
-gen/tables.tex: gen/maketables.sh gen/tables.orig.tex
- gen/maketables.sh
-
-poster/document.pdf: outputs/qr-source.png outputs/qr.png
-logbook/document.pdf report/document.pdf: generic.tex
-
-logbook/tables.tex poster/tables.tex: data/tables.tex
-
-outputs/qr.png: outputs
- qrencode https://hrhr.dev/report.pdf -o outputs/qr.png
-
-outputs/qr-source.png: outputs
- qrencode https://git.hrhr.dev/scifair -o outputs/qr-source.png
-
diff --git a/Makefile.orig b/Makefile.orig
new file mode 100644
index 0000000..b0a3d3e
--- /dev/null
+++ b/Makefile.orig
@@ -0,0 +1,47 @@
+.POSIX:
+.SUFFIXES: .tex .pdf
+
+PDFS = poster/document.pdf report/document.pdf logbook/document.pdf
+QR = outputs/qr.png outputs/qr-source.png
+PYTHON = python3
+PDFTEX = pdftex
+GHOSTSCRIPT = gs
+
+pdfs: $(PDFS)
+png: outputs/poster.png
+clean:
+ rm -rf imgs graph gen/tables.tex data/tables.tex $(PDFS) $(QR)
+
+imgs: python/data.py python/img.py
+ mkdir -p imgs
+ cd imgs && \
+ $(PYTHON) ../python/img.py
+
+graph:
+ mkdir -p graph
+
+GRAPH = graph/depth_width.png graph/nearest_neighbor.png
+graph/depth_width.png: python/data.py python/depwid.py graph
+ cd graph && $(PYTHON) ../python/depwid.py
+
+graph/nearest_neighbor.png: python/data.py python/neighbor.py graph
+ cd graph && $(PYTHON) ../python/neighbor.py
+
+outputs/poster.png: poster/document.pdf
+ $(GHOSTSCRIPT) -sDEVICE=pngalpha -r288 -o outputs/poster.png outputs/poster.pdf
+
+$(PDFS): gen/tables.tex imgs $(GRAPH)
+
+.tex.pdf:
+ cd ${@D} && \
+ $(PDFTEX) document.tex
+ rm ${@D}/document.log
+
+poster/document.pdf: outputs/qr-source.png outputs/qr.png
+logbook/document.pdf report/document.pdf: generic.tex
+
+outputs/qr.png:
+ qrencode https://hrhr.dev/report.pdf -o outputs/qr.png
+
+outputs/qr-source.png:
+ qrencode https://git.hrhr.dev/scifair -o outputs/qr-source.png
diff --git a/README b/README
index 6ed2300..2b602b7 100644
--- a/README
+++ b/README
@@ -8,17 +8,17 @@ Contains some .tex files for generating the report in plain TeX and .py files fo
Requisites:
-- GNU Make
+- Make
- Python3
-- PDFTeX
-
-- Color.tex (usually preinstalled)
+- PDFTeX with color.tex, miniltx.tex (installed with TeX Live)
- SciPy, Matplotlib, numpy (Python libraries)
-Run `make -j8` in the toplevel directory to build with the GNU Makefile.
+- Ghostscript for PNG building
+
+Run `./configure ; make -j8` in the toplevel directory to build with the GNU Makefile.
## Results
diff --git a/configure b/configure
new file mode 100755
index 0000000..2e56ed4
--- /dev/null
+++ b/configure
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+python3 --version >/dev/null || ( echo "Install python3" && exit 1 )
+pdftex --version >/dev/null || ( echo "Install pdftex (TeXLive)" && exit 1 )
+make -v >/dev/null || ( echo "Install make" && exit 1 )
+python -c "import numpy" >/dev/null || ( echo "Install numpy" && exit 1 )
+python -c "import scipy" >/dev/null || ( echo "Install scipy" && exit 1 )
+python -c "import matplotlib" >/dev/null || ( echo "Install matplotlib" && exit 1 )
+gs --version >/dev/null || echo "Ghostscript not installed (no PNG poster)"
+
+cp Makefile.orig Makefile
+
+for tgt in */document.tex; do
+ DIR=$(dirname $tgt)
+ ( echo -en "\n${DIR}/document.pdf: ${DIR}/document.tex "; find $DIR \!\
+ -type d \! -name "document.tex" -a -name "*.tex" -exec echo {} +; ) >> Makefile
+done
+
+for gen in gen/*.orig.tex; do
+ BASE=$(basename $gen .orig.tex)
+ echo "gen/${BASE}.tex: gen/make${BASE}.sh gen/${BASE}.orig.tex" >> Makefile
+ echo -e "\t$<\n" >> Makefile
+done
diff --git a/logbook/datatables.tex b/logbook/datatables.tex
new file mode 120000
index 0000000..bc02edd
--- /dev/null
+++ b/logbook/datatables.tex
@@ -0,0 +1 @@
+../gen/tables.tex \ No newline at end of file
diff --git a/logbook/document.tex b/logbook/document.tex
index 07c0726..9b019f3 100644
--- a/logbook/document.tex
+++ b/logbook/document.tex
@@ -51,7 +51,7 @@
\noindent{\bf Tables:}
-\input ../gen/tables
+\input datatables
\abreak
diff --git a/outputs/document.pdf b/outputs/document.pdf
new file mode 120000
index 0000000..e00fe07
--- /dev/null
+++ b/outputs/document.pdf
@@ -0,0 +1 @@
+../logbook/document.pdf \ No newline at end of file
diff --git a/outputs/poster.pdf b/outputs/poster.pdf
new file mode 120000
index 0000000..471dfbf
--- /dev/null
+++ b/outputs/poster.pdf
@@ -0,0 +1 @@
+../poster/document.pdf \ No newline at end of file
diff --git a/outputs/report.pdf b/outputs/report.pdf
new file mode 120000
index 0000000..e556b83
--- /dev/null
+++ b/outputs/report.pdf
@@ -0,0 +1 @@
+../report/document.pdf \ No newline at end of file
diff --git a/poster/datatables.tex b/poster/datatables.tex
new file mode 120000
index 0000000..bc02edd
--- /dev/null
+++ b/poster/datatables.tex
@@ -0,0 +1 @@
+../gen/tables.tex \ No newline at end of file
diff --git a/poster/results.tex b/poster/results.tex
index 5004db8..8506bdd 100644
--- a/poster/results.tex
+++ b/poster/results.tex
@@ -1,4 +1,4 @@
-\input ../gen/tables
+\input datatables
\newfont tablefont=cmr10@11pt
\def\table#1#2{
\vbox{\setbox0=\vbox{\halign{&\vrule\strut\hskip3pt\hfil {\tablefont ##}\hfil\hskip3pt\vrule\cr\noalign{\hrule}
diff --git a/report/datatables.tex b/report/datatables.tex
new file mode 120000
index 0000000..bc02edd
--- /dev/null
+++ b/report/datatables.tex
@@ -0,0 +1 @@
+../gen/tables.tex \ No newline at end of file
diff --git a/report/tables.tex b/report/tables.tex
index a3ebb4d..288e5a6 100644
--- a/report/tables.tex
+++ b/report/tables.tex
@@ -1,4 +1,4 @@
-\input ../gen/tables
+\input datatables
\newdimen\oldbaseskip \oldbaseskip=\baselineskip
\baselineskip=13pt
\deaths