diff options
Diffstat (limited to '')
-rw-r--r-- | buch/papers/scripts/mkbibresources | 16 | ||||
-rw-r--r-- | buch/papers/scripts/mkmakefile | 95 | ||||
-rw-r--r-- | buch/papers/scripts/mkpackages | 16 | ||||
-rw-r--r-- | buch/papers/scripts/mkpapers | 16 | ||||
-rw-r--r-- | buch/papers/scripts/mktemplate | 37 |
5 files changed, 180 insertions, 0 deletions
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 <<EOF +# +# Makefile.inc -- Makefile Targets und Variablen für Papers +# +# Achtung: dieses File wird erzeugt vom Skript scripts/mkmakefile +# +# (c) 2020 Prof Dr Andreas Müller, Hochschule Rapperswil +# +EOF + +# +# add dependency variables for the main paper files +# +awk 'BEGIN { + printf("PAPERFILES = \\\n") + printf("\tpapers/part2.tex \\\n") + printf("\tpapers/uebersicht.tex \\\n") +} +{ + printf("\tpapers/%s/main.tex \\\n", $1) +} +END { + printf("\t\n") +}' common/paperlist >> 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..2307e3e --- /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="einleitung.tex problemstellung.tex loesung.tex folgerungen.tex" + +for file in ${FILES} ${SECTIONS} +do + echo "generating ${target}/${file}" + sed -e 's/000template/'"${target}"'/g' < 000template/${file} \ + > ${target}/${file} +done + |