From 4752a00668c8de082d467bbdb8ba47f3cb0091b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Fri, 4 Jun 2021 16:46:46 +0200 Subject: add basic file infrastructure for special function book --- buch/papers/scripts/mkbibresources | 16 +++++++ buch/papers/scripts/mkmakefile | 95 ++++++++++++++++++++++++++++++++++++++ buch/papers/scripts/mkpackages | 16 +++++++ buch/papers/scripts/mkpapers | 16 +++++++ buch/papers/scripts/mktemplate | 37 +++++++++++++++ 5 files changed, 180 insertions(+) create mode 100644 buch/papers/scripts/mkbibresources create mode 100644 buch/papers/scripts/mkmakefile create mode 100644 buch/papers/scripts/mkpackages create mode 100644 buch/papers/scripts/mkpapers create mode 100644 buch/papers/scripts/mktemplate (limited to 'buch/papers/scripts') diff --git a/buch/papers/scripts/mkbibresources b/buch/papers/scripts/mkbibresources new file mode 100644 index 0000000..ecede2b --- /dev/null +++ b/buch/papers/scripts/mkbibresources @@ -0,0 +1,16 @@ +# +# mkbibresources -- this script builds the addbibresources.tex file +# +# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +# +awk 'BEGIN { + printf("%%\n") + printf("%% addbibresources.tex -- file to add all bib resources\n") + printf("%%\n") + printf("%% (c) 2020 Prof Dr Andreas Müller, Hochschule Rapperswil\n") + printf("%%\n") +} +{ + printf("\\addbibresource{papers/%s/references.bib}\n", $1) +}' common/paperlist > common/addbibresources.tex + diff --git a/buch/papers/scripts/mkmakefile b/buch/papers/scripts/mkmakefile new file mode 100644 index 0000000..9590119 --- /dev/null +++ b/buch/papers/scripts/mkmakefile @@ -0,0 +1,95 @@ +# +# mkmakefile -- build the Makefile.inc for all the papers +# +# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +# + +# +# Header of the Makefile.inc +# +cat >common/Makefile.inc <> common/Makefile.inc + +# +# generate bibliographic dependency variables and commands +# +awk 'BEGIN { + counter=1 +} +{ + printf("buch%d-blx.bbl:\tbuch%d-blx.aux\n", counter, counter) + printf("\tbibtex buch%d-blx\n\n", counter) + counter++ +} +END { + printf("buch%d-blx.bbl:\tbuch%d-blx.aux\n", counter, counter) + printf("\tbibtex buch%d-blx\n\n", counter) + printf("BLXFILES = buch.bbl \\\n") + for (i = 1; i <= counter; i++) { + printf("\tbuch%d-blx.bbl \\\n", i) + } + #printf("\tbuch%d-blx.bbl\n", i) + printf("\n") +}' common/paperlist >> common/Makefile.inc + +# +# generate a directory list for +# +awk 'BEGIN { + printf("PAPER_DIRECTORIES = \\\n") +} +{ + printf("\t%s \\\n", $1) +} +END { + printf("\t\n") +}' common/paperlist >> common/Makefile.inc + +# +# generate a list of Makefile.inc to be used by the top level makefile +# +awk 'BEGIN { + printf("PAPER_MAKEFILEINC = \\\n") +} +{ + printf("\tpapers/%s/Makefile.inc \\\n", $1) +} +END { + printf("\t\n") +}' common/paperlist >> common/Makefile.inc + +# +# add include directives for all papers +# +awk '{ + printf("include papers/%s/Makefile.inc\n", $1) + texfiles = sprintf("%s\t$(dependencies-%s) \\\n", texfiles, $1); +} +END { + printf("\n") + printf("TEXFILES = \\\n") + printf("%s\n", texfiles) +}' common/paperlist > common/includes.inc + diff --git a/buch/papers/scripts/mkpackages b/buch/papers/scripts/mkpackages new file mode 100644 index 0000000..a9c13fd --- /dev/null +++ b/buch/papers/scripts/mkpackages @@ -0,0 +1,16 @@ +# +# mkpackages -- this script builds the package inclusions for all papers +# +# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +# +awk 'BEGIN { + printf("%%\n") + printf("%% addpackages.tex -- file to add all paper packages files\n") + printf("%%\n") + printf("%% (c) 2019 Prof Dr Andreas Müller, Hochschule Rapperswil\n") + printf("%%\n") +} +{ + printf("\\input{papers/%s/packages.tex}\n", $1) +}' common/paperlist > common/addpackages.tex + diff --git a/buch/papers/scripts/mkpapers b/buch/papers/scripts/mkpapers new file mode 100644 index 0000000..2395f09 --- /dev/null +++ b/buch/papers/scripts/mkpapers @@ -0,0 +1,16 @@ +# +# mkpapers -- this script builds the paper inclusion commands +# +# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +# +awk 'BEGIN { + printf("%%\n") + printf("%% addpapers.tex -- file to add all paper main files\n") + printf("%%\n") + printf("%% (c) 2020 Prof Dr Andreas Müller, Hochschule Rapperswil\n") + printf("%%\n") +} +{ + printf("\\input{papers/%s/main.tex}\n", $1) +}' common/paperlist > common/addpapers.tex + diff --git a/buch/papers/scripts/mktemplate b/buch/papers/scripts/mktemplate new file mode 100644 index 0000000..a5c1e52 --- /dev/null +++ b/buch/papers/scripts/mktemplate @@ -0,0 +1,37 @@ +# +# mktemplate -- generate empty project files +# +# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +#  + +# make sure we have a target argument +if [ $# -lt 1 ] +then + echo "paper short name missing" >&2 + exit 1 +fi + +target=${1:-test} + +if [ -z "${target}" ] +then + echo "target name empty" >&2 + exit 1 +fi + +# generate the directory +if [ ! -d ${target} ] +then + mkdir ${target} +fi + +FILES="Makefile.inc Makefile main.tex packages.tex references.bib" +SECTIONS="teil0.tex teil1.tex teil2.tex teil3.tex" + +for file in ${FILES} ${SECTIONS} +do + echo "generating ${target}/${file}" + sed -e 's/000template/'"${target}"'/g' < 000template/${file} \ + > ${target}/${file} +done + -- cgit v1.2.1