From 4dc09d93cc9a6df1f0a7d6b228300252192c1fc0 Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Wed, 20 Jan 2021 17:31:00 -0500
Subject: switched out sed for \input code (more reusable)
---
Makefile | 23 ++++++++++-------------
fmt/doc.h | 2 ++
poster.tex | 2 ++
report/tables.i | 2 +-
src/results.i | 3 ++-
tables.i | 29 +++++++++++++++++++++++++++++
tables.orig.tex | 29 -----------------------------
7 files changed, 46 insertions(+), 44 deletions(-)
create mode 100644 tables.i
delete mode 100644 tables.orig.tex
diff --git a/Makefile b/Makefile
index 2c11738..152d80b 100644
--- a/Makefile
+++ b/Makefile
@@ -5,10 +5,11 @@
PDFTEX = pdftex
PY = python3
-all: report.pdf poster.pdf logbook.pdf
+all: report.pdf poster.pdf logbook.pdf report2.pdf poster2.pdf \
+logbook2.pdf
clean:
- rm -rf {report,poster,logbook}.{pdf,log} qr gen graph imgs
+ rm -rf {report,poster,logbook}{,2}.{pdf,log} qr gen graph imgs
.tex.pdf:
$(PDFTEX) -jobname $* $<
@@ -34,9 +35,9 @@ img/2019-11-21-2.jpg img/2019-11-21-3.jpg img/2019-12-02-1.jpg src/conc.i \
img/2019-12-13-1.jpg img/2019-12-13-3.rot.jpg fmt/doc.h report/tables.i
report.pdf poster.pdf logbook.pdf: fmt/com.h imgs graph/made \
-gen/tables.i fmt/font.h src/mats.i img/2019-12-02-2.jpg \
-img/2019-10-18-2.jpg img/2019-10-18-1.jpg img/2019-11-21-4.jpg \
-img/2019-12-13-2.jpg
+tables.i gen/deathtable.i gen/table.i fmt/font.h src/mats.i \
+img/2019-12-02-2.jpg img/2019-10-18-2.jpg img/2019-10-18-1.jpg \
+img/2019-11-21-4.jpg img/2019-12-13-2.jpg
imgs: py/data.py py/img.py
mkdir -p imgs
@@ -46,15 +47,11 @@ gen/dir:
mkdir -p gen
touch gen/dir
-gen/tables.i: tables.orig.tex gen/deathtable gen/table gen/dir
- sed -e '/%%DEATHTABLE%%/{r gen/deathtable' -e 'd}' \
- -e '/%%MAINTABLE%%/{r gen/table' -e 'd}' tables.orig.tex >gen/tables.i
+gen/deathtable.i: py/data.py py/deathtable.py gen/dir
+ $(PY) py/deathtable.py > gen/deathtable.i
-gen/deathtable: py/data.py py/deathtable.py gen/dir
- $(PY) py/deathtable.py > gen/deathtable
-
-gen/table: py/data.py py/table.py gen/dir
- $(PY) py/table.py > gen/table
+gen/table.i: py/data.py py/table.py gen/dir
+ $(PY) py/table.py > gen/table.i
graph/dir:
mkdir -p graph
diff --git a/fmt/doc.h b/fmt/doc.h
index 7f55a4f..60195f5 100644
--- a/fmt/doc.h
+++ b/fmt/doc.h
@@ -1,6 +1,8 @@
% Generic format file pulled out from format.tex
+\let\oldinput\input
\input color %blue links!
+\let\input\oldinput % color tries to redefine input
\input fmt/font.h
diff --git a/poster.tex b/poster.tex
index 01c3f0c..0a2fd65 100644
--- a/poster.tex
+++ b/poster.tex
@@ -13,7 +13,9 @@
\input fmt/font.h
\input fmt/multicol.h
\input fmt/com.h
+\let\oldinput\input
\input color
+\let\input\oldinput
\fboxsep=0pt
\input poster/palette.h
diff --git a/report/tables.i b/report/tables.i
index 2042d34..8f2eb5f 100644
--- a/report/tables.i
+++ b/report/tables.i
@@ -1,4 +1,4 @@
-\input gen/tables.i
+\input tables.i
{%\baselineskip=13pt
\centerline{\deaths}
%\global\advance\pics by 1\relax
diff --git a/src/results.i b/src/results.i
index 44df4e7..73b8538 100644
--- a/src/results.i
+++ b/src/results.i
@@ -1,4 +1,5 @@
-\input gen/tables.i
+\input tables.i
+
\font\tablefont=cmr10 at 11pt
\font\lrgtbl=cmr10 at 14pt
{\offinterlineskip\par}
diff --git a/tables.i b/tables.i
new file mode 100644
index 0000000..511b818
--- /dev/null
+++ b/tables.i
@@ -0,0 +1,29 @@
+\def\multirow#1#2{{\count0=#1\advance\count0 by -1%
+ \dimen0=\rowht\multiply\dimen0 by \count0\smash{\lower\dimen0\hbox{\hss#2\hss}}}}
+\def\cline{\omit\vrule\hfil\vrule&\multispan{3}{\leaders\hrule\hfil}\cr}
+\newskip\tableskipamount\tableskipamount=2pt plus 1fill
+\def\tableskip{\hskip\tableskipamount}
+\def\cell#1{\tableskip\strut\ignorespaces #1\unskip\tableskip\vrule}
+\def\deaths{%
+\setbox0=\vbox{\offinterlineskip
+\halign{\vrule\cell{##}&&\cell{##}\cr\noalign{\hrule}
+Trial Size& Date& Introduced& Deaths& Pits formed\cr\noalign{\hrule}
+\input gen/deathtable.i
+}}%
+\dimen0\wd0
+\vbox{\box0{\hsize\dimen0\caption{Number of Deaths and Pits Successfully
+Formed in Each Trial/Subtrial}}}%
+}
+\def\territory{%
+\setbox0=\vbox{\strut\hrule}\dimen0=.5\ht0
+\edef\rowht{\the\dimen0}
+\setbox0=\vbox{\offinterlineskip
+\halign{\vrule\cell{##}&&\cell{##}\cr\multispan{4}\leaders\hrule\hfil\cr
+Dimensions (in)& Pit Depth (cm)& Pit Width (cm)& Nearest Neighbor
+(cm)\cr\multispan{4}\leaders\hrule\hfil\cr
+\input gen/table.i
+}}%
+\dimen0\wd0
+\vbox{\box0\hbox to \dimen0{\hss\vbox{\caption{The Pit Depths, Widths, and
+``Territory,'' Observed in Each Trial}}\hss}}%
+}
diff --git a/tables.orig.tex b/tables.orig.tex
deleted file mode 100644
index 72d67ba..0000000
--- a/tables.orig.tex
+++ /dev/null
@@ -1,29 +0,0 @@
-\def\multirow#1#2{{\count0=#1\advance\count0 by -1%
- \dimen0=\rowht\multiply\dimen0 by \count0\smash{\lower\dimen0\hbox{\hss#2\hss}}}}
-\def\cline{\omit\vrule\hfil\vrule&\multispan{3}{\leaders\hrule\hfil}\cr}
-\newskip\tableskipamount\tableskipamount=2pt plus 1fill
-\def\tableskip{\hskip\tableskipamount}
-\def\cell#1{\tableskip\strut\ignorespaces #1\unskip\tableskip\vrule}
-\def\deaths{%
-\setbox0=\vbox{\offinterlineskip
-\halign{\vrule\cell{##}&&\cell{##}\cr\noalign{\hrule}
-Trial Size& Date& Introduced& Deaths& Pits formed\cr\noalign{\hrule}
-%%DEATHTABLE%%
-}}%
-\dimen0\wd0
-\vbox{\box0{\hsize\dimen0\caption{Number of Deaths and Pits Successfully
-Formed in Each Trial/Subtrial}}}%
-}
-\def\territory{%
-\setbox0=\vbox{\strut\hrule}\dimen0=.5\ht0
-\edef\rowht{\the\dimen0}
-\setbox0=\vbox{\offinterlineskip
-\halign{\vrule\cell{##}&&\cell{##}\cr\multispan{4}\leaders\hrule\hfil\cr
-Dimensions (in)& Pit Depth (cm)& Pit Width (cm)& Nearest Neighbor
-(cm)\cr\multispan{4}\leaders\hrule\hfil\cr
-%%MAINTABLE%%
-}}%
-\dimen0\wd0
-\vbox{\box0\hbox to \dimen0{\hss\vbox{\caption{The Pit Depths, Widths, and
-``Territory,'' Observed in Each Trial}}\hss}}%
-}
--
cgit