diff --git a/design/tpl/.gitignore b/design/tpl/.gitignore index 7131a70e..40f3ab0e 100644 --- a/design/tpl/.gitignore +++ b/design/tpl/.gitignore @@ -18,3 +18,11 @@ # latexmk *.fdb_latexmk + +# configure +conf.tex +aclocal.m4 +autom4te.cache +config.status +configure + diff --git a/design/tpl/autogen.sh b/design/tpl/autogen.sh new file mode 100755 index 00000000..a42088b1 --- /dev/null +++ b/design/tpl/autogen.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Autoreconf runner + +which autoreconf &>/dev/null || { + echo "\`autoreconf' not found in PATH" + exit 1 +} + +exec autoreconf -fvi + diff --git a/design/tpl/conf.tex.in b/design/tpl/conf.tex.in new file mode 100644 index 00000000..02d757b0 --- /dev/null +++ b/design/tpl/conf.tex.in @@ -0,0 +1,5 @@ +% TAME Programming Language configuration +% +% @AUTOGENERATED@ + +\tplappendix@ENABLE_APPENDIX@ diff --git a/design/tpl/configure.ac b/design/tpl/configure.ac new file mode 100644 index 00000000..9334c329 --- /dev/null +++ b/design/tpl/configure.ac @@ -0,0 +1,38 @@ +# Autoconf configuration +# +# Copyright (C) 2021 Ryan Specialty Group, LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +## + +AC_INIT([tpl], [0.0.0], []) + +# TODO: Check for pdflatex and required packages + +use_appendix=false +AC_ARG_ENABLE( + [appendix], + [AS_HELP_STRING([--enable-appendix], + [enable appendix (default no)])], + [test "x$enableval" == xyes && use_appendix=true]) + +AC_SUBST([ENABLE_APPENDIX], [$use_appendix]) + +AC_SUBST([AUTOGENERATED], + ["THIS FILE IS AUTOGENERATED! DO NOT MODIFY! See *.in."]) + +# generate files from their *.in counterparts +AC_CONFIG_FILES([conf.tex]) +AC_OUTPUT + diff --git a/design/tpl/tpl.sty b/design/tpl/tpl.sty index 8781ac6a..2404bcbb 100644 --- a/design/tpl/tpl.sty +++ b/design/tpl/tpl.sty @@ -172,3 +172,15 @@ \hfill\textdbend\textbf{\textsl{#1}}\textdbend\hfill \bigskip } + + +% +% Dynamic Configuration +% +\newif\iftplappendix + +\InputIfFileExists{./conf.tex}% + {\message{Loaded `./conf.tex'.}}% + {\message{`./conf.tex' not found (did you run `./configure'?). + Using defaults.}% +} \ No newline at end of file diff --git a/design/tpl/tpl.tex b/design/tpl/tpl.tex index c1b02f7d..df7a6d8c 100644 --- a/design/tpl/tpl.tex +++ b/design/tpl/tpl.tex @@ -56,13 +56,12 @@ \input{sec/notation.tex} \input{sec/class.tex} -% Flag is on for now -\let\WITHAPPENDIX1 -\ifx\WITHAPPENDIX1 -\clearpage -\appendix -\input{sec/appendix-typesetting.tex} +% Appendix may be enabled with `./configure --enable-appendix'. +\iftplappendix + \clearpage + \appendix + \input{sec/appendix-typesetting.tex} \fi % Ensure Copyright line does not show for Index