design/tpl: configure script (for appendix)

It's not required; TPL will fall back when missing conf.tex.
master
Mike Gerwitz 2021-05-18 15:51:48 -04:00
parent 80fd239d95
commit d65c061b29
6 changed files with 78 additions and 6 deletions

View File

@ -18,3 +18,11 @@
# latexmk
*.fdb_latexmk
# configure
conf.tex
aclocal.m4
autom4te.cache
config.status
configure

View File

@ -0,0 +1,10 @@
#!/bin/sh
# Autoreconf runner
which autoreconf &>/dev/null || {
echo "\`autoreconf' not found in PATH"
exit 1
}
exec autoreconf -fvi

View File

@ -0,0 +1,5 @@
% TAME Programming Language configuration
%
% @AUTOGENERATED@
\tplappendix@ENABLE_APPENDIX@

View File

@ -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 <http://www.gnu.org/licenses/>.
##
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

View File

@ -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.}%
}

View File

@ -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